Here’s a fun exercise:
This made me realize why DSLs are much easier to do in a Lisp than in any other programming language.
It has to do with the underlying structure of the programming language. I believe that in a Lisp we have complete control over the abstract syntax tree and it is much easier to tokenize/parse/evaluate. We just
read a string and then have a function that recursively evaluates the AST produced.
Feel free to compare the code and browse around, and let me know your thoughts in the comments section.