Team Liquid - Shop now
Buy used:
$68.00
FREE delivery Monday, December 16
Or fastest delivery Thursday, December 12. Order within 2 hrs 23 mins
Condition: Used: Good
Comment: All pages and cover are intact (including the dust cover, if applicable). Spine may show signs of wear. Pages may include limited notes and highlighting. May include "From the library of" labels. Shrink wrap, dust covers, or boxed set case may be missing. Item may be missing bundled media.
Access codes and supplements are not guaranteed with used items.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the authors

Something went wrong. Please try your request again later.

Engineering: A Compiler 2nd Edition

4.6 4.6 out of 5 stars 102 ratings

There is a newer edition of this item:

Engineering a Compiler
$80.91
(22)
Only 15 left in stock - order soon.
All our books are brand new. We ship worldwide

Editorial Reviews

Amazon.com Review

This entirely revised second edition of Engineering a Compiler is full of technical updates and new material covering the latest developments in compiler technology. In this comprehensive text you will learn important techniques for constructing a modern compiler. Leading educators and researchers Keith Cooper and Linda Torczon combine basic principles with pragmatic insights from their experience building state-of-the-art compilers. They will help you fully understand important techniques such as compilation of imperative and object-oriented languages, construction of static single assignment forms, instruction scheduling, and graph-coloring register allocation.

  • In-depth treatment of algorithms and techniques used in the front end of a modern compiler
  • Focus on code optimization and code generation, the primary areas of recent research and development
  • Improvements in presentation including conceptual overviews for each chapter, summaries and review questions for sections, and prominent placement of definitions for new terms
  • Examples drawn from several different programming languages
Changes This Edition

The second edition of Engineering a Compiler presents both perspectives: big-picture views of the problems in compiler construction and detailed discussions of algorithmic alternatives. In preparing the second edition of Engineering a Compiler, we focused on the usability of the book, both as a textbook and as a reference for professionals. Specifically, we:

  • Improved the flow of ideas to help the student who reads the book sequentially. Chapter introductions explain the purpose of the chapter, lay out the major concepts, and provide a high-level overview of the chapter’s subject matter. Examples have been reworked to provide continuity across chapters. In addition, each chapter begins with a summary and a set of keywords to aid the user who treats Engineering a Compiler as a reference book.
  • Added section reviews and review questions at the end of each major section. The review questions provide a quick check as to whether or not the reader has understood the major points of the section.
  • Moved definitions of key terms into the margin adjacent to the paragraph where they are first defined and discussed.
  • Revised the material on optimization extensively so that it provides broader coverage of the possibilities for an optimizing compiler.

Compiler development today focuses on optimization and on code generation. A newly hired compiler writer is far more likely to port a code generator to a new processor or modify an optimization pass than to write a scanner or parser. The successful compiler writer must be familiar with current best-practice techniques in optimization, such as the construction of static single-assignment form, and in code generation, such as software pipelining. They must also have the background and insight to understand new techniques as they appear during the coming years.

Finally, they must understand the techniques of scanning, parsing, and semantic elaboration well enough to build or modify a front end. Our goal for the second edition of Engineering a Compiler has been to create a text and a course that exposes students to the critical issues in modern compilers and provides them with the background to tackle those problems. We have retained, from the first edition, the basic balance of material. Front ends are commodity components; they can be purchased from a reliable vendor or adapted from one of the many open-source systems. At the same time, optimizers and code generators are custom-crafted for particular processors and, sometimes, for individual models, because performance relies so heavily on specific low-level details of the generated code. These facts affect the way that we build compilers today; they should also affect the way that we teach compiler construction.

Read a Sample Chapter from Engineering a Compiler on "Practical Issues"

Even with automatic parser generators, the compiler writer must manage several issues to produce a robust, efficient parser for a real programming language. This chapter addresses several issues that arise in practice.

Review

