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.

During the early 80's, the best home computers could get was 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

Written in a literate programming style.

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

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 ( 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 ( 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 ( 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.