GetTextbooks.co.uk  
 Compare Prices & Save up to 90%
Search by ISBN, title, author, etc ...

Login | Sign up | My Wish List  


Modern Compiler Implementation in Java

by Andrew W. Appel

ISBN-10: 9780521583886
ISBN-10: 0-521-58388-8
ISBN-13: 9780521583886
ISBN-13: 978-0-521-58388-6
Hardcover
1997-12-13
Cambridge University Press


Find Lowest Price

Editorials


Product Description
Last year you may have seen the Modern Compiler Implementation in C: Basic Techniques (1997) which was the preliminary edition of our new 1998 textbook, Modern Compiler Implementation in C. The new, expanded version of this textbook describes all phases of a modern compiler: lexical analysis, parsing, abstract syntax, semantic actions, intermediate representations, instruction selection via tree matching, dataflow analysis, graph-coloring register allocation, and runtime systems. It includes good coverage of current techniques in code generation and register allocation, as well as functional and object-oriented languages, that are missing from most books. In addition, more advanced chapters are now included so that it can be used as the basis for two-semester or graduate course. The most accepted and successful techniques are described in a concise way, rather than as an exhaustive catalog of every possible variant. Detailed descriptions of the interfaces between modules of a compiler are illustrated with actual C header files. The first part of the book, Fundamentals of Compilation, is suitable for a one-semester first course in compiler design. The second part, Advanced Topics, which includes the advanced chapters, covers the compilation of object-oriented and functional languages, garbage collection, loop optimizations, SSA form, loop scheduling, and optimization for cache-memory hierarchies. A unique feature of the book is a well designed compiler implementation project in Java, including front-end and 'high-tech' back-end phases, so that students can build a complete working compiler in one semester. Accompanying support software is available.

Book Description
The new, expanded version of this textbook describes all phases of a modern compiler, including current techniques in code generation and register allocation, for imperative, functional and object-oriented languages. In a concise and practical way the author describes the fundamentals of compilation and then moves on to advanced topics such as SSA form, loop scheduling, and optimization for cache-memory hierarchies. A unique feature is a compiler implementation project in Java, including front-end and 'high-tech' back-end phases.

Download Description
This textbook describes all phases of a compiler: lexical analysis, parsing, abstract syntax, semantic actions, intermediate representations, instruction selection via tree matching, dataflow analysis, graph-coloring register allocation, and runtime systems. It includes good coverage of current techniques in code generation and register allocation, as well as the compilation of functional and object-oriented languages, that is missing from most books. The most accepted and successful techniques are described concisely, rather than as an exhaustive catalog of every possible variant, and illustrated with actual Java classes. The first part of the book, Fundamentals of Compilation, is suitable for a one-semester first course in compiler design. The second part, Advanced Topics, which includes the compilation of object-oriented and functional languages, garbage collection, loop optimization, SSA form, instruction scheduling, and optimization for cache-memory hierarchies, can be used for a second-semester or graduate course. This new edition has been extensively rewritten to include more discussion of Java and object-oriented programming concepts, such as visitor patterns. A unique feature is the newly redesigned compiler project in Java, for a subset of Java itself. The project includes both front-end and back-end phases, so that students can build a complete working compiler in one semester.

Reviews


Only good for Experienced Readers - No good for Beginners
For reasons of local tradition I am using this book in my Compiler Course in this semester. For students (and practioners) who already know the theory behind a compiler, this book is certainly a valuable help in actually implementing a compiler.

However, for readers who have little (or no) previous knowledge about compilers, this book seems rather hard to understand.

This is mainly because of its poor didactics. Definitions are not given precisely in Mathematical Notation - often "things are just somehow sloppily described" in a rather colloquial language which does not really help in understanding the concepts.

For example the important concept of FOLLOW-Set is only vaguely explained, and then "defined" only in terms of some cumbersome Algorithm to compute this set. Such a definition could have been presented much much clearer.

