What should i use to create a programmimg language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What should i use to create a programmimg language?

There are many programming languages in the world. If i want to create one more, what should i use?

13th Feb 2019, 7:11 PM
Billy Beagle
4 Answers
+ 6
You could make a programming language based on another language, for example, you could make a compiler in c++ that reads your custom language code from a file, processes it and converts to machine code and then writes it down to an executable file. then, using that new custom compiler, you could rewrite the language's compiler in the new language itself to make it independent. If im not mistaken, python was based on C but then python interpreter was re-written in python itself. (if not, just take it as an example, its better not to do that in interpreted languages anyways...) There are many books on compiler theory out there...
13th Feb 2019, 8:07 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
Your best bet is to pick a language similar to your new language to write the compiler in. But, any can be used. As Valen.H. ~ mentioned, rewriting the compiler in itself is typical. However, you don't build your complete language first. Your first compiler in the other language only supports a minor subset of your language providing enough features to code it in your language. You port that to your new language subset. Followed, by expanding that multiple times to your finished compiler making use of features after they are added for the next version.
23rd Feb 2019, 3:40 AM
John Wells
John Wells - avatar
+ 1
John Wells Thanks!
23rd Feb 2019, 5:46 AM
Billy Beagle
+ 1
Valen.H. ~ Thanks!
23rd Feb 2019, 5:52 AM
Billy Beagle