Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Compilers: Principles, Techniques, and Tools

Rate this book
This introduction to compilers is the direct descendant of the well-known book by Aho and Ullman, Principles of Compiler Design. The authors present updated coverage of compilers based on research and techniques that have been developed in the field over the past few years. The book provides a thorough introduction to compiler design and covers topics such as context-free grammars, fine state machines, and syntax-directed translation.

796 pages, Hardcover

First published January 1, 1986

285 people are currently reading
6,980 people want to read

About the author

Alfred V. Aho

41Ìýbooks37Ìýfollowers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
1,252 (41%)
4 stars
1,030 (34%)
3 stars
532 (17%)
2 stars
134 (4%)
1 star
51 (1%)
Displaying 1 - 30 of 65 reviews
Profile Image for Ben Haley.
58 reviews16 followers
September 8, 2009
The notorious dragon book shows us the manifold concerns surrounding the translation of high-level programming languages down to the binary codes palatable by machine hardware. Where computer organization and design showed the rock bottom of computing, Aho has built a submarine necessary to descending to those depths. This allegorical submarine is old and sometimes creaky, but its iron hull shows no sign of breaking up despite the rapid changes happening on the surface.
Profile Image for David.
259 reviews29 followers
April 3, 2008
There are certain books that everyone (in a relevant technical field) knows. Baby Rudin, CLR, Patterson-Hennessy, Golub and Van Loan, and Kernighan and Ritchie are all fine examples. The Dragon Book is another fine example, despite this odd reputation it has for being too dryly theoretical. We used it when I took compilers, and I've used it as a reference for myself when working on or teaching about compilers and interpreters. When I taught compilers, we used Appel's Modern Compiler Implementation in Java, which I didn't like nearly as well.
Profile Image for Koen Crolla.
799 reviews224 followers
November 21, 2015
Damned boring. The Dragon Book is one of those ones that shows up on everyone's Top \d+ CS/Dev Books list, but it's one of the ones that are there because you're supposed to be impressed with the implication that the list-maker got all the way through it, not because it's genuinely great.
It has all the information you need to write a functioning compiler for almost any kind of language you'd want to write a compiler for,� it just lays that information out in the dullest, most laborious way possible. The fact that this edition uses Java for much of its code doesn't help, but it actually doesn't hurt nearly as much as you might expect; too bad that's only because it's very light on working code samples.

If you somehow make it through the first eight chapters, the last four are more interesting (if more uneven), but not sufficiently so to salvage the whole book.

--------

� Often missing, however, is a defence of non-obvious design decisions as being genuinely good ideas rather than just accidents of history.
14 reviews1 follower
December 14, 2012
I took "Compilers", otherwise known as CS444, at the University of Waterloo over 20 years ago. What a fantastic course and a fantastic book! We worked in teams of 3 or 4 and developed a full-fledged compiler in one frantic term. I remember the sleepless nights (literally) leading up to the deadline, staying up probably 72 hours straight to get the last few bugs out. But it worked! The book was excellent and helped us all figure out what to do.
9 reviews
March 5, 2011
Meat and potatoes for any aspiring software engineer.

Despite its age, this book still gives a fairly solid understanding of parser, compiler and optimisation techniques.
Its pretty dry, and heavy reading, but it shows you techniques you'll still be referring back to years later
31 reviews2 followers
January 1, 2021
Good content, horrendous writing.

The good thing about this book is it is comprehensive and covers a lot of ground from different vantage points. For example, the parsing chapters also cover the design of lex and yacc apart from basic topics. The type checking and runtime environment chapters had examples from C and ML to cover different scenarios.

Now the bad parts. The book is awfully written and I cannot understand how can a book in its 2nd (or 3rd?) edition continue to be so bad. It was shoddy writing throughout but the prize for the worst writing are these topics:
1. Discussion of bottom up parsing where they directly jump to deterministic graph without discussing the non deterministic version.
2. Implementation of L-attributed SDTs with an obtuse of parser stack.
3. Implementation of type unification with their shoddy graph data structure.
4. Implementation of run time system for ML using "display" which is incomprehensible.

