Re: the long way to the development of a compiler

Aleksey Kliger <aleksey+@cs.cmu.edu>
3 Jul 2001 23:15:42 -0400

          From comp.compilers

Related articles
the long way to the development of a compiler stf@apl.it (Stefano Lanzavecchia) (2001-06-28)
Re: the long way to the development of a compiler lockner@chaos.cns.uni.edu (Matthew J.Lockner) (2001-07-01)
Re: the long way to the development of a compiler neelk@alum.mit.edu (2001-07-02)
Re: the long way to the development of a compiler dlindauer@notifier-is.net (david lindauer) (2001-07-02)
Re: the long way to the development of a compiler walter@nospamm-digitalmars.com (walter) (2001-07-02)
Re: the long way to the development of a compiler stf@apl.it (Stefano Lanzavecchia) (2001-07-02)
Re: the long way to the development of a compiler christian.bau@isltd.insignia.com (Christian Bau) (2001-07-02)
Re: the long way to the development of a compiler aleksey+@cs.cmu.edu (Aleksey Kliger) (2001-07-03)
Re: the long way to the development of a compiler neelk@alum.mit.edu (2001-07-03)
Re: the long way to the development of a compiler franck.pissotte@free.fr (Franck Pissotte) (2001-07-03)
Re: the long way to the development of a compiler marcov@toad.stack.nl (2001-07-06)
Re: the long way to the development of a compiler frido@q-software-solutions.com (Friedrich Dominicus) (2001-07-17)
| List of all articles for this month |

From: Aleksey Kliger <aleksey+@cs.cmu.edu>
Newsgroups: comp.compilers
Date: 3 Jul 2001 23:15:42 -0400
Organization: Carnegie Mellon Univ. -- Computer Science Dept.
References: 01-06-071 01-07-004
Keywords: books
Posted-Date: 03 Jul 2001 23:15:41 EDT

Matthew J.Lockner <lockner@chaos.cns.uni.edu> writes:


> Modern Compiler Implementation in (C|Java|ML) by Andrew Appel.


We used the Java version of the book in a class that I TAd at my
previous university.


If the OP insists on getting that book; I strongly recommend getting a
second or later printing. The first printing which we used two years
ago had a lot of horrible errors (wrong diagrams; cross-referencing
that was misnumbered, and so forth).


Overall, the book (and I assume the series[*]) is quite decent.


The provided code certainly gets the job done, but it is not the best
example of large-scale java code. A lot of the provided code feels
like an automated translation from ML code, and not really idiomatic
Java code.


For our class, we recommended getting a copy of the GoF "Design
Patterns" book and using that as a model for structuring code and
pretty much ignoring Appel's code except for as a reference.


> The book is geared toward the RISC believer, but I made my backend
> generate Intel code and found the approaches to adapt quite well.


We used the book's approach to compiler construction to generate
Pentium code on Win32. Aside from the larger number of spills during
register allocation (as well as a more tiles during the instruction
selection phase), there was very little difference. Especially since
the Pentii tend to penalize you the least for instructions from a very
RISC-like core set.


> There are chapters devoted to implementing functional languages, garbage
> collectors, and SSA form, as well as optimizations and fun with the cache,
> if that is your thing.


There is also a chapter on writing OO code, if you come from that side.


HTH


[*] Folklore would have us believe that Appel has the entire book set
up as a TeX file and he only has to switch one macro at the begining
of it to generate the ML or Java or C version of the book.
--
aleksey
http://www.lambdageek.org/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.