Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As 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?


Compilers 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!



"Why Take a Compiler Course?"

http://blog.regehr.org/archives/169


you 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: