What's the best coding language to make a coding language? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

What's the best coding language to make a coding language?

I want to make a coding language that is so easy for beginners. I am thinking of either using C or Python.

4th Jul 2018, 2:52 PM
mahir
mahir - avatar
4 Respuestas
+ 5
Hello, mahir ! The compiler can be written in any language. The code will consist of several modules. 1. Lexer - converts the source text into a sequence of tokens. a = b + 1; will turn into something like {variable ("a"), assign, variable ("b"), add, number ("1")} 2. The parser is built on the basis of grammar. Converts a sequence of tokens into a tree. assign / \ var ('a') add / \ var ('b') number(1) 3. Further bypassing the resulting tree, we generate the code Different methods are painted in dragonbook
4th Jul 2018, 3:04 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 2
you can make it c-based using flex and bison (a lexer and a parser), although i would recommend learning ASM and creating it from scratch.
4th Jul 2018, 3:02 PM
hinanawi
hinanawi - avatar
+ 2
i love python and c therefore tweaking their syntax a little bit and adding a few ideas is okay
4th Jul 2018, 4:43 PM
Michael saviour
Michael saviour - avatar
+ 1
making a program is much easier said then done...good luck though!
4th Jul 2018, 11:31 PM
James Pinder