Compiler Book?

A place to discuss the science of computers and programs, from algorithms to computability.

Formal proofs preferred.

Moderators: phlip, Prelates, Moderators General

Compiler Book?

Postby aleflamedyud » Sun Mar 30, 2008 9:56 pm UTC

I'd like to buy a book on compilers for my own study this summer. I can do the coding myself, and therefore I'd like something with a more theoretical bent than a coding tutorial.

Anyone have a recommendation?
"With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward. If you can't accept any of that, you are not fit to be a graduate student."
User avatar
aleflamedyud
wants your cookies
 
Posts: 3308
Joined: Tue Oct 09, 2007 7:50 pm UTC
Location: The Central Bureaucracy

Re: Compiler Book?

Postby Rysto » Sun Mar 30, 2008 10:14 pm UTC

I read through a bit of the Dragon book(2nd edition) this term, and I found it dense and very hard to follow. Plus, apparently in the 1970s people didn't use dictionaries like hashtables or binary trees(I'm being totally serious here: whenever the books wanted to do some kind of lookup they always presented the choice as being between an array or a linked list).

There is a newer edition, but nobody seems to acknowledge its existence.
Rysto
 
Posts: 1443
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Compiler Book?

Postby aleflamedyud » Sun Mar 30, 2008 10:24 pm UTC

There's a third edition of the Dragon Book? I thought the Purple Dragon Book was the 2nd edition?
"With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward. If you can't accept any of that, you are not fit to be a graduate student."
User avatar
aleflamedyud
wants your cookies
 
Posts: 3308
Joined: Tue Oct 09, 2007 7:50 pm UTC
Location: The Central Bureaucracy

Re: Compiler Book?

Postby Rysto » Sun Mar 30, 2008 10:56 pm UTC

Ah, that's my mistake. Apparently the Green Dragon book has a different title. I meant the Purple Dragon book.
Rysto
 
Posts: 1443
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Compiler Book?

Postby aleflamedyud » Mon Mar 31, 2008 3:29 am UTC

So nobody uses the Purple Dragon Book?

Aww crap, cause the Amazon reviews for both are mixed into each other.
"With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward. If you can't accept any of that, you are not fit to be a graduate student."
User avatar
aleflamedyud
wants your cookies
 
Posts: 3308
Joined: Tue Oct 09, 2007 7:50 pm UTC
Location: The Central Bureaucracy

Re: Compiler Book?

Postby TraumaPony » Mon Mar 31, 2008 7:01 am UTC

I bought it for myself for Christmas; I've yet to read it, however.
TraumaPony
 
Posts: 5
Joined: Tue Jan 15, 2008 9:44 am UTC
Location: QUT, Brisbane.

Re: Compiler Book?

Postby segfault » Mon Mar 31, 2008 5:22 pm UTC

I took a compiler course a year ago (CS563 at UW-Madison) taught by Professor Fischer and we used "work in progress" drafts of second version of "Crafting a Compiler." The first edition is on Amazon but it is still $60 used and focused on C. He taught the class in Java but if I recall correctly the book wasn't exactly married to a language (which I consider a good thing).

Unfortunately, it doesn't look like I'm much help as the rough drafts don't appear to be accessible outside the UW network. Hopefully, the two authors will finish up the new edition soon. I'll dig it out and take a look at it -- anything in particular you are looking for? I was going to buy the Dragon book but I finished my CS degree taking 17 credits of CS so I didn't have time then.

The reviews of his C-based book put it somewhere between tutorial and pure theory. I suspect the prior book wasn't "married to the language" either so it might be worth hunting down a used copy (Amazon for the reviews: http://www.amazon.com/Crafting-Compiler-C-Charles-Fischer/dp/0805321667).
segfault
 
Posts: 3
Joined: Mon Mar 31, 2008 5:12 pm UTC
Location: Southcentral Wisconsin

Re: Compiler Book?

Postby GrahamM » Wed Apr 02, 2008 6:45 pm UTC

I found "Introduction to Compiler Construction" by Thomas W. Parsons, (1992) to be a concise but detailed (enough for me, anyway) introduction to the subject. It covers the theory needed for lexical and syntactic analysis, like FSAs, and regular expressions etc. Later parts of the book went into optimisations. It was generally well written and interesting.

Unfortunately I didn't read the whole book as I was only looking to learn about specific areas, so I don't know if it is missing some of the details of a modern book.
GrahamM
 
Posts: 4
Joined: Tue Apr 01, 2008 10:33 pm UTC

Re: Compiler Book?

Postby Porges » Sun Apr 06, 2008 9:35 pm UTC

I own "Modern Compiler Design" published by Wiley, written by {Dick Grune, Henri Bal, Ceriel Jacobs, Koen Langendoen}.

It covers a whole bunch of stuff, including compiling Prolog & Haskell, along with modern techniques like attribute grammars.
Porges
 
Posts: 46
Joined: Mon Aug 06, 2007 3:01 am UTC
Location: Wellington, New Zealand

Re: Compiler Book?

Postby Tac-Tics » Wed Apr 16, 2008 7:19 pm UTC

aleflamedyud wrote:So nobody uses the Purple Dragon Book?

Aww crap, cause the Amazon reviews for both are mixed into each other.


I own both the old and new one. I bought the old one because it was a steal online (something like $20). I latere shelled out the $100 for the new version. I haven't finished either one, but I've made large dents into both.

