3 ms·
I had a lot of fun with this book, after belatedly buying it. I've read a couple of similar online-books in the past, but this was the first one I worked my w
by stevekemp 7y ago
I had a lot of fun with this book, after belatedly buying it. I've read a couple of similar online-books in the past, but this was the first one I worked my way through completely.
As a result I later had a lot of fun writing a simple compiler for a reverse-polish calculator, to generate AMD64 assembly language https://github.com/skx/math-compiler/ https://github.com/skx/math-compiler/ , wrote a simple BASIC intepreter https://github.com/skx/gobasic https://github.com/skx/gobasic , and put together a couple of DSL-projects which followed a similar approach.
All in all I'd recommend reading it, and definitely working through the code. Once you're done you can continue to experiment - adding support for regular expressions, a standard-library, etc, etc.
My version of the language is here and contains a fair number of improvements/additions. After covering the core in such detail it wasn't hard to extend further, even if that was primarily for fun, rather than for a real purpose:
https://github.com/skx/monkey/ https://github.com/skx/monkey/