"Keith Cooper and Linda Torczon are leading compilers researchers who have also built several state-of-the-art compilers. This book adeptly spans both worlds, by explaining both time-tested techniques and new algorithms, and by providing practical advice on engineering and constructing a compiler. Engineering a Compiler is a rich survey and exposition of the important techniques necessary to build a modern compiler."--Jim Larus, Microsoft Research

"The book is well written, and well supported with diagrams, tables, and illustrative examples. It is a suitable textbook for use in a compilers course at the undergraduate or graduate level, where the primary focus of the course is code optimization."--ACM’s Computing Reviews.com

"This book is a wealth of useful information, prepared didactically, with many helpful hints, historical indications, and suggestions for further reading. It is a helpful working book for undergraduate and intermediate-level students, written by authors with an excellent professional and teaching background. An engineer will use the book as a general reference. For special topics, an ambitious reader will consult more recent publications in the subject area."--ACM’s Computing Reviews.com

Product details

  • ASIN ‏ : ‎ 012088478X
  • Publisher ‏ : ‎ Morgan Kaufmann; 2nd edition (February 21, 2011)
  • Language ‏ : ‎ English
  • Hardcover ‏ : ‎ 824 pages
  • ISBN-10 ‏ : ‎ 9780120884780
  • ISBN-13 ‏ : ‎ 978-0120884780
  • Item Weight ‏ : ‎ 3.5 pounds
  • Dimensions ‏ : ‎ 7.5 x 1.5 x 9.25 inches
  • Customer Reviews:
    4.6 4.6 out of 5 stars 102 ratings

About the authors

Follow authors to get new release updates, plus improved recommendations.

Customer reviews

4.6 out of 5 stars
102 global ratings

Customers say

Customers find the presentation well-presented, concise, and implementation-oriented. They say the book includes a lot of concepts and thoroughly discusses their implications, strengths, and weaknesses. Readers also describe it as perfect reading for computer science engineers. They mention the authors are knowledgeable on the subject of compiler design and keep the reader right on track.

AI-generated from the text of customer reviews

Select to learn more
10 customers mention "Presentation"10 positive0 negative

Customers find the presentation well-presented in a theoretical manner. They say it's concise, implementation-oriented, and pragmatic. Readers also mention the book includes a lot of concepts and thoroughly discusses the implications, strengths, and weaknesses of them. They say it would be a great way to consolidate their knowledge and prepare for exams.

"...(nice presentation, not overly terse), but it also covers new and interesting algorithms and data-structures...." Read more

"...It's emphasis is on English text and it reads well. I'd put it on the Hennessy and Patterson shelf." Read more

"...The other part was different because it explained bottom-up parsing well. I never "got it" when reading the Dragon book or others...." Read more

"...This book is structured better than the dragon book. It shouldn't be a surprise that UC Berkeley is using it in their curriculum." Read more

8 customers mention "Readability"8 positive0 negative

Customers find the book perfect for a computer science engineer. They say the authors are very knowledgeable on the subject of compiler design and keep the reader right on track. Readers also mention it's easy to read the general overview and analysis of a technique.

"...The contemporary competition consists of* Aho/Sethi/Ullman/Lam: nice book, great follow-on from the earlier dragon books, but is so thick that..." Read more

"...It's emphasis is on English text and it reads well. I'd put it on the Hennessy and Patterson shelf." Read more

"...It's a good book, but I've taken a star away because I feel it's too theoretical." Read more

"Great book. The authors are very knowledgeable on the subject of compiler design and theory. This book is structured better than the dragon book...." Read more

Top reviews from the United States

Reviewed in the United States on October 16, 2011
As a professor and former compiler writer, I'm a big fan (and owner) of compiler books (including those by Aho, Ullman, Goos, Waite, Wirth, ...). The last years have seen a resurgence of really good books covering modern compiler engineering. This one (first and, gladly, second edition) is by far the best in its class. The contemporary competition consists of
* Aho/Sethi/Ullman/Lam: nice book, great follow-on from the earlier dragon books, but is so thick that it's tough to teach from, and to be honest, it's getting convoluted.
* Allen/Kennedy: another great book, covering some of the best results in optimization (of well behaved languages like Fortran). It is, just like the latest dragon book, heavy slogging and not digestible by many students.
* Muchnick: yet another excellent book, but it hasn't (AFAIK) been updated.

