tags:

views:

227

answers:

5

Guys what are the best Online resources for learning Compiler Design ?

Would Perl be a viable language to write a Compiler ?

+2  A: 

Some things are not best learned on-line, and something of the complexity of compiler design is one of them. For a list of books on the subject, take a look at this question. I selected it more or less at random from a lot of similar questions - to get a list of them all, Google for

site:stackoverflow.com compiler design books

As for perl as a suitable language - yes, you can write a compiler in Perl, but I personally wouldn't like to try it. If I were you I'd take a look at something a bit cleaner, like Python.

anon
A: 

Did you look at the answers to this question: http://stackoverflow.com/questions/1669/learning-to-write-a-compiler

Martin Brown
+2  A: 

Rather than online, as mentioned in the above answer, grab yourself a copy of the Dragon book Compilers: Principles, Techniques, and Tools. A copy of the first edition shouldn't set you back too much.

Not sure about Perl as a language of choice for implementing a compiler though.

Rob Wells
A contrary view: the Dragon Book is a very hard read and does not cover the simplest method of compiler construction, recursive descent, in any detail. Avoid.
anon
@Neil, I'd agree that it's not an easy read but then it's not a book for reading cover to cover. It does cover lots of topics salient to compiler design though. There must be a reason this book has been the compiler bible for the number of years that it has. (-:
Rob Wells
People keep recommending it, for reasons I frankly cannot fathom. I suspect most have not read it.
anon
@Neil, true. like those people whose bookshelves are laden with programming books and when you pull one down to have a look it's in perfect unopened condition. Jees, my copy has those little post-it bookmark things coming out its arse! (-:
Rob Wells
+1  A: 

Jack Crenshaw wrote a great series on compiler construction - find it at http://compilers.iecc.com/crenshaw/ (examples are in Pascal, but still very useful).

There is also a c version floating around somewhere, but I can't find the link to it atm (someone else ported all the code in the articles into ANSI-C).

a_m0d
A: 

I originally learned perl because I thought it might have a yacc in it.

It doesn't.

While I'm sure there are modules to add this sort of behaviour, and Perl 6 looks like it might be better in this regard, you would do well to study lex and yacc (or bison) instead.

I'm still glad I learned perl, though.

Alex Brown