News for hackers. Stuff that matters.
Re:I told my 2nd year CS students to create a programming la... by jules on Saturday April 14, 2012 @07:09AM (#3840545)
The Dragon book may be a fine book but it is mainly a book on parsing, not on compilers. You first learn about control flow graphs in chapter 9! Most courses probably won't even get that far. The parts that are about compilation are very old fashioned, essentially a book about "how to compile Fortran to inefficient code like they did in the '60ies".

It would be great if there was a book on modern compiler techniques, including SSA, abstract interpretation, compiling high level languages, pointer analysis, compiling dynamic dispatch, garbage collection and closures, etc. Probably the closest are Appel's compiler books.

Re:I told my 2nd year CS students to create a programming la... by Locke1689 on Saturday April 14, 2012 @03:42PM (#3841796)
http://www.cs.princeton.edu/~appel/modern/ml/

http://store.elsevier.com/product.jsp?isbn=9780120884780

Two of the most important books I own.

Also, thank you for tearing down the dragon book -- I was going to do the same myself.

The dragon book is outdated on parsing, too. It's from a time where single-pass parsing and compilation was sometimes necessary because you didn't have enough memory (or time) to do multiple passes. It certainly doesn't have anything on packrat parsing. It is a historical book -- I would recommend it for no serious purpose (even pedagogical) these days.

Re:I told my 2nd year CS students to create a programming la... by haberman on Monday April 16, 2012 @11:04AM (#3847659)
> http://store.elsevier.com/product.jsp?isbn=9780120884780

I don't trust this book; it has an error that I reported to the authors twice but never heard a word back (or any note of the error in their list of errata).

Here's what I wrote to them:

  Subject: Errata for "Engineering a Compiler"
  Date: Sat, May 26, 2007 at 8:12 PM

  Hello,

  I noticed that your section on DFA minimization is labeled
  "Hopcroft's Algorithm," but doesn't seem to describe the
  algorithm explained by Hopcroft in his 1971 paper [0]. Your
  algorithm appears to be n^2, where Hopcroft's is n log n. David
  Gries gave a somewhat more digestible presentation of the same
  algorithm in a follow-up paper in 1972 [1].

  Hope this information is useful!

  Sincerely, <me>

  [0] John E. Hopcroft. An n log n algorithm for minimizing states
  in a finite automaton. Technical Report: CS-TR-71-190, 1971.
  Available online at
  ftp://reports.stanford.edu/pub/cstr/reports/cs/tr/71/190/CS-TR-71-190.pdf

  [1] David Gries. Describing an algorithm by Hopcroft. Acta
  Informatica, 2(2):97-109. Online reference:
  http://www.springerlink.com/content/r5631549671g6251/

> The dragon book is outdated on parsing, too. It's from a time where single-pass parsing and compilation was sometimes necessary because you didn't have enough memory (or time) to do multiple passes. It certainly doesn't have anything on packrat parsing.

I'm pretty sure that all production compilers do one-pass parsing even now because of efficiency concerns. I would be very surprised if any production compiler used packrat parsing which takes O(n) memory.

Re:I told my 2nd year CS students to create a programming la... by fjellfras on Sunday April 15, 2012 @05:26AM (#3843231)
I have been using Kenneth Louden's book on compiler construction and as a beginner I find it extremely helpful so far.
Re:I told my 2nd year CS students to create a programming la... by b2rock on Saturday April 14, 2012 @08:01AM (#3840648)
Some bigger schools now teach with their own set of materials that the professors put together. I think it might be precisely because of this reason.