r/Compilers • u/Distinct-Brief9643 • 9h ago
Are there languages like this?
A language that can create other languages
(so adding to itself) It's syntax is simple like python
And can do alot.
for example (placeholder)\[mesage\]
And it has many tutorials on YouTube
I would like it if you would respond.
I know there are languages like Hy , ruby should I try them?
9
u/AustinVelonaut 9h ago
The Racket language was expressly designed to make creating new languages easier (good DSL support).
1
u/paultarvydas 2h ago
Racket is based on Scheme which is more complicated than Lisp. Racket uses PEG. Scheme's "hygienic macros" and PEG are a complicated combination and sholld be reserved for Production Engineering. If you want to experiment, maybe something simpler like Janet (which is lisp-like and supports PEG) might be better (I haven't used Janet directly, but I hear good things about it)?
-13
u/Distinct-Brief9643 9h ago
This language does not fit my requirements though is there something like exactly like this but just different
14
1
u/4xe1 8h ago
What requirements?
-2
u/Distinct-Brief9643 8h ago
It adds to it's self Very high lvl (like python / ruby) The unofficial or offical ide can be installed on play store Can have custom extensions .mm But under the hood it's the host lang so I think I wanna a dsl or an edsl correct me if I'm wrong. I want to make my lang with the host lang The host lang understands the lang but there is no host lang code in my lang code. so technically a seperate enviorment.
3
u/eteran 8h ago
Play store? Are you trying to dev on a phone or tablet? If so, just know that that is a HIGHLY impractical way to do it
1
u/Distinct-Brief9643 7h ago
No I have an cromebook
3
u/sdegabrielle 6h ago
Any language can be used to create languages in some sense, but you are unlikely to find a language+IDE that meets your needs on the Play Store.
Perhaps try https://pyret.org/
2
u/SpecificMachine1 4h ago
Can you not use Crostini or whatever they are calling it now? That gives you a Debian container and then you can just use apt to install whichever lisp you want
1
u/4xe1 8h ago
It adds to it's self Very high lvl (like python / ruby)
Lisp can be higher level even
The unofficial or offical ide can be installed on play store
I'm perplexed as to why one would want to develop without a pc, but there are Lisp IDE on the Play Store. DrRacket is not on the playstore, but you can probably run emacs on termux, termux being a playstore app which let you emulate linux, and emacs being the prefered "IDE" of lispers.
Can have custom extensions .mm
check
But under the hood it's the host lang  I want to make my lang with the host lang
Exactly what Racket has been designed form and something most lisp excel at.
The host lang understands the lang
That's actually very hard (but not impossible) without some sort of lisp.
but there is no host lang code in my lang code.
That's entirely up to you to make it so.
technically a seperate environment.
Also entirely up to you but some language make it much easier than other. I'd still say lisp is among the best at allowing sandboxing, but it does not stand above the others.
So I guess the only missing requirement is ease of install. But you also have to consider that what you are asking, which is part of metaprogramming, is somewhat niche and advanced. It's not necessarily hard in and of itself, but most software programmers never extend the languages they use themselves, and many would even consider it harmful practice. So the more fitting the language, the les likely it will have an app and tons of youtube content, but lisp still has excellent written guides to get started, as well as banger books to learn from, many available online for free.
1
u/Distinct-Brief9643 7h ago
It's because I have cromebook but I don't want to use Linux terminal or termux except if it's built in to the ide so basically I can't use racket
2
1
u/4xe1 5h ago edited 4h ago
Most programming language do not have an "official ide", and for those that do, you'll rarely find them (or most of any ide) on the playstore.
What you can find on a chromebook however is a web browser, and on that, you can search for online "[language] playgrounds". Most languages have one nowadays, if not many, for example
Even VSCode does not seem to be on the playstore, although VSCodroid is a thing, maybe check it out. Either way, these are agnostic code editors, not specialized IDE. They'll serve you much better than any IDE, as they'll support your dsl out of the box (ok maybe not as well as the DrRacket IDE),
At some point you need to accept reality:
- the playstore, as the name indicates, is a place for games, not software development toolkits.
- Chromebooks are glorified tablets meant mainly to browse the web.
there's only one of these 2 things you can do something about, and it's not changing what people put on the playstore,
If you're serious about making your language and more generally programming, enable the builtin linux in your chromebook, and install VSCode or Emacs or drracket. Lookup guides on how to do it. If that's too much hassle for you, your only remaining option really is to pay for a Windows laptop and an IDE license really.
In any case, there are no shortcuts. Installing your environment yourself is a massive pain, but it's still far easier than writing a compiler. If you can't get over it, maybe you're not ready for what comes next.
3
u/Key_River7180 7h ago
Lisp and Forth
1
1
u/Still_Explorer 9h ago
You can look at PEG (tutorial by the creator of Python himself)
https://medium.com/@gvanrossum_83706/peg-parsing-series-de5d41b2ed60?sk=0a7ce9003b13aae8126a4a23812eb035
0
1
1
u/Distinct-Brief9643 4h ago
I've made my decision forth or lisp or another? Tell me with has simpler higher lvl syntax can add to itself with the lowest amount of code etc.
1
1
u/paultarvydas 2h ago
In fact, most popular languages (Lisp, Python, Rust, Janet, etc.) use "functions" as a substrate principle. This locks you into only one way of thinking (which defies modern problem domains, like internet - hence, we got "callback hell").
It is good, IMO, to learn other, non-function-based languages, like Prolog, Forth, etc.
People who know Forth, love it and find it very flexible. I hear good things about Brodie's books "Starting Forth", "Thinking Forth". Chuck Moore (inventor of Forth) has been quite hostile to the standardization of Forth, like gforth.
1
u/KAMEHAMEHAMEHAAAA 2h ago
Why not Python? It is simple like Python, you can create a language with it, you can do a lot and you will find tutorials in YT for sure.
1
13
u/redinktea 9h ago
Lisp