About

Jadira Systems is the initiative of Sousan Rassoul and Chris Pheby to produce reusable open source Java modules that provide first class solutions using the most effective current JEE technologies.

Search
Recent Changes
No website changes have been recorded.
Login
« Subversion 1.5.0 Release | Main | Hidden Start »
Saturday
Jun282008

Review: Compilers, Principles, Techniques, Tools (2nd Edition) by Aho, Lam, Sethi & Ullman

Of the literature on Compiler theory, this book is an acknowledged classic. The second edition retains the clarity and focus of the first, but is refreshed with a nod to the Java language and platform, and detailed, if still esoteric discussion of approaches for optimising compilation for multiprocessors. This book is a traditional textbook, designed to back an undergraduate course on compiler construction, and bearing in mind the advanced nature of the subject matter, this should influence your expectation of the read. In future reviews, I'll be looking at some of the books that provide a gentler, more practical introduction to the area of compilers. 

In the past, reviewers could dismiss this book - previously known as the 'Dragon' book for its distinctive cover - as being essential reading only for those involved in construction of compilers for the C programming language. Today, with the second edition, this no longer holds true. Today, with regular expressions, compiler compilers, DSLs, mini-languages, annotation processors, and AOP becoming common-place, knowledge of compiler construction provides a theoretical underpinning to all of these domains. This book lives up to its name by providing that theoretical basis, and consequently becomes an essential book to own.

Broadly speaking, the book is divided into two halves. The first parts of the book are focused on lexical and syntax analysis, and code generation using DFA parsers. The book is closely focused on C - as you would expect - but this kind of technology forms the technological basis for tools such as JavaCC, Antlr, Lex and Yacc. The newer edition makes passing reference to the JVM, but far less focus than is desirable on interpreters and more loosely (duck) typed modern languages. In my mind, this is only a minor draw back. Type inference belongs in a later stage of compilation - as a part of syntax analysis, and the principles within remain relevant.

Later parts of the book provide an interesting elaboration of issues in code and machine level optimisation, and code generation. This book provides possibly the only comprehensive treatment of this subject, but is not relevant to most readers, who will be seeking to generate compilers that either target a simple virtual machine environment such as the JVM, or that do not produce executable code at all. Furthermore, the issues of the compiler front-end - how to express the grammar, or rules, of a computer language - are only loosely coupled to this domain.

This book provides an appreciation of the transferable principles and techniques that can scale to producing parsers and interpreters for languages of an arbitrary complexity and problem domain. This is not a book on object-orientation (for that, read Meyer's Object Oriented Software Construction). Nor is it concerned with the specific use of any particular modern tool such as Antlr. There are books for these tools, consult these after reading this book. The book does not concern itself overly with the nuances of alternatives to the DFA lexer approach - this too can be found elsewhere.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>