TDDB29 / TDDB44
Other good books on compilers
Regarding alternatives to the so-called dragon book
(Aho, Lam, Sethi, Ullman: Compilers Principles, techniques, tools,
2nd edition, Addison-Wesley 2006):
Here are some recommendations and comments.
Although quite aged, the first edition of the
dragon book (1986) covers the main contents
of TDDB29 and TDDB44 fairly well.
Note that, for instance, the concepts of lexical, syntactic
and semantic analysis are basically unchanged
since the dragon book was written.
Even though many new results exist in the areas of
intermediate representations, program analysis, and code generation and
optimization, these advanced topics can hardly be taken up in TDDB29/TDDB44
because time is really limited.
Instead, we are planning for a new follow-up course
TDDC86 Compiler optimizations and code generation, 4p
which will be given for the first time in autumn 2008.
Beyond the old and new dragon book,
we can also recommend the following compiler books:
- Wilhelm, Maurer: Compiler Design. Addison-Wesley, 1995.
Comprehensive but fairly formal. It says more about parsing theory than the dragon book.
Good coverage of compiling for functional and logic programming languages, too.
Also available in German and French. The german version (Springer 1992) actually
contains more about parsing theory than the English translation.
- Cooper, Torczon: Engineering a Compiler. Morgan Kaufmann, 2004.
Covers also SSA form and advanced register allocation.
- D. Grune, H. Bal, C. Jacobs, K. Langendoen: Modern Compiler Design. Wiley, 2000.
- K. Louden: Compiler Construction, Principles and Practice.
PWS Publ., 1996.
If you have access to another book covering the foundations and
prefer reading C source code, the following book may be ideal for you:
- Fraser, Hanson: A Retargetable C Compiler: Design and Implementation.
Addison Wesley, 1995.
Contains almost the entire source code of the
LCC compiler.
A book with a balanced presentation of both
programming language concepts and compiler issues to implement them is
- Michael Scott: Programming Language Pragmatics. Morgan Kaufmann, 1999
(or a newer edition).
There are many other good books on compilers, but these often focus on quite advanced issues
(advanced analysis, restructuring, parallelisation, optimizations, code generation...)
and are therefore less suitable as a textbook for this introductory course.