Moreover, there is no nice step-by-step concept: Again and again we find confusing side remarks and forward references to later chapters, which do not help in understanding the very chapter which I am just about to grasp.

For example, already in the first Introduction chapter, when the reader has not yet even learned the very basics of a compiler, one of the exercises is already: to fiddle around with some Java Code in order to make an Interpreter for an example of a little language!

Of course the book offers plenty of programming and code examples to play with, however I don't really appreciate this Learning-by-Trying approach promoted in this book.

Therefore I would recommend to study a more theoretical introductory textbook (like the famous "Dragon Book") first, and then, with the background knowledge from such other books, use the code examples from Appel's book to actually build a compiler.

With only this one book on compiler construction, the student would probably not be sufficiently well equipped.

Mediocre at best
It's been quite some time since I read this book, and my tastes in languages have changed quite a bit since then, so it's possible that if I read this book today, I would have a different impression. However, I am doubtful that that would be the case, and as it stands, my memories of this book leave a bitter taste in my mouth.

The joke goes that "some programmers can write C/Fortran code in any language," and that is exactly the problem with this book. The compiler implemented within may compile correctly under javac, but it isn't implemented in a modular, object oriented way like one might expect when using such a language. Rather, the author seems to often use classes as little more than C structs, and methods as merely convenient ways of grouping together functions. I see now that the author also has a book on C compilers, and it wouldn't surprise me if the code herein was a direct port to Java, with as little redesign as possible.

I am certainly not an expert on compilers, and as I said, it's been quite some time since I read this book. The general information on compiling in this book might be useful, and I'll leave it to other people to make comments on that. However, if you are looking for a book that gives advice on what patterns work well when developing compilers, or what advantages an object oriented language might bring to the table in that arena, this is not the book you're looking for. This might teach you how to write a compiler that is, syntactically, Java, but it won't give you any insight on why you'd want to use Java over any other language.

Average compiler text with advanced topics
This book is not as bad as some reviewers say. But if you expect to get a cookbook how to write your own compiler in Java (what the title could suggest), you would be a bit disappointed.

The advantage is that this book covers also advanced topics such as register allocation, frame layouting and flow analysis. There are a lot of books which covers simple parsing and codegeneration only, but this book goes futher.

The disadvantage is that Java code snippets of the compiler which are printed in the book is not of great quality (e.g. public member variables, instead of getter/setters and private vars). Maybe the code of quality is compromised to reduce the size of the code in the book.

If you're looking for only a theoretical book, buy 'Engeering a compiler (Cooper et al)'. If you're looking for a pure practical book buy 'Progamming Language Processors in Java: compilers and interpreters' (David Watt).

This book is just between these 2 books: theoretical plus some practical sauce.

An absolute waste of paper
Andrew Appel's textbook (Modern Compiler implementation in Java) has been prescribed as a Course Textbook. Given a choice, I strongly recommend to take it from the library or any place where you can get it for free for one semester/quarter. This book is not worth the money and is an absolute waste. Not only does it not teach you anything about compilers, but if you already know something, then it serves to confuse you.

The author has tried to explain things using an example and "steps" through the process of writing a compiler. So in that sense, if you are just looking to write a compiler and be done with it whether you understand it or not, then this book might be considered OK, though not good in any sense.

No theory about compilers is explained and the author seems to be talking to himself throughout the text.

Vague at Best.
I've read through several compiler texts over the past few months as I work away on a compilers project for school. I would have to say that this text, the required textbook for my class, is not in the least bit useful. Most of the material in the book is not covered in any real depth. If you are looking for a useful book on compilers, I would recomend "Compilers" by Aho, Sethi and Ulman (the Dragon Book), or "Crafting a Compiler" by Fisher and LeBlanc. Both books are much more thorough. The Fisher's book is also quite easy to read and understand. Appel's books only saving grace is the occasional modern view of things.


Home | Browse | Professors | Merchants | Webmasters | Contact Us

[ United States | Canada ]

Copyright © 2003-2008 GetTextbooks.co.uk