4 ms·
"In addition, there are very few things that actually need to be written in C. Operating systems and compilers are the two big areas where use of C is nearly al
by randrews 18y ago
"In addition, there are very few things that actually need to be written in C. Operating systems and compilers are the two big areas where use of C is nearly always required. Both are territory that I am not interested in venturing into at this point."
First, why is C nearly always required for writing compilers? I've written one in C and a few in higher-level languages, and the HLL ones were easier due largely to garbage collection.
Second, those two things, if learned, would teach him vastly more about computer science than just learning C. For a better understanding why, Steve Yegge's essay "Rich Programmer Food" is what you want to read.
- jrockway 18y agoFirst, why is C nearly always required for writing compilers? Because the author is clueless. Sure, you might want to compile your language down to C, but there's no point in writing the compiler in C, unless you want to make your life difficult for no good reason. Nobody cares how fast your compiler runs. (What I should say is, tokenizing the input, building the AST, and traversing the AST is going to be just as fast implemented in Lisp/ML/Perl/Ruby as it is implemented in C. Except you'll get a more correct compiler in less time. "malloc" is for chumps.) But, these days, there's no point in compiling down to C. It's much easier (and yields a potentially faster runtime) to compile to LLVM or the JVM or Parrot.
- scott_s 18y agoNobody cares how fast your compiler runs. I take it you've never written a C++ program which depends on heavy template metaprogramming.