95 of 95 people found the following review helpful:
5.0 out of 5 stars
Super compiler text!, February 21, 2005
This review is from: Engineering a Compiler (Hardcover)
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...
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
26 of 26 people found the following review helpful:
4.0 out of 5 stars
Depends on what you want, June 12, 2007
This review is from: Engineering a Compiler (Hardcover)
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
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
30 of 32 people found the following review helpful:
4.0 out of 5 stars
I'd rather call it "A guide for engineering a compiler", September 2, 2004
This review is from: Engineering a Compiler (Hardcover)
This book deals with all the issues you will face while engineering a MODERN compiler. Each subject is rather a brief instroduction than a thorough discussion, but detailed enough to give readers a good introduction working as a good pointer when you need a more detailed information.
Also the author tries very hard to cover as much subjects as possible you have to deal with when you design a language and implment a compiler for it.
I'd use this book not as a thorough compiler algorithm bible but as a guide to follow when implementing my compiler.
By following each chapter in the book, at least you will know what problems you should slove. If the problem is simple enough, the solution is in the book. For more complicated problems, you gotta dig into the internet.
In my opinion, this book is the best compiler engineering guide ever I read.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No