5 ms·
Writing a Compiler in 24 Small Steps [pdf]
- scrrr 16y ago"Compilers are perceived to be magical artifacts, carefully crafted by the wizards, and unfathomable by the mere mortals." Then everyone with a cs-degree must be immortal.
- hubb 16y agoi think you're over-estimating the abilities of the average cs grad if you believe they all understand compilers.
- philwelch 16y agoUnfortunately, Compilers is no longer a required class to get a CS degree. My (possibly flawed) understanding is that in the heyday, it was. It's really a shame, because learning about compilers applies all that stuff you're supposed to learn about languages and automata theory, gives you an excellent example of how to design a large software system, gives you insights into programming language design, and above all demystifies the process of what happens when you compile your own code.
- WalterGR 16y agoUnfortunately, Compilers is no longer a required class to get a CS degree. As with all degrees, that depends entirely on the school.
- deleted 16y ago[deleted]
- philwelch 16y agoI meant in the average case.
- WalterGR 16y agoDo you have data?
- baddox 16y agoWhat about in the worst case?
- philwelch 16y agoIn the worst case, you can go to a school that doesn't offer compilers. My school offers but doesn't require it. It would be interesting to discover the earliest CS program at a reputable university without a compilers requirement.
- baddox 16y agoMy university requires a class called "Languages and Machines." According to the instructor, it used to be two classes, "Languages" and "Computation." We started doing some language fundamentals and comparative analysis of different languages (how basic data types are implemented, structs, closures, etc.). Then we talked about various function calling conventions, beginning with a simple stack machine language and slowly building on that to support recursive calls, etc. By the end, every passing student had written non-trivial programs in at least 3 different languages, and written very simple yet enlightening implementations of the basic components of compilers (lexer/parser, AST, code generation, basic optimization, etc.). I would've preferred a full-blown compilers course, but that class was still my favorite CS class.
- scrrr 16y agoI think they should? After all it is not that much that justifies the "s" in "cs"..
- adatta02 16y agoCompilers was one of the few classes where I thought the S actually met the C in CS. I applied real algorithms I'd learned in Algorithm and data structures I had learned in Data Structures to support the theory of computation I had learned in The Theory of Computation.
- pgbovine 16y agoreally? every cs graduate has a deep understanding of compiler internals? doubtful.
- baddox 16y agoNo one said "deep." Even if all CS grads did get "deep understanding" of compiler internals, chances are that would not cover the new paradigm of dynamic languages. My point is that only the most diligent CS grad is going to be able to create or even contribute to a full-blown, widely used modern programming language.
- mdwrigh2 16y agoHere's a link to the actual pdf: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
- hubb 16y agothe paper's been discussed at least once before on hn: http://news.ycombinator.com/item?id=1408241 http://news.ycombinator.com/item?id=1408241
- paulsmith 16y agoThat paper is pretty interesting, but is just an overview of the actual tutorial on writing the compiler, which is here: http://www.cs.indiana.edu/~aghuloum/compilers-tutorial-2006-09-16.pdf http://www.cs.indiana.edu/~aghuloum/compilers-tutorial-2006-... Unfortunately, the tutorial seems to be in a draft state, with a good amount content still needing to be written ("FIXME"s throughout).