upvote
I'm a fan of the structure used in Essentials of Compilation [1][2] and Writing a C Compiler [3]. If you want to start with interpreters, I like Essentials of Programming Languages [4]. I have to admit, as popular as Crafting Interpreters is on this site and others, I'm not a fan. Others seem to love it so it's worth a shot, and freely available.

EOC and EOPL are a bit on the academic side, but, I think, they're highly approachable aside from the issues some people have with Scheme and Racket (the Python version of EOC would address that issue). Afterwards, I think the other, deeper and more academic texts on compilers become more approachable.

[1] https://mitpress.mit.edu/9780262047760/essentials-of-compila... - Racket version, has an open access version

[2] https://mitpress.mit.edu/9780262048248/essentials-of-compila... - Python version, has an open access version

[3] https://nostarch.com/writing-c-compiler - Your choice of implementation language

[4] https://mitpress.mit.edu/9780262062794/essentials-of-program... - Scheme, but works in Racket

reply
Haven't tried it myself, but there is "the-super-tiny-compiler": https://github.com/jamiebuilds/the-super-tiny-compiler
reply
I'd say check out Crafting Interpreters [1]. It has 2 parts, the first in Java for doing a treewalk Interpreter in Java before going farther with a version written in C.

1. https://craftinginterpreters.com/

reply
Not GP, but after doing Crafting Interpreters I was kinda left with a gap in my knowledge regarding the conversion of an AST into native code. Also kinda missing was optimization passes over an AST. I somewhat understand the idea, but it would definitely be nice to have a more guided book/article for this.

Crafting Interpreters is definitely a recommended read, but it stops at Interpreters (fair enough, the book is thick enough). Crafting Compilers would need at least 4-5 extra chapters IMO.

reply
Hmm I would have hoped for something more formal and that's focused on compiled runtimes, instead of dynamic runtimes

Still, I appreciate you replying, I'm sure you meant to be helpful!

reply