Hello,<p>I have seen a lot of people on the internet say that the dragon book is horrible book to learn compilers from.<p>well, I have read some of the second edition of the dragon book and I think it is a great book. The main criticism is that its too focused on parsing. Thats just like 5 chapters. I skipped these and went straight into the intermediate language, code generation, and optimizing chapters.<p>These chapters give a detailed account of things such as register allocation, instruction selection, and instruction scheduling. The optimizing chapters are also good.<p>im not claiming im an expert compiler person. I am not but compilers is something i want to learn and so i gave the dragon book a try and i really liked it.<p>more importantly the dragon book made me realize that compilers are mathematical systems in a way. the ast is tree and trees have mathematical properties but graphs are needed for register allocation, dataflow analysis for optimization. optimization is math problem.<p>So i think this book gave me a better understanding of the field and it made appreciate compilers.<p>i'd say if youre interested in compilers you can start with "essence of compilation" by dr. siek and get some experience writing compilers and then read the dragon book.<p>i just wanted to share my experience. i think the dragon book is a great book.
Besides devoting too many pages to parsing, I think compiler practitioners have low opinion of the book because it isn't useful for them. For example, the second edition claims to be updated to modern optimization techniques, and in a sense that's true, but it is useless because the book isn't using SSA. For practitioners, SSA is not optional these days, and everything about optimization in the book needs to be updated to SSA to be useful.<p>But you are probably not a compiler practitioner. Then I agree it is a good book to learn about compilers.
From the parsers I see in the wild (not strictly speaking about compilers here), I think most programmers should definitely spend some time studying the basics of them. It’s incredible to me how people mess up parsing even the simplest of file formats or make it super complicated.
For those that find it a bit light, I enjoyed Advanced Compiler Design and Implementation by Steven S. Muchnick. Which covers topics that I found much trickier.
I remember picking this book up at the university library in my second year because I had seen it in the movie “Hackers” and the cover looked really cool. I distinctly remember the parsing chapters especially recursive descent parsing. It was one of those light bulb “oh, this is how you do it” moments. Well worth spending a few weekends playing with that book, even if it’s somewhat dated, its like SICP in a sense more of a “mind expansion” device than anything else.
Amen. This is will have a permanent place in my bookshelf. I actually found that implementing some of the papers was very valuable (and joyful). Not only that this stuff points you to a lot more research generated after the book. Even better is that each paper you implement imo was very self contained on its own so you can build and use as you go.
What is a good book just for recursive descend parsing? I dabbed into some compiler books but found BNF difficult.<p>Just some clarification, it is not difficult to understand but difficult to build from scratch. I'm thinking maybe a book that asks me to build up BNF expressions for a series of grammars of gradually increasing complexity would be nice.
seconded.<p>so a lot of people say a lot of things.
i like chapters 1-5 just as much as the rest, btw.
it's objectively a great book, written by objectively great developers <i>and</i> computer scientists.<p>is it the best to learn from today? who can say.<p>you might also say we should not start the education for structural engineering by studying the Brooklyn bridge either.<p>but, so here we are.
Reminds me of this thread :)
<a href="https://news.ycombinator.com/item?id=3754545" rel="nofollow">https://news.ycombinator.com/item?id=3754545</a><p>Since it's so old that blog post is dead now, here is an archive copy:
<a href="https://web.archive.org/web/20180929002914/http://www.billthelizard.com/2008/12/books-programmers-dont-really-read.html" rel="nofollow">https://web.archive.org/web/20180929002914/http://www.billth...</a>
I make a living as a high-performance JIT compiler writer, and the dragon book is a waste of time in my opinion. There are much better books out there. If you are a beginner, start by learning Recursive Descend parsing. And then learn LLVM.
I have the first edition but do not have an intention to create compilers yet, and the book is the hardest book I have for recreational reading. I can not just open it in the middle and find anything understandable.
"<i>green book</i> International Unix Environments. <i>orange book</i> Computer security criteria, DOD standards. <i>book with man wearing pink shirt</i> The Pink Shirt Book, Guide to IBM PCs. So called due to the nasty pink shirt the guy wears on the cover <i>another book</i> Devil book. The Unix Bible. <i>another book</i> Dragon book. Compiler design. <i>large red book</i> The Red Book. NSA Trusted Networks. Otherwise known as the Ugly Red Book that won't fit on a shelf."<p>Sorry, title took me down a nostalgic trip.