Another consistent problem is their horrible use of passive voice. This interacts really badly with their discussion of mathematical aspects. While the use of passive voice might be excusable, its shoddy use is not.

Reading this book often felt like deciphering some ancient text. I needed to translate a lot of obtuse writing into something that can be understood in my head. This translation happens for all readings involuntarily but it was alarming I had to consciously do it for this book.

I am not sure why is this book called a "classic" computer science book. It is more like a kind of book that students are forced to study by their professors. This book is impossible to read unless you are following some other source. I followed Prof. Alex Aiken's lectures

This book might be responsible for the unpopularity of the study and research in programming languages. I agree compilers are not easy but this book has taken a difficult topic and made it incomprehensible thereby doing a disservice to this whole field of study.
Profile Image for Pierre Jacomet.
81 reviews1 follower
August 19, 2022
I read both version 1 and version 2 of this book. version 1 uses C language for the examples wheres version 2 uses Java. In some parts I prefer version 1 and in other parts I prefer version 2. Both versions are still mostly the same core concepts.

For both cases the important chapters for today's (2022) state of compiler technology would be 1 through 4. Chapters 1 and 2 are the introduction to compiler technology, chapter 3 lexical analysis and 4 parsing. These amount to how 95% of folks would go about building a front end for a compiler today.

Chapter 5 syntax directed translation and 6 intermediate code generation are interesting and more for specific cases.

The remainder of the chapters which are related mostly to backend optimization or runtime environment. Definitely interesting, but because (1) As of today technology on the back end has progressed a lot and (2) Backend is notoriously more difficult as it is much more tightly bound to the CPU architecture, so no real benefit for folks that want to build something cross-platform.

IMO most of nowadays compiler writers in general use an intermediate representation language such as the JVM IR or net IR or LLVM IR which is what their front end writes to, using the APIs that either LLVM or .NET provide. The back end then takes care of translating the IR into actual machine instructions which is the more difficult and more uninteresting part of language writing.
Profile Image for Vladimir Kameñar.
AuthorÌý4 books6 followers
October 8, 2021
This book teaches an abstract way of thinking. In theory anyone can write a compiler without reading this book. I suppose that most people who read this book don't write any compilers. However, this book did change my programming mentality. It's one of the very few books I do recommend.
Profile Image for Richard Callaby.
AuthorÌý3 books
September 2, 2017
This book can be a bit esoteric and hard to understand. There are several other books that go into greater detail that can help fill in the gaps that are left out of this book. I wouldn't read this book by itself to gain enough knowledge to really grasp the subject. As well, there are many good open source compilers I would recommend anyone download and examine to understand how a compiler works in this modern age.

