4 ms·
Compilers and Compiler Generators
- peregrine 15y agoWow amazing timing, just started reading the course materials at http://www.antlr.org/wiki/display/CS652/CS652+Home http://www.antlr.org/wiki/display/CS652/CS652+Home and finding them very informative. Also just purchased the PragProg book of the same author. This seems really informative and timely for me. Thanks a ton fogus!
- dlo 15y agoA compiler has both a front-end and a back-end. Both the book that is linked to by the OP and CS 652, the course you refer to, have a heavy emphasis on the front-end. Personally, I am very partial to the back-end, which involves very, very different data structures, algorithms, and theory. Once you make your way through this, I highly recommend taking a look. I would say it constitutes a different field entirely! Here is a list of some such algorithms. http://llvm.org/docs/Passes.html http://llvm.org/docs/Passes.html What boggles my mind is that some of these algorithms can be made to do useful things besides generating efficient code (which includes code that runs on several cores!), such as finding bugs and security flaws. Have fun!
- peregrine 15y agoI'm just now starting to dip my toes into the field so any advice like this is helpful. Thanks!
- raster_blaster 15y agoI just found about this page yesterday while doing a google search for various compiler books and posted it to reddit in /r/compilers, looks like it's now spreading. I'm really interested if anyone has read this book yet. I've just started and am currently reading Chapter 3. It seems as if nobody seems to recommend this book, perhaps it just wasn't noticed before? Thanks for posting to hn.
- Joeboy 15y agoAs a self taught programmer, I am puzzled by the importance people seem to put on understanding the internals of compilers. Given that I already know what a compiler is and does (at least I think I do), can somebody explain why studying compiler design is more edifying than, say, spreadsheet design?
- Chirono 15y agoCompilers are amongst the most complex programs that get written and exist at a sort of theoretical/practical junction. Compilers attract both academics, for the theory, and low-level hackers who want their language to be as fast as possible. For instance, parsing is one area that has been researched in incredible depth and the parsers that you find in modern compilers (often) reflect this research. There are also many interesting algorithms found in things such as register allocation, control flow analysis etc. Personally, I find working on compilers fascinating. If you've never written any sort of interpreter or compiler, I would recommend giving it a go. Creating a language that you actually use to program is immensely satisfying. There's also the point that if you are interested in optimisation then compilers are a fantastic place to get stuck in Optimise a part of a spreadsheet program and, well, your spreadsheet program will be quicker. But improve the code generator of your compiler and every program will be quicker!
- leon_ 15y agoyou often need parts of a compiler in other projects. be it parsers for config files, implementing your own regex engine, to evaluate mathematical expressions users put in, parsing natural language input, etc. it's nice to know some compiler theory. even as an autodidact. (which I am too) but don't worry the basic stuff is really basic. it gets only complex when you try to optimize or employ some sort of "smarter" parsing than LL(1). and for that there are bison and friends.
- regehr 15y ago"Why Take a Compiler Course?" http://blog.regehr.org/archives/169 http://blog.regehr.org/archives/169
- wglb 15y agoAnd http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html http://steve-yegge.blogspot.com/2007/06/rich-programmer-food...
- swah 15y agoThis could use some CSS - its amazing how much that impacts on feeling the material is high quality/correct/still valid.