Skip to main content
gamedev.net
🔒 Locked

Compiler Design

Started by sakky 12 replies 600+ views
Original Post
sakky
sakky
I''m searching around for building compilers and I found with book. Its called Compiler Design in C, by Allen I. Hulub. Have any of you heard of this book. I just started reading it and it has already revealed alot to me. The first few pages in chapter 1 start talking about the compiler structure. This is intresting, This book says that some compilers don''t have preprocessors; others generate ASM code in a second pass, optimize the ASM code directly, and don''t have a forth pass. Others generate binary instructions directly, with out an ASCII intermediate language ( ASM ). I would like to play around and make a goofy little programming language that runs a run time, like Java. Some real simple to have run and learn with.
Take back the internet with the most awsome browser around, FireFox
daerid
daerid
If you''re really interested in Compiler design, get the Dragon Book (Compilers: Principles, Techniques, and Tools). It''s hardback, about $80, but it''s the compiler bible.
daerid@gmail.com
sakky
sakky
I''m looking for that book, but I need more information: author, title, and so on. Were I can get it cheap; if not amazon.
Take back the internet with the most awsome browser around, FireFox
Oluseyi
Oluseyi
Author: Aho and some others. (Aho is the "A" in "Awk"; Kernighan - of K & R fame - is the "K").
Title: Compilers: Principles, Techniques and Tools. Also see Compilers: Principles and Practice (aka Son of the Dragon Book).

You might be able to find it (or them) in the public library, and definitely in a university library (so long as they have a CS program).
OctDev
OctDev
Just to reiterate, get the dragon book. It trully is THE reference for compiler design and development.

The Tyr project is coming...
The Tyr project is here.
Hippokrates
Hippokrates
I have got a question on the Dragon Book.
Will it teach me how to actually build a working compiler or will it just the general principles and techniques (feturing pseudo code...) ?
Im Anfang war die Tat...Faust
Oluseyi
Oluseyi
There are things called book reviews and publisher websites... And you don''t have to wait until someone feels willing/capable to answer your question.

Anyway, the Son of the Dragon Book contained a lot of code for implementing a Pascal compiler (I last looked at it in ''97 or ''98). I''ve never read the Dragon Book, and choose a more implementation-oriented text from the library a week ago (which, incidentally, also builds a Pascal compiler, among others). The book I borrowed is called Writing Compilers and Interpreters.
paulmason
paulmason
Apart from the Dragon Book, I particularly like ''Programming Language Processors in Java: Compilers and Interpreters'' by David A. Watt, Deryck F. Brown, Deryck Brown, ISBN: 0130257869

see: http://www.amazon.com/exec/obidos/ASIN/0130257869/002-8432514-2450437#product-details

It''s a good beginner book that takes a practical approach to compiler development, and is easy to follow even if you aren''t using Java.

Paul
sakky
sakky
After reading into alot of the basic ideas with this book, making a compiler dons''t seam to hard. My book makes frequent references to Flex and Bisonm, with some documentation about them. So all in all, it seams like so far, the book is a good tutorial.

I like Java. But I would realy like to get into computer science. I would like to, if not make, at least come close to inventing my own C/C++ like language.
Take back the internet with the most awsome browser around, FireFox
dMDI
dMDI
If you like Java, use SableCC, it is much nicer than most compiler compilers out there, and comes with lots of examples too. http://sablecc.org
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein
spock
spock
Sounds like you might be interested in A Retargetable C Compiler: Design and Implementation. This book explains the details in the implementation of LCC, a complete ANSI C compiler with back-ends for several platforms including x86. It's a pretty good book if you want to see actual implementation concerns and issues, although some of the methods used are a bit old-fashioned.

But if you only buy one book on compiler design/construction, by all means go for the Dragon book. You need to understand the theory behind this stuff well.

[edited by - spock on October 3, 2002 8:36:28 AM]
spock
spock
quote:
Original post by daerid
get the Dragon Book (Compilers: Principles, Techniques, and Tools). It's hardback, about $80, but it's the compiler bible.


Actally, a cheaper paperback edition do exist (or at least did when I bought it): the Addison-Wesley "World Student Series Edition". It's an unabridged reprint, but I don't think it is available in the US.

[edited by - spock on October 3, 2002 8:33:47 AM]
Redleaf
Redleaf
I glanced over "Compiler Design in C" in my library recently when I went to pick up the Dragon book that everyone was recommending. It seems to be focused a bit more on the practical building of a compiler, while the Dragon book focuses heavily on the theoretical aspect. It looked good, however, and is a little more recent than the Dragon book.

Perhaps you should start with one, and then read the other? They''re gigantic books, but this is what I intend to do myself.

"Don''t be afraid to dream, for out of such fragile things come miracles."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.