Verdict: Not rated
I find reviewing this book very difficult. First off, despite the dragon on the cover it is very definitely NOT an updated replacement for the Dragon Book (Compilers: Principles, Techniques and Tools by Aho, Lam, Sethi & Ullman) 2nd edition published in 2007. Its declared target readership is ‘programmers who are curious about how compilers work’. In other words, it is not a book for aspiring compiler writers.
It is a veritable doorstop of a book with over 750 pages and much of it is pseudo code. The author seems to think that the reader needs either an Apple Mac or a Linux system (and if you are using a Windows system you will to install and use ‘Windows Subsystem for Linux). I am unconvinced that this is necessarily true unless you want to use the author’s test suite. You will, according to the author, need Python 3.8 or later. You will also need a C compiler driver and the author recommends using GCC if you are using Linux or under MacOS using Xcode’s Clang (aliased as gcc.)
The overhead for working through this book (full disclosure, I haven’t though I have browsed most of it) seems very high. Worse, from my perspective, the author does not even recommend which high level language to implement their pseudo code in. The book leans heavily on an intermediate representation (most compilers use some intermediate form as a bridge between language code and assembler) which the author has named TACKY which is a three-address code language (well the author calls it a representation, but I would prefer to view it as what it is, an intermediate language).
Let me go along with the author’s assumption that the reader is an experienced programmer who merely curious about how compilers work and does not intend writing compilers for a living. There is a problem with that assumption in that programmers with the skills to convert the author’s pseudo-code to a high-level language of their choice is not likely to have that much spare time to dedicate to pursuing a mere interest.
I think I have a fair grasp of how compilers work having written a compiler and runtime for a small language used for teaching. I think that experience taught me a great deal but I was motivated by wanting the end result for use in my classroom. Having done that from scratch, I found it relatively easy to learn about parsers, lexers, ASTs etc. because I could relate those terms to the things I had had to do to achieve my objective.
At this point, I decided that it was time to see what readers had to say about the book on Amazon reviews. They seem to break into two camps. The first are wildly enthusiastic readers who find the freedom to choose which language to use a positive asset and seem to have a great deal of time on their hands (nothing wrong with that if programming is a substantial part of your interests). The other group consists of readers who were disappointed and found their expectations not met. Here is a typical review from the latter group:
I purchased this book expecting to have a fun fall project. I really wanted to love this book. It covers the topic very thoroughly and must have been a gargantuan writing project. This book tells you the whats and whys of designing and building a compiler in great detail. What it does not have is concrete examples of how to do these things. There is absolutely no hand-holding when it comes to actual coding. It also recommends and assumes knowledge of more modern languages like Rust or OCaml. I was hoping to code the compiler directly in C.
This book is not for novices full stop. I have been coding both professionally and as a hobby for a little over 35 years and am currently finishing my BS in CS. I started getting lost on page 10. My expectations for this book were sadly not met as I was looking for it to have more ‘this is how to write x’ with example source code. What it does do is tell you what to make, and then you have to go figure it out for yourself with a test suite that lets you know if you made it correctly. This approach may work for some, but unfortunately, I am not one of those people.
I think that short review sums up the problems I have with this book. If you are an experienced (and competent) programmer in at least one mainstream procedural language or come from academia and have learnt OCaml and want to learn about what a compiler does and how it could do it this book may well be for you. However, I think that is a pretty small readership and I fear that many who buy this book might lack the time to do it justice.
To sum up, this is not the book that is even close to what I would have written for programmers curious about what a compiler does. It also is a long way from what modern compilation systems do. I am much in favour of learning by doing but that kind of learning is time consuming and frustrating if you do not have a mentor or teacher.
I would give it a restricted and guarded recommendation for those who are happy at a yearlong homework challenge where your work is regularly tested and validated by the author’s software and if it fails you are going to have to puzzle out what went wrong for yourself.
Website: https://nostarch.com/writing-c-compiler
Code site: https://norasandler.com/book/