By contrast, this book (Cooper/Torczon) is not only digestible (nice presentation, not overly terse), but it also covers new and interesting algorithms and data-structures. This applies not only to today's hot topics like optimization (and related data-structures like SSA) and code-generation, but also to front-ends. For example, the chapter on lexical analysis covers Brzozowski's minimization algorithm. (As a specialist in such minimization algorithms, it's very encouraging to see compiler writers/text book authors now embracing such an easily taught algorithm.) All in all, a very nice book on modern compiler engineering.
161 people found this helpful
Report
Reviewed in the United States on February 12, 2015
I grew up with the first edition of the Dragon book, a fine book for its time, especially when coupled with YACC and LEX. Lately I've been contributing to LLVM and I needed something a little more up to date as a refresher. To that purpose, Engineering A Compiler, second edition, is an outstanding modern text. It uses a pleasant+simple pseudo code for its examples as opposed to Java or C++. It's emphasis is on English text and it reads well. I'd put it on the Hennessy and Patterson shelf.
18 people found this helpful
Report
Reviewed in the United States on July 30, 2024
textbook came in good condition, appears to be unmarked
Reviewed in the United States on October 4, 2011
This book is pure theory. The title didn't convey this to me.

If you haven't yet created your own compiler, then I would look elsewhere. The best bet would be too get "Brinch Hansen on Pascal Compilers", which contains a small amount of theory but heaps of code (fully commented and understandable) which you can easily digest and then modify for your custom compiler.

The compilers I've written (based largely on Hansen) used the "top down" method, which can easily be coded by hand. Although a great introduction to compilers, there is not much discussion on bottom-up parsing or code optimization.

The first half of the book reviewed here was a good refresher for me about compilation techniques. I could follow it easily, but I knew most of the material beforehand (from Hansen). The other part was different because it explained bottom-up parsing well. I never "got it" when reading the Dragon book or others. So, I was impressed by the first half of the book.

The second half is about optimization. The topics here were either briefly mentioned in Hansen (but no implementation was given), or else were absent. Hansen's approach was to use a stack-based machine, which is simple to do but not good for optimizing code. In this new book, the authors don't use a stack-based approach, but rather a register approach. This allows for lots of types of optimization. It's heavy going. There are some diagrams, but not enough for me. Pseudo code was given to explain each optimization technique, but there were always special cases that threw a spanner in the works. I liked the constant summaries, but when I faced the questions at the end of the chapters, I quickly realized I hadn't digested the material fully! I also realized that I'd never be able to implement the optimizations from the pseudo-code presented.

I learned that there is almost an infinite numbers of combinations of optimization code. This shows that there will always be areas of research in compilers. I got stuck in a lot of places, but still got a good understanding of optimization theory. Many techniques were written in acronyms to save space, but I kept forgetting what the names stood for, and that hindered my learning.

For a single-semester course, Hansen's book is better, as it's practical. This new book would be a great way to consolidate your knowledge and let you prepare you for further study, or research. There are other books on optimization, but this one has enough topics and theory for me!

It's a good book, but I've taken a star away because I feel it's too theoretical.
61 people found this helpful
Report
Reviewed in the United States on June 3, 2017
Great book. The authors are very knowledgeable on the subject of compiler design and theory. This book is structured better than the dragon book. It shouldn't be a surprise that UC Berkeley is using it in their curriculum.
3 people found this helpful
Report
Reviewed in the United States on July 6, 2013
(Haven't finished the book yet) Everything is well presented in a theoretical manner. While the subject matter is abstract, the author keeps the reader right on track.
2 people found this helpful
Report
Reviewed in the United States on April 30, 2015
Great book for a compilers class, especially upper level undergrad/new grad student. I would not have survived building my own compiler for my class had it not been for this book. I also have a copy of the dragon book but I read this first and learned from it therefore I have a bias towards it.
4 people found this helpful
Report
Reviewed in the United States on February 11, 2014
Clear and concise without the impenetrable waffle that seems to infuse the other well known books on the same subject.
3 people found this helpful
Report

Top reviews from other countries

Translate all reviews to English
PJ
1.0 out of 5 stars De print kwaliteit is erg slecht.
Reviewed in the Netherlands on February 23, 2021
Wazige letters op dunne pagina's, waardoor het erg onfijn lezen is.
De inhoud daarentegen is erg goed.
Simon
4.0 out of 5 stars Comprehensive
Reviewed in the United Kingdom on November 22, 2020
Comprehensive but a fair bit of maths. If you want something more hands on then go for the tiger/ML book.
TimkO
5.0 out of 5 stars Very comprehensive book, you ll get enough for money spent
Reviewed in France on October 14, 2019
Very thorough, and consistent introduction into compilers (I think it could be called more than introduction..).
Goes from implementing scanners to optimization, and most efficient data structures. At each point, advantages and disadvantages of some technique X are exposed
I highly recommend
I have not read Dragon Book, so I can't compare.

On a side note, the format is kinda odd (huge pages, but only filled half-width, very wide margins, I suppose that's for reader's notes), book is really heavy, and the "pseudo-assembly" (ILOC) used is annoying
Bücherwurm
4.0 out of 5 stars Guter Überblick
Reviewed in Germany on August 9, 2016
Das Buch bietet einen guten Überblick, ohne jedoch allzu sehr in die Tiefe zu gehen. Beim Parsing hätte mir etwas mehr Praxisbezug gefallen, es werden CFGs und Attributgrammatiken verwendet und die Autoren haben offenbar ein Faible für Parsergeneratoren. In der Praxis werden solche Generatoren aber eher weniger eingesetzt, vor allem keine für Attributgrammatiken, und da wäre mir etwas mehr über Tricks für handgeschriebene Parser mit Lookahead lieber gewesen. Dafür glänzt das Buch an anderen Stellen, IR, Laufzeitstrukturen und Activation Records werden recht ausführlich erklärt, wobei Optimierungen später getrennt behandelt werden. Auf moderne Tools wie LLVM wird praktisch nicht eingegangen, es geht also vor allem um die Grundlagen und weniger den Praxisbezug, denn wer würde heute noch einen Compiler schreiben, ohne LLVM oder ähnliches zu verwenden? Alles in allem ist das Buch eine Einführung in Standardmethoden, und darin ist es gut und leicht verständlich. Allein für die Erklärung der Vorteile der SSA-Form von machinennahen internen Repräsentationen kann ich das Buch empfehlen. Die Kapitel sind in kurze, oft beinahe abgeschlossene Unterabschnitte eingeteilt, sodass das Lesen Spaß macht und auch nicht ermüdet.

Fazit: Ein empfehlenswertes Buch für alle, die sich für Compiler- oder Interpreterdesign interessieren. Ich empfehle generell indische Ausgaben, sie haben etwas dünneres Papier und sind dafür aber auch viel billiger. An dem Gefasel auf dem Einband, dass der Verkauf anderswo verboten ist, ist selbstverständlich überhaupt nichts dran. Natürlich können Sie das Buch jederzeit in Indien bestellen - sonst wäre das Buch auch zu teuer.
Charles C.
5.0 out of 5 stars Probablement l’un des meilleurs livres sur le sujet
Reviewed in France on December 18, 2020
Probablement l’un des meilleurs livres sur le sujet. Toutes les notions fondamentales y sont abordées avec une grande clarté. A la fois plus simple à appréhender et parfois plus exhaustif que le « Dragon Book » (Aho, Lam, Sethi & Ullman) je ne saurais que trop recommander ce livre aux étudiants en informatique suivant des cours en théorie des langages et compilation.