4 ms·
This is a very long article, and it's founded on a false premise. Compilers is not an important topic because there's nothing universal you can take out of it.
by kcl 19y ago
This is a very long article, and it's founded on a false premise.
Compilers is not an important topic because there's nothing universal you can take out of it. Machine code as we know it is a pretty arbitrary construction. Register machines themselves are pretty arbitrary---they're just one way to make use of transistor circuitry. The conversion from C to machine code is not really worth remembering. It's true that this system forms the basis for all our computing, but like the nanoscale physics of semiconductors, it's not required knowledge for programmers. It's just a bag of rules...it's not even a bag of tricks.
If you work at Intel optimizing compilers, then maybe you need to know this stuff. If you never hunch down and program inline assembly, why do you care? You're too far from the bytecode to leverage compiler knowledge against performance, and in fact you'd probably be wasting your time to do so. Its workings operate below the required level of abstraction. Understand what's going on, but leave the details to someone else. I don't need to know how Firefox implements an HTML parser to render my webpage. I just need to know that it does so in a consistent way.
Compiler implementations are pretty arbitrary, and oftentimes they're filled with a lot of goofy stuff. We shouldn't still be carrying cruft like Please-Excuse-My-Dear-Aunt-Sally around in our languages---and this is half of what a compiler does. If there's anything beautiful to take out of a compilers class, it's that a compiler can compile itself. There---I've spoiled the ending, skip the course and take a theory class instead.
- palish 19y agoIt's hard to imagine calling myself a good programmer if I didn't know how to write a basic compiler.
- jey 19y agoYou're focusing on all the wrong parts: the details. It's not like Steve is saying that you'll be greatly enlightened by memorizing how the IA-64 calling convention works. Steve is referring to the skills that you'd learn from solving any large and "algorithmic" problem, with the bonus that compilers will also teach you a bit about the low-level workings of your machine. You'll learn how to represent and manipulate complex data, you'll learn what a calling convention is, what a system call is.
- abstractbill 19y agoCompilers is not an important topic because there's nothing universal you can take out of it. Machine code as we know it is a pretty arbitrary construction. Compilers have nothing to do with machine code, other than that's sometimes the output target. There are plenty of other (often more interesting) targets.
- kcl 19y agoEval in Lisp is half a page. That's not a lot of material. If you further discount machine language, the only thing left for a compiler/interpreter to do is handle eccentricities in language syntax. This is rote and arbitrary application of data structures. Rarely do I find it edifying to "undo" complexity that someone else has added, at whim, to computation.
- jonnytran 19y agoAlthough Steve Yegge brings up a lot of interesting points, he's bad at explaining them. Learning about compilers and programming languages is important because of the principles inherent in building them, which average programmers never completely get. In my opinion, these principles are: 1) Code is data, and data can be code. 2) The only sensible way to deal with unmanageably-large amounts of code is by creating a language (whether this be an API, a protocol, a DSL, or a Turing-complete programming language) to communicate with. 3) Many classes of problems can be thought of as a transformation of a data-structure in one language to an "equivalent" data-structure in another language, which at its core, is all a compiler does.
- yters 19y agoAnd a tangent on that: It's been said that algorithm + data structure = program. But really, the only true 'algorithm' is the cpu. Everything else is clever data structures. Just thought I would say...
- bayareaguy 19y agoEver find a runtime bug in your program which turned out ultimately to be a fault in the compiler? Ever have to fix it quickly without help?