What it is: A great introduction to basic concepts in contemporary compilers.
What it's not: A handbook for someone thrown in at the deep end of commercial compiler development.
I can imagine a very good one-term course in compiler construction built around this text. After a brief introduction, it gets immediately into the classic topics of lexical scanning, parsing, and syntax analysis. These three chapters help any beginner understand the multiple levels of processing, from the character level, up through reorganizing grammars for practical parsing and table-driven techniques, to the lower levels of sematic analysis. This includes a very brief discussion of type systems and type inference - less than 20 pages, on a topic that whole books devote themselves to. These 200 pages typify what you'll see in the rest of the book: a lot of attention paid to lexical analysis, a problem largely eliminated by automated tools (lex and yacc being the best known), and thin mention of the harder problems that differ significantly across languages and applications of languages.
Chapter 5 addresses the critical issue of intermediate representation, the data structures that represent the program during analysis, optimization, and code generation. Chapter 6 is titled "The Procedure Abstraction." It deals with much more than its name suggests, including procedure activation records (generalizations of stack frames), parameter passing, stack management, symbol visibility and scoping, and scraps of symbol table organization - important stuff, but hard to understand as "procedure abstaction." The next chapter deals with "Code Shape," a grab-bag including value representations, arrays and strings, control constructs, and procedures (again). It also presents a very few pages, at the end, on object oriented language - hardly enough to scratch the surface, let alone build competence. And, for lack of a better place to stick them, I would have expected support for parallelism and exceptions to appear here, but this book seems to omit the topics altogether.
Code analysis and optimization appear in chapters 8-10. That includes a competent introduction to static single assignment notation, a staple of current compiler technology mentioned earlier, in the section on intermediate representation. This covers a range of basics, but omits all significant mention of arrays, the workhorses of performance computing. Chapters 11-13 introduce the basics of instruction selection, scheduling, and register allocation. Although it mentions some hardware effects, like out-of-order execution in superscalar architecture, discussion stays close the instruction sets of popular processors. As a result, it omits mention of SIMD, VLIW, DSP, and more exotic architectures, the ones most in need of good code generation. Compiler-specific support libraries, e.g. the kind that make up for lack of hardware divide instructions, should have appeared somewhere around here, but are oddly absent.
The authors present an adequate introduction for the beginner, someone who's still not sure what a hash table is (see appendix B). It introduces many basic topics, but doesn't go into a lot of depth in any of them. The student who finishes this book will understand most major issues of classical compiler construction. I just can't see a serious, working competence coming out of this text, though. I give it four stars as an academic introduction, but a lot less for anyone with immediate problems to solve.
-- wiredweird
Engineering a Compiler 1st Edition
by
Keith D. Cooper
(Author),
Linda Torczon
(Author)
| Keith D. Cooper (Author) Find all the books, read about the author, and more. See search results for this author |
ISBN-13: 978-1558606982
ISBN-10: 155860698X
Why is ISBN important? ISBN
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Use the Amazon App to scan ISBNs and compare prices.
Add to book club
Loading your book clubs
There was a problem loading your book clubs. Please try again.
Not in a club? Learn more
Join or create book clubs
Choose books together
Track your books
Bring your club to Amazon Book Clubs, start a new book club and invite your friends to join, or find a club that’s right for you for free.
More Buying Choices
There is a newer edition of this item:
The proliferation of processors, environments, and constraints on systems has cast compiler technology into a wider variety of settings, changing the compiler and compiler writer's role. No longer is execution speed the sole criterion for judging compiled code. Today, code might be judged on how small it is, how much power it consumes, how well it compresses, or how many page faults it generates. In this evolving environment, the task of building a successful compiler relies upon the compiler writer's ability to balance and blend algorithms, engineering insights, and careful planning. Today's compiler writer must choose a path through a design space that is filled with diverse alternatives, each with distinct costs, advantages, and complexities.
Engineering a Compiler explores this design space by presenting some of the ways these problems have been solved, and the constraints that made each of those solutions attractive. By understanding the parameters of the problem and their impact on compiler design, the authors hope to convey both the depth of the problems and the breadth of possible solutions. Their goal is to cover a broad enough selection of material to show readers that real tradeoffs exist, and that the impact of those choices can be both subtle and far-reaching.
Authors Keith Cooper and Linda Torczon convey both the art and the science of compiler construction and show best practice algorithms for the major passes of a compiler. Their text re-balances the curriculum for an introductory course in compiler construction to reflect the issues that arise in current practice.
Engineering a Compiler explores this design space by presenting some of the ways these problems have been solved, and the constraints that made each of those solutions attractive. By understanding the parameters of the problem and their impact on compiler design, the authors hope to convey both the depth of the problems and the breadth of possible solutions. Their goal is to cover a broad enough selection of material to show readers that real tradeoffs exist, and that the impact of those choices can be both subtle and far-reaching.
Authors Keith Cooper and Linda Torczon convey both the art and the science of compiler construction and show best practice algorithms for the major passes of a compiler. Their text re-balances the curriculum for an introductory course in compiler construction to reflect the issues that arise in current practice.
Books with Buzz
Discover the latest buzz-worthy books, from mysteries and romance to humor and nonfiction. Explore more
Customers who viewed this item also viewed
Page 1 of 1 Start overPage 1 of 1
Customers who bought this item also bought
Page 1 of 1 Start overPage 1 of 1
Editorial Reviews
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
A wonderful introduction to the theory, practice, and lore of modern compilers. Cooper and Torczon convey the simple joys of this subject that
follow from the elegant interplay between compilation and the rest of computer science. If you're looking for an end-to-end tour of compiler
construction annotated with a broad range of practical experiences, this is the book.
-Michael D. Smith, Harvard University
Modern compilers have played critical roles in areas such as software development tools, application performance, and processor design. This book has done an excellent job of illustrating various state-of-the-art technologies for an advanced compiler, in particular, optimization and code generation, the core of modern compilers. Compilers have evolved into complicated software and what makes a good compiler largely lies in the wisdom of engineering during design and development. The readers of this book can certainly learn how to construct a modern compiler with various engineering trade-offs.
-Roy Ju, Senior Researcher,Microprocessor Research Labs, Intel Corp.
As researchers, the authors have made major contributions to the literature and as teachers, they have produced leaders in the field. The combination is reflected in a book that is rich with the insight of great research and written with the clarity of experienced teachers. The result is an outstanding text.
-Steve Blackburn, The Australian National University
-Jim Larus, Microsoft Research
A wonderful introduction to the theory, practice, and lore of modern compilers. Cooper and Torczon convey the simple joys of this subject that
follow from the elegant interplay between compilation and the rest of computer science. If you're looking for an end-to-end tour of compiler
construction annotated with a broad range of practical experiences, this is the book.
-Michael D. Smith, Harvard University
Modern compilers have played critical roles in areas such as software development tools, application performance, and processor design. This book has done an excellent job of illustrating various state-of-the-art technologies for an advanced compiler, in particular, optimization and code generation, the core of modern compilers. Compilers have evolved into complicated software and what makes a good compiler largely lies in the wisdom of engineering during design and development. The readers of this book can certainly learn how to construct a modern compiler with various engineering trade-offs.
-Roy Ju, Senior Researcher,Microprocessor Research Labs, Intel Corp.
As researchers, the authors have made major contributions to the literature and as teachers, they have produced leaders in the field. The combination is reflected in a book that is rich with the insight of great research and written with the clarity of experienced teachers. The result is an outstanding text.
-Steve Blackburn, The Australian National University
Review
Distils and illustrates principles and best practices for designing modern compilers
Book Description
Distils and illustrates principles and best practices for designing modern compilers
About the Author
Dr. Cooper Ph.D., Professor, Dept. of Computer Science at Rice University, is the leader of the Massively Scalar Compiler Project at Rice, which investigates issues relating to optimization and code generation for modern machines. He is also a member of the Center for High Performance Software Research, the Computer and Information Technology Institute, and the Center for Multimedia Communication -- all at Rice. He teaches courses in Compiler Construction at the undergraduate and graduate level.
Linda Torczon is a principal investigator on the Massively Scalar Compiler Project at Rice University, and the Grid Application Development Software Project sponsored by the next Generation Software program of the National Science Foundation. She also serves as the executive director of HiPerSoft and of the Los Alamos Computer Science Institute. Her research interests include code generation, interprocedural dataflow analysis and optimization, and programming environments.
Linda Torczon is a principal investigator on the Massively Scalar Compiler Project at Rice University, and the Grid Application Development Software Project sponsored by the next Generation Software program of the National Science Foundation. She also serves as the executive director of HiPerSoft and of the Los Alamos Computer Science Institute. Her research interests include code generation, interprocedural dataflow analysis and optimization, and programming environments.
Excerpt. © Reprinted by permission. All rights reserved.
Distils and illustrates principles and best practices for designing modern compilers
Tell the Publisher!
I'd like to read this book on Kindle
Don't have a Kindle? Compra tu Kindle aquí, or download a FREE Kindle Reading App.
I'd like to read this book on Kindle
Don't have a Kindle? Compra tu Kindle aquí, or download a FREE Kindle Reading App.
Learn skills from picture taking to sushi making
Amazon Explore Browse now
Product details
- Publisher : Morgan Kaufmann; 1st edition (November 10, 2003)
- Language : English
- Hardcover : 832 pages
- ISBN-10 : 155860698X
- ISBN-13 : 978-1558606982
- Item Weight : 4.29 pounds
- Dimensions : 8 x 1.25 x 9 inches
- Best Sellers Rank: #2,201,691 in Books (See Top 100 in Books)
- #176 in Compiler Design
- #214 in Computer Hardware Design
- #495 in Microeconomics (Books)
- Customer Reviews:
About the author
Follow authors to get new release updates, plus improved recommendations.

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
4.3 out of 5 stars
4.3 out of 5
19 global ratings
How customer reviews and ratings work
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Reviewed in the United States on June 12, 2007
42 people found this helpful
Report abuse
Reviewed in the United States on March 21, 2015
A good book for the casual reader. I am not a student, but interested in compiler technology. This book is an easy read and can be understood by non academics as well. I would put it on a level with in-depth articles in Dr.Dobb's Journal or comparable magazines. It gives a general overview over the necessary techniques without going into detail, so unless you also use other sources, you won't be able to build a compiler all by yourself, but it is very good to get a first idea of what's behind compilers.
Reviewed in the United States on April 7, 2018
Good book, great qualiy !!!
Reviewed in the United States on April 7, 2015
great book
Reviewed in the United States on December 31, 2006
I read this book and really did not like it. It is a nightmare for any one new to compilers. It is difficult to read with more emphesis on the backend of the compiler.
The following texts are much better for a beginner:
1. Louden's Compiler construction --> the best text for a beginner.
2. the Dragon book
The following texts are much better for a beginner:
1. Louden's Compiler construction --> the best text for a beginner.
2. the Dragon book
12 people found this helpful
Report abuse
Reviewed in the United States on October 26, 2009
I think this book is just a list of knowledge without good organization. Too many typos.
4 people found this helpful
Report abuse
Reviewed in the United States on November 8, 2009
The condition in which I received the book was very good and very much upto the standards I had expected. Regarding the book itself, its a wonderful book for computer science engineers.
Reviewed in the United States on February 21, 2005
This is really a super compiler text. It is also one of the most recent compiler books you can buy.
First of all this is a theoretical book. If you read the title 'Engineering a compiler' as 'Coding/Building a compiler' you would be disappointed! So, if you're looking for a learing-by-coding book, this is not for you (but I have some recommendations at the end of this review in the latest paragraph). The difference with most of the other theoretical books is that this book is not a dry text. It has also a nice layout. It gives plenty of examples, and all topics are well connected to each other. It's a pleasure to read for not native English people, so native English people can read it pretty fast.
This book read like a novel.. It does contain enough diagrams, tables, etc. but not too much (crowded), and everything is well explained.
You can read this book as a compiler introduction book. But I can only recommend this to B.Sc/M.Sc Computer Science students (like me). You don't need to have a M.Sc in Mathematics to understand this text, (all the math, eg. liveness graphs are well explained), but you will understand everything better if you have some background in algorithms (design), pseudocode, etc. like you gained during your B.Sc program. People without formal computer science education I would recommend to read a practical book first (see at the end of this review), because you may find else this text too theoretical.
This book focus on code optimizations. According to the authors (and me) compiler front ends (scanning/parsing/etc) are commodities today, and the backend (codegeneration) is where the difference is made nowadays. So if you're looking for a introduction text into compiler optimization this book is for you!
If you're looking for a more practical book I advice you to read 'Programming Language Processors in Java' from Watt & Brown. In that book you learn to build a nice stack virtual machine in Java with 'advanced features' like records (structs), procedures/functions, arrays and so on. That book is a good companion for 'Engineering a Compiler' to give you some practical insight. If you're looking for a Language Design book I advice you to look at 'Programming Language Pragmatics'. Both books are worth the money...
First of all this is a theoretical book. If you read the title 'Engineering a compiler' as 'Coding/Building a compiler' you would be disappointed! So, if you're looking for a learing-by-coding book, this is not for you (but I have some recommendations at the end of this review in the latest paragraph). The difference with most of the other theoretical books is that this book is not a dry text. It has also a nice layout. It gives plenty of examples, and all topics are well connected to each other. It's a pleasure to read for not native English people, so native English people can read it pretty fast.
This book read like a novel.. It does contain enough diagrams, tables, etc. but not too much (crowded), and everything is well explained.
You can read this book as a compiler introduction book. But I can only recommend this to B.Sc/M.Sc Computer Science students (like me). You don't need to have a M.Sc in Mathematics to understand this text, (all the math, eg. liveness graphs are well explained), but you will understand everything better if you have some background in algorithms (design), pseudocode, etc. like you gained during your B.Sc program. People without formal computer science education I would recommend to read a practical book first (see at the end of this review), because you may find else this text too theoretical.
This book focus on code optimizations. According to the authors (and me) compiler front ends (scanning/parsing/etc) are commodities today, and the backend (codegeneration) is where the difference is made nowadays. So if you're looking for a introduction text into compiler optimization this book is for you!
If you're looking for a more practical book I advice you to read 'Programming Language Processors in Java' from Watt & Brown. In that book you learn to build a nice stack virtual machine in Java with 'advanced features' like records (structs), procedures/functions, arrays and so on. That book is a good companion for 'Engineering a Compiler' to give you some practical insight. If you're looking for a Language Design book I advice you to look at 'Programming Language Pragmatics'. Both books are worth the money...
112 people found this helpful
Report abuse


