3 ms·
This is why the Lisp syntax is a great candidate for an exercise in making your own language. For example, Make a Lisp. https://github.com/kanaka/mal https://gi
by lioeters 2y ago
This is why the Lisp syntax is a great candidate for an exercise in making your own language. For example, Make a Lisp. https://github.com/kanaka/mal https://github.com/kanaka/mal
It's simple to lex and parse into an abstract syntax tree, so you can get on with exploring more interesting aspects of programming beyond the mere syntax. (Not to say that there aren't interesting aspects of grammar and innovative syntax, but those can probably be explored later on as macros.)
Last time I created a toy language, I implemented a C-like infix syntax but still used a Lisp evaluator at its core from a previous project.
- JohnMakin 2y ago> It's simple to lex and parse into an abstract syntax tree, There are some "cheats" for this, tools like ANTLR etc. that are good at generating parsers from a particular grammar. But of course, I think a beginner should try to do this on their own to get a feel for it. Personally, for me, I do find writing parsers a little tedious and not the most fun part of making a language.