Other recent books I've found really helpful include:
Crafting Interpreters by Bob Nystrom (@munificent on HN)
https://www.craftinginterpreters.com
Language Implementation Patterns by Terence Parr (creator of ANTLR)
https://pragprog.com/book/tpdsl/language-implementation-patt...
The list is huge, so I recommend you start with the Compilers course by Stanford and go through one of the two following books as a parallel reading: 1. Engineering a Compiler, K. Cooper, L. Torczon. 2. Modern Compiler Implementation in ML, by A. Appel.
If you want a smaller book, the I recommend the Basics of Compiler Design by T. Mogensen, it is a nice and short one.
All of these resources are linked to in the list.
Happy tinkering!
For anyone interested in other books on compiler construction, I would recommend these:
- "The Basics of Compiler Design" by Torben Mogensen
- "Modern Compiler Implementation in C" by Andrew Appel (ML and Java versions available too)
- "Modern Compiler Design" by Grune, Bal et al.
The Dragon Book is obviously infamous for this topic, but I would recommend covering at least two slightly more basic texts before taking it on.
It's good for exactly what the title says: Basics of Compiler Design. It won't make you a compiler guru, but it will give you a good grasp of the fundamentals.
If anyone is interested, I could share the weekly assignments and the exam project from the course.
The advanced compiler course at DIKU uses Modern Compiler Implementation in ML: http://www.cs.princeton.edu/~appel/modern/ml/.
I think they've gone out of fashion now, but when I learned about compilers we were introduced to T-diagrams, sometimes called tombstone or bratman diagrams and shown how to bootstrap a compiler for a high level language from scratch [1].
Torben Mogensen's Basics of Compiler Design [2] - Chapter 13 is devoted to bootstrapping a compiler, which introduces them.
[1] scratch meaning a computer (with relevant hardware) with a CPU with it's machine code instructions and some way to make files containing those instructions. You can do this even without assembler, that's the first step. Of course no-one would do this now, but it's a necessary step developing the first high level languages and compilers.