3 ms·
I saw Crafting Interpreters but I wasn't sure if it really covered compilers or focused mainly on interpretation (I know there's a lot of overlap, but still).
by _bxg1 6y ago
I saw Crafting Interpreters but I wasn't sure if it really covered compilers or focused mainly on interpretation (I know there's a lot of overlap, but still).
I have done basic Lisp interpreters before in JS/Python and even did a bit of compilation from Lisp to JS, but those feel like they're only scratching the surface because a) Lisp is so easy to parse it almost feels like cheating, and b) using a dynamic language as a target means you can lean on several of its built-in features instead of implementing them from scratch
So for example, I'd really especially like to learn more about representing ASTs and parsing an arbitrary context-free grammar, and maybe even some basic type-system stuff if that isn't too far out of scope
Edit: Turns out what I'd seen before was "Essentials of Interpretation", a Udemy course. I will say I tend to prefer the course format over a book.
- signaru 6y agoI just recently finished Crafting Interpreters. The third part of the book covers a bytecode virtual machine and overlaps with compiler concepts. Perhaps Bob didn't put "compiler" in the title since the bytecode VM still requires the source code to be present during runtime. Even if it doesn't teach how to produce a "compiled file" in some form, it is still valuable as an approachable transition from simpler tree walk interpreters.