Here’s a fun exercise:
1. Write a Lisp interpreter in PHP (done a few years ago here)
2. Write a Lisp interpreter in Lisp (done here)
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.