If you're just getting comfortable with it (as I am) then something a little lighter weight than a course seems like a reasonable approach. Also, for me at least, at this point the distinction between interpreter and compiler isn't as important, and there are some very high quality interpreter resources out there. [0], [1], [2] are easy to get started with and great to work through. At the very least it seems like these should be good preparation for something more rigorous.
As for compiler resources, I've put a respectable dent in [3] and so far I've found it to be pretty accessible.
"The compiler we construct accepts a large subset of the Scheme programming language and produces assembly code for the Intel x86 architecture, the dominant architecture of personal computing. The development of the compiler is broken into many small incremental steps. Every step yields a fully working compiler for a progressively expanding subset of Scheme. Every compiler step produces real assembly code that can be assembled then executed directly by the hardware."
"We do not assume that the reader knows anything about assembly language beyond the knowledge of the computer organization, memory, and data structures. The reader is assumed to have very limited or no experience in writing compilers."
> Does anyone have recommendations for good resources on writing your first compiler?
Have a look at the books and compilers at http://t3x.org.
For a first glance, I would recommend https://t3x.org/t3x/book.html. If you are only interested in the source code, it is in the public domain and can be downloaded on that page.
Also curious, what is the modern equivalent of the "Dragon Book"? A lot has changed since the old times, e.g. JIT compilers, and garbage collected VMs and such. Also CPUs have changed a lot, e.g. speculative execution, deep pipelining, large memory cache hierarchies, GPUs, etc. Is there a compiler book that addresses it all?
Eh. Dragon still has good material on pipelining and local dataflow analysis frameworks. The version two stuff on bdds is the most poorly aged part, IMO.
You can't take seriously a book which spends half of its pages talking about lexing and parsing.
It's the book from the times when single-pass compilers were a thing, and that's what it's about, a primitive single pass compiler. The field has advanced too much since then.
Things you wont find in dragon book: type inference and modern type systems, modern GC implementations, exceptions and error handling, modern register allocations and optimizations, modules and parametric modules. Seriously, a book spends 300 pages on parsers and 4 pages on type inference and unification.
Wirth's book on Compiler Construction, in my opinion, is still a paradigm of lucid and concise writing, presenting a whole compiler in 130 pages. First edition was published in Pascal in 1977, the third edition (in Oberon) is available free online:
As for compiler resources, I've put a respectable dent in [3] and so far I've found it to be pretty accessible.
[0] https://craftinginterpreters.com [1] https://interpreterbook.com [2] http://www.buildyourownlisp.com [3] https://holub.com/compiler/