How can we create a programming language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How can we create a programming language?

23rd Sep 2023, 4:40 PM
TaNiSha[inåçtïvë]
TaNiSha[inåçtïvë] - avatar
9 Answers
+ 3
Design your language Choose a programming language you want to code with. Heres a way I would start making a new interpreter. 1. Lexing. Turns you new language into a list of tokens. 2. Parsing. Adds a bit logic to it. For example the order of operations. Parser turns the list of tokens into a abstract syntax tree. 3. Running your new language is easy after you have built the AST.
24th Sep 2023, 3:36 PM
Toni Isotalo
Toni Isotalo - avatar
+ 10
Why do you want to create a programming language? There are hundreds of programming languages available. You can choose the language which fits your needs best. And if there is a certain lack what you miss in your desired language, you are free to create own functions. If you created an own language, then you also have to care about data exchange with the rest of the world. There are zillions of file formats which are often highly sophisticated when I think about png, jpg, mp3, mpeg. Did you think about quality assurance in order to prevent the user from data loss. Why does one want to invent the wheel a second time apart from academic reasons? In my eyes it is like selling sand to a desert dweller.
23rd Sep 2023, 5:04 PM
Jan Markus
+ 10
Hi, ❣️TaNiSha❣️ ! You just design a syntax (how commands are written) and semantics (what they mean). Then implement a interpreter or a compiler. After that you can execute the code written in your new language.
23rd Sep 2023, 7:15 PM
Per Bratthammar
Per Bratthammar - avatar
+ 6
See the book, "Principles of Compiler Design" by Aho and Ullman (popularly known as "The Dragon Book" because of the front cover illustration). It's the best coverage of the topic.
23rd Sep 2023, 6:16 PM
Brian
Brian - avatar
0
Which language is best for programming
25th Sep 2023, 1:41 AM
Akash Kushwaha
Akash Kushwaha - avatar
0
hello guys
25th Sep 2023, 3:47 AM
future Attorney
future Attorney - avatar
0
Java is best programming language
25th Sep 2023, 12:22 PM
Monday Kwada
Monday Kwada - avatar
0
Hi
25th Sep 2023, 1:55 PM
Imran Ansari
Imran Ansari - avatar
0
I want implementation of arrays in data structures
25th Sep 2023, 2:27 PM
Santhosh Santhu
Santhosh Santhu - avatar