CDN$ 124.73
  • List Price: CDN$ 125.71
  • You Save: CDN$ 0.98 (1%)
Only 1 left in stock (more on the way).
Ships from and sold by Gift-wrap available.
Engineering a Compiler has been added to your Cart
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Engineering a Compiler Hardcover – Feb 7 2011

See all 2 formats and editions Hide other formats and editions
Amazon Price
New from Used from
Kindle Edition
"Please retry"
"Please retry"
CDN$ 124.73
CDN$ 94.78 CDN$ 104.16

Save an Additional 10% on Textbooks When you Join Amazon Student

Special Offers and Product Promotions

  • Amazon Student members save an additional 10% on Textbooks with promo code TEXTBOOK10. Enter code TEXTBOOK10 at checkout. Here's how (restrictions apply)

No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your e-mail address or mobile phone number.

Product Details

  • Hardcover: 824 pages
  • Publisher: Morgan Kaufmann; 2 edition (Feb. 7 2011)
  • Language: English
  • ISBN-10: 012088478X
  • ISBN-13: 978-0120884780
  • Product Dimensions: 19.3 x 4.1 x 23.6 cm
  • Shipping Weight: 1.5 Kg
  • Average Customer Review: Be the first to review this item
  • Amazon Bestsellers Rank: #160,161 in Books (See Top 100 in Books)
  •  Would you like to update product info, give feedback on images, or tell us about a lower price?

  • See Complete Table of Contents

Product Description


"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

"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

From the Back Cover

Engineering a Compiler Second Edition Keith D. Cooper and Linda Torczon

"Compilers are a rich area of study, drawing together the whole world of computer science in one, elegant construction. Cooper and Torczon have succeeded in creating a welcoming guide to these software systems, enhancing this new edition with clear lessons and the details you simply must get right, all the while keeping the big picture firmly in view.Engineering a Compileris an invaluable companion for anyone new to the subject."

--Michael D. Smith, Dean of the Faculty of Arts and Sciences, John H. Finley, Jr. Professor of Engineering and Applied Sciences, Harvard University

This entirely revised second edition ofEngineering a Compileris 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, including Java, C, C++, and FORTRAN

About the Authors

Keith Cooper Doerr Professor in Computational Engineering Department of Computer Science, Rice University.

Linda Torczon Senior Research Scientist Department of Computer Science Rice University.

See all Product Description

Inside This Book

(Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

There are no customer reviews yet on
5 star
4 star
3 star
2 star
1 star

Most Helpful Customer Reviews on (beta) HASH(0x9ab92150) out of 5 stars 12 reviews
57 of 57 people found the following review helpful
HASH(0x9abc2c00) out of 5 stars Great compiler book Oct. 16 2011
By Dr. Bruce Watson - Published on
Format: Hardcover Verified Purchase
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.
32 of 33 people found the following review helpful
HASH(0x9abc2e4c) out of 5 stars great theoretical book on compiler optimisation Oct. 3 2011
By Andrew Pape - Published on
Format: Hardcover Verified Purchase
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.
6 of 6 people found the following review helpful
HASH(0x9abc2e10) out of 5 stars Concise, implementation-oriented, pragmatic but thoughtful Jan. 3 2014
By Mark - Published on
Format: Hardcover Verified Purchase
Upon opening this book, you might be a little off-put. The font and format are a little odd, and there are page-long algorithms in slightly archaic pseudocode ("endfor", etc.). However, I found it be a great introduction to compilers.

I felt that implementation details of some of the algorithms were a little specific, but they also thoroughly discussed the implications, strengths, and weaknesses of each method. It was therefore easy to read the general overview and analysis of a technique, skipping the sometimes tedious implementation. Then, when implementing certain algorithms, you can flip back for techniques and tips.

The sections on abstractions focus mostly on object orientation. Languages like Haskell are not discussed, and Lisp (which, to be fair, is interpreted in its traditional form) is only given a passing mention. This is justifiable, though, as features like currying are generally considered advanced topics. I would have liked to have seen more of it, but I can't complain about its absence.

The title of the book may be the best concise description of its content. If you want to *make* a compiler and simultaneously understand how it works, this is a strong choice.
12 of 14 people found the following review helpful
HASH(0x9abc7120) out of 5 stars Between the Tiger and the Dragon. Sept. 18 2012
By Duncan - Published on
Format: Hardcover
I found the book to be a nice balance between the deep theory of Aho et al's Dragon book and the implementation focus of Appel's Tiger book. To my mind it sits squarely between the two extremes.
4 of 4 people found the following review helpful
HASH(0x9abc7624) out of 5 stars a fine book for its time Feb. 11 2015
By C. Sears - Published on
Format: Hardcover Verified Purchase
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.