3 ms·
This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know o
by groovy2shoes 13y ago
This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch.
If you have never built a compiler before, I cannot think of a better place to start.
Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Principles, Techniques, and Tools by Aho, Sethi, and Ullman (which covers a lot of theory associated with front-ends) then proceeding to Modern Compiler Construction in ML by Appel (which covers some more advanced topics and back-end stuff). Then you can continue reading about more specific/advanced topics if you like.
- fusiongyro 13y agoA port of it to Python would probably be a better place to start. Not many people are conversant in Pascal these days.
- groovy2shoes 13y agoIt's easy enough to follow along. The snippets are simple enough that anyone who knows a procedural language won't have trouble understanding what they do, and from there it's pretty trivial to write the equivalent code in another language. You can get pretty close by writing C with a few helper functions.
- FedRegister 13y agoIt gives me an excuse to install Free Pascal and give it a whirl though.
- groovy2shoes 13y agoThat's the spirit!
- segmondy 13y agoThis is more specific to C, but can still be applied to other areas. I always thought it was a great read. A Retargetable C Compiler: Design and Implementation https://sites.google.com/site/lccretargetablecompiler/ https://sites.google.com/site/lccretargetablecompiler/
- SilasX 13y agoI just looked at the chapters, and it's kind of funny that it gets these accolades despite being written as a 80-char-width text-only file. Edit: I don't say that to disparage it; I actually think that's an impressive accomplishment.
- derleth 13y agoHe's lucky he had an 80-column card! ;-) http://en.wikipedia.org/wiki/Apple_80-Column_Text_Card http://en.wikipedia.org/wiki/Apple_80-Column_Text_Card
- frigg 13y agoThere is a class about compilers on coursera [1] which should be pretty good and more up to date. [1] https://www.coursera.org/course/compilers https://www.coursera.org/course/compilers
- groovy2shoes 13y agoThe class is good, but very time-consuming and spends a lot of time on theory. Expect to spend at least 10 hours a week between lectures, quizzes, and the project.
- dochtman 13y agoSeconded. My experience: Taking this course was an great way to learn more about compilers and fill a hole in my CS curriculum. Professor Alex Aiken is a great instructor and covers a good amount of material. I learned a lot about compiler construction despite having toyed with my own compiler before starting the course. The programming assignments were particularly tough, giving me useful experience in building compilers and a great sense of achievement. (TL;DR from my full blog post: http://dirkjan.ochtman.nl/writing/2012/07/21/compilers-on-coursera.html http://dirkjan.ochtman.nl/writing/2012/07/21/compilers-on-co...)
- reginaldjcooper 13y agoI've seen Engineering a Compiler get recommended as well, have you read that one?
- groovy2shoes 13y agoI have that one on my shelf. It's decent, but it doesn't cover anything that the other two don't. Compared to Engineering a Compiler, the Aho, Sethi, and Ullman book goes into more depth on the theory, and the Appel book has a better breadth of topics. It's not a bad book by any means, but I'd recommend that if you only have the cash for one book, go for the Appel book.