Found in 4 comments on Hacker News
pjmlp · 2021-06-04 · Original thread
Unless you are talking about something like "A Retargetable C Compiler: Design and Implementation", it is definitly not easy.

https://www.amazon.com/Retargetable-Compiler-Design-Implemen...

During the early 80's, the best home computers could get was Small-C.

https://en.wikipedia.org/wiki/Small-C

plinkplonk · 2020-01-08 · Original thread
This might be relevant

A Retargetable C Compiler: Design and Implementation by David Hanson and Chritopher Fraser

https://www.amazon.com/Retargetable-Compiler-Design-Implemen...

Written in a literate programming style.

plinkplonk · 2017-02-16 · Original thread
A Retargetable C Compiler: Design and Implementation

https://www.amazon.com/Retargetable-Compiler-Design-Implemen...

A most excellent grimoire.

troydj · 2015-12-14 · Original thread
I wouldn't go so far to say that the Dragon Book is outdated and irrelevant. (I'm assuming you're referring to the 2nd edition from 2006.) Unless you're focusing on back-end optimization and code generation techniques (something a new compiler writer typically does NOT do), the bulk of the theory and material you'd cover in a first semester compiler course is fairly static.

But if a person is merely looking to bang out a compiler without getting overwhelmed with how to convert NFAs to DFAs for lexing, etc., some good alternative books are:

A Retargetable C Compiler: Design and Implementation, by Hanson and Fraser (http://www.amazon.com/Retargetable-Compiler-Design-Implement...). This book constructs and documents the explains the code for a full C compiler with a recursive descent approach (no flex/lex or bison/yacc). I have some experience augmenting this compiler, so I can vouch for the book's ability to clearly convey their design.

Compiler Design in C, by Allen Holub (http://www.holub.com/software/compiler.design.in.c.html). Downloadable PDF at that link as well. A book from 1990 in which Holub constructs his own version of lex and yacc, and then builds a subset-C compiler which generates intermediate code.

Practical Compiler Construction, by Nils Holm (http://www.lulu.com/shop/nils-m-holm/practical-compiler-cons...). A recent book which documents the construction of a SubC (subset of C) compiler and generates x86 code on the back end.

Fresh book recommendations delivered straight to your inbox every Thursday.