I found the new one to be a hundred times easier to read. Maybe it was because I never studied PASCAL (I think it was Pascal they used), or maybe it was because it was written before the rise of OOP and functional languages, but I really didn't like the old book at all. The basic information on lexical analysis and parsing seems mostly the same, but the new book has a very detailed chapter on topics which have become important in modern programming language design, runtime environments, GC, etc.

Also, the cover is shiny and new and the pages smell fresh! And it uses nice font ;-)
Tac-Tics
 
Posts: 536
Joined: Thu Sep 13, 2007 7:58 pm UTC

Re: Compiler Book?

Postby EvanED » Wed Apr 16, 2008 7:23 pm UTC

AFAIK the first was written before SSA. SSA is one of the most important new compiler technology of the past couple decades. I assume the new one covers it.
EvanED
 
Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Compiler Book?

Postby davean » Thu Apr 17, 2008 5:07 am UTC

EvanED wrote:AFAIK the first was written before SSA. SSA is one of the most important new compiler technology of the past couple decades. I assume the new one covers it.


It was written in 1977 and Continuation Passing Style was described in the 1960 book Compiling with Continuations by Andrew W. Appel about his work on Standard ML. This would make SSA far older then the Green Dragon Book.
User avatar
davean
Site Ninja
 
Posts: 2438
Joined: Sat Apr 08, 2006 7:50 am UTC

Re: Compiler Book?

Postby EvanED » Thu Apr 17, 2008 5:20 am UTC

davean wrote:It was written in 1977 and Continuation Passing Style was described in the 1960 book Compiling with Continuations by Andrew W. Appel about his work on Standard ML. This would make SSA far older then the Green Dragon Book.

CPS isn't typically used for imperative languages though AFAIK, and the adaption of it to imperative languages as SSA didn't occur until the 80s. So while SSA and CPS are deeply related, my impression (/guess) is that it wasn't apparent how to apply CPS in a useful way to non-functional languages. Anyway, the first edition doesn't have CPS or Continuations in the index.
EvanED
 
Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Compiler Book?

Postby Rysto » Thu Apr 17, 2008 6:22 am UTC

davean wrote:It was written in 1977 and Continuation Passing Style was described in the 1960 book Compiling with Continuations by Andrew W. Appel about his work on Standard ML. This would make SSA far older then the Green Dragon Book.

This argument strikes me as being rather akin to saying that Unlambda is more than 60 years old, because Turing Machines were first described in the 30s.
Rysto
 
Posts: 1443
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Compiler Book?

Postby davean » Thu Apr 17, 2008 6:26 am UTC

Rysto wrote:
davean wrote:It was written in 1977 and Continuation Passing Style was described in the 1960 book Compiling with Continuations by Andrew W. Appel about his work on Standard ML. This would make SSA far older then the Green Dragon Book.

This argument strikes me as being rather akin to saying that Unlambda is more than 60 years old, because Turing Machines were first described in the 30s.


SSA is formally equivilent to CPS. They are the same thing with different names. [kelsey95correspondence]

@article={kelsey95correspondence,
author = "Richard A. Kelsey",
title = "A Correspondence Between Continuation Passing Style and Static Single Assignment Form",
journal = "ACM SIG{\-}PLAN Notices",
volume = "30",
number = "3",
pages = "13--22",
year = "1995",
url = "citeseer.ist.psu.edu/kelsey95correspondence.html"}
User avatar
davean
Site Ninja
 
Posts: 2438
Joined: Sat Apr 08, 2006 7:50 am UTC

Re: Compiler Book?

Postby davean » Thu Apr 17, 2008 8:52 am UTC

I'm sorry, that book was NOT the book I wished to cite. That is a 1992 book that is far down the line. A quick lit review shows [Steele78] using it but has far too many citations for me to follow the line further for these purposes, especially given that I can't find several relevant looking ones online (such as possibly [WandFriedman76]).


@mastersthesis={Steele78,
author = "Guy Lewis Steele, Jr."
title = "RABBIT: A Compiler for SCHEME"
number = "AI Lab Technical Report AITR-474"
school = "MIT AI Lab"
month = "May"
year = "1978"
url = "http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AITR-474.ps.gz"
url = "http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AITR-474.pdf"}

@techreport={WandFriedman76,
author = "Mitchell Wand and Daniel P. Friedman",
title = "Compiling Lambda Expressions Using Continuations",
year = "1976",
month="October",
number="55",
institution="Indiana University, Computer Science Dept",}
User avatar
davean
Site Ninja
 
Posts: 2438
Joined: Sat Apr 08, 2006 7:50 am UTC

Re: Compiler Book?

Postby Tac-Tics » Thu Apr 17, 2008 1:43 pm UTC

davean wrote:
@article={kelsey95correspondence,
author = "Richard A. Kelsey",
title = "A Correspondence Between Continuation Passing Style and Static Single Assignment Form",
journal = "ACM SIG{\-}PLAN Notices",
volume = "30",
number = "3",
pages = "13--22",
year = "1995",
url = "citeseer.ist.psu.edu/kelsey95correspondence.html"}


Citation nee.... err. Wait. Nevermind ;-)
Tac-Tics
 
Posts: 536
Joined: Thu Sep 13, 2007 7:58 pm UTC


Return to Computer Science

Who is online

Users browsing this forum: No registered users and 3 guests