This is a book you keep on your shelf to impress other geeks who may pass by. With that being said I would recommend everyone who is serious about the subject get it as it is pretty good despite what I said above.
Profile Image for amr.
2 reviews1 follower
June 18, 2023
I don't write about cs books that I had to read in university, but this one is exception. I used to hate compilers and automata theory at around spring of 2021. Then because I failed the class, I found this book do some exercise problems. I ended up reading the first five chapters (back-end of compiler) and creating my own compiler and programming language with lex and yacc, I realized how much a good textbook makes a difference.
Profile Image for Alex.
577 reviews43 followers
May 24, 2022
Excellent reference with thorough coverage of core concepts. Not particularly approachable as a first text on the subject without some external guidance, but covers many useful techniques with utility beyond just compiler construction. I suspect I am more likely to return to this one for reference than many other course-assigned texts in the future.
Profile Image for Frederic Desgreniers .
4 reviews
July 9, 2018
Really good book that helps understand how compilers work. However, it's very heavy reading and somewhat outdated compared to alternatives. Would still recommend for anyone that wants to get into compilers.
2 reviews
May 4, 2019
Currently reading, but overall this book is very digestible for me. I haven't found myself easily lost. The language used is clear and comprehensive. Maybe a little dry at times, though the content is quite academic in nature, so that is to be expected.
Profile Image for James Dixson.
16 reviews
February 25, 2011
I have in fact read this book cover to cover. The modeling of Regex parsing in terms of language is among the most fundamental insights and transformative in my understanding of computer systems.
Profile Image for Gandhi Flores.
1 review
Read
April 3, 2013
exelente libro
This entire review has been hidden because of spoilers.
Profile Image for Jie Fu.
1 review3 followers
September 1, 2016
I read this classic book years ago for preparing for GRE Subtest
Profile Image for Carter.
597 reviews
February 7, 2019
A classic but now bit dated but the basics in this field haven't changed much. I would speculate not knowing too much yet about certain aspects of modern compiler design research yet that one would have to in order to get a full picture look at recent PLDI and POPL proceedings. I find the text compared to say Sipser for example lacking in clarity in terms of presentation which is why I took off a star. It's a bit too note like and driven by examples as opposed to consisting of well structured expository writing in some places. Overall the best there is though at present.
Profile Image for Alfredo Amatriain.
79 reviews1 follower
January 21, 2018
I've read few technical books that make such a bad attempt at being instructive. What should be an interesting subject matter is weighted by the most convoluted and hard to follow explanations imaginable. This book proves that it's not enough to be knowledgeable about a subject to write about it: you have to be able to lay out your ideas so they are no harder to grasp than necessary. That's where this book utterly fails.
406 reviews4 followers
April 23, 2020
Rather theoretical take on the subject, I clearly got better understanding what compilers (parsers, lexers, optimisers etc) do, but I doubt I'd get far with just that knowledge. Especially in the world of LLVM or Roslyn. So have a scan if you must, but looks elsewhere for practical details (TODO: update the review with link to blog entry once I know where to look ;-)
2 reviews
October 20, 2018
Excelente livro.

Excelente livro. Muito melhor que as versões anteriores. Apresenta um exemplo prático, construindo um compilador e apresenta exercícios de aprendizagem. Recomendo.
2 reviews
August 12, 2021
THE standard compiler textbook, but so badly written with no regard for didactics. Avoid this one and go for a better alternative, such as "Engineering a Compiler" by Keith D. Cooper.
Profile Image for xvvifzmrr-.
4 reviews
March 30, 2022
I won't recommend the book for newbie.
The learning curve is too cliffy.
Profile Image for Juan Garcia Acosta.
26 reviews
September 11, 2024
Muy didáctico y completo aunque en ocasiones es algo complicado entender los códigos supongo que es por su implementación en lenguajes más antiguos pero en general un excelente libro
Profile Image for Didier "Dirac Ghost" Gaulin.
102 reviews21 followers
October 6, 2023
My personal favorite introduction to compilers. Well structured, detailed, contains many exercises, very clear and has a great mix of formality and intuition.
1 review
Read
November 12, 2011
computer scince
This entire review has been hidden because of spoilers.
Profile Image for Matt.
752 reviews598 followers
December 21, 2014
The renowned Dragon-Book. I'm happy to own the original 1986 edition with the red dragon and the knight on its cover. The cover of the newer edition (2006) is pretty dull.

I read this as part of my studies in computer-science way back when. Some people might tell you it's rather theoretical, but I don't think so. It has sparked my interest in compiler construction, formal languages and more. This interest never left me, so you can say this book was kind of a life changing read.

Update Dec.21 2014
The Å·±¦ÓéÀÖ algorithm made a recommendation to me because I read Compilers:

I am not entirely sure what triggered this decision. Maybe it's the words techniques and tools in the subtitle of this book?


This work is licensed under a .
Displaying 1 - 30 of 65 reviews

Can't find what you're looking for?

Get help and learn more about the design.