4 ms·
I’m on mobile, but three recommendations for books/resources are: 1. Crafting interpreters. There’s plenty of hn discussion on it and it was recently completed
by nijaru 6y ago
I’m on mobile, but three recommendations for books/resources are:
1. Crafting interpreters. There’s plenty of hn discussion on it and it was recently completed.
2. Writing a compiler in go. There’s also a book on interpreters that goes along handily with it from Thorsten ball as well.
3. Build your own lisp
There’s also plenty of traditional textbooks such as the dragon book. I don’t have any lectures or videos on hand, but I’m sure teach yourself CS has a recommended course on it.
- _bxg1 6y agoI 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.