4 ms·
I recommend the interpreter book [https://interpreterbook.com/ https://interpreterbook.com/], which isn't entirely free of charge however. On the other hand, i
by zaarn 9y ago
I recommend the interpreter book [https://interpreterbook.com/ https://interpreterbook.com/], which isn't entirely free of charge however.
On the other hand, it was enough to get me off the ground for my lexer and write a parser that wasn't entirely dumb.
- misternugget 9y agoAs the author of the mentioned book I just want to add that I specifically wrote it because I'm also a huge fan of the technical writings the author is looking for: from the ground up, all code shown, no toys and shortcuts, capturing the essence in a few thousand lines. And just FYI, the interpreter we build in the book ends up with ~3900 lines, including the full test suite.
- n_t 9y agoGreat stuff! Thanks for it.
- zaarn 9y agoI think I'm atm at around 2500 lines, of which the parser and lexer is probably about 1200 lines. I mostly ~~stole~~ used the lexer from the book as inspiration for my own and then rolled a LISP-like language from there (which is rather easy given that a LISP AST is simple in nature)