Nick Black Dec 07, 2007

it was amazing bookshelves: pimpin-aint-easy-but-computers-are, read-multiple-times

Recommended to Nick by: Jim Greenlee 's review

Found myself rereading this the other day, after recommending Chapter 8 to a young engineer seeking the Truth behind malloc(3)...still as fresh as the day it was printed, although I do note minor failings now (ubiquitous definitions of "MAXLINE" to 1000 rather than idiomatic use of ANSI/ISO's BUFSIZ, rather more use of "register" than I care to see in peacetime, etc). Also, when are we getting an update for C99? I'd like to see more people making proper use of <stdint.h> than is today typical.



Say what you will about C. I thought it close to perfect upon first grokkage back in that beatific summer of 1995. A year's eager detour into Prolog advocacy made absolutely clear the walls of the logical paradigm. Alexandrescu's marvelous work in metaprogramming was by that time mainstream, or as mainstream as it will ever be or need to be; for two years I became an effete C++ snob, until I realized just how poisonous it is when inflicted upon actual teams. The time was right to worship at Hindley and Milner's altars, and much joy was had hacking away in SML and OCamL -- still wonderful languages, to which I return when my code needn't, say, read or write data. But while my heart might pump pure computation, my ass rests firmly before the loom of systems programming; short-lived, sweaty, heavy-breathed infatuations with Haskell, Erlang, and most recently Scala have left indelible imprints, but only on a mind aimed like a missile at hacking UNIX applications on supercomputers--or whatever's bigger.



(I've recently developed a curmudgeonly fondness regarding FORTRAN, largely due to an absence of pointer-aliasing issues (and thus massively simplified construction of optimizing compilers). This is more due to C99's baroque restrict system than anything else, and of course an unsatisfiable impulse towards contrarianism.)



And so I return always to C, not my first but certainly my most torrid and long-affected love. It's likely the only usable language I'll ever have truly memorized in all its detail. I've dreamed in C too many nights to count -- not about discussing C, or debugging C, or writing C, but being C code and interacting with other entities as God meant us to: call-by-value reduction strategy. It is an imperfect language. Truth be told, it's in ways not even an acceptable language.



But I too am an imperfect vessel, and I've erected yet great castles in the air, from air, creating -- by exertion of the imagination -- real tools and potent effects. The greatest of these have shared one feature all: they were set down in the language of Kernighan and Ritchie, the syntactic heritage of systems programmers since the minicomputer era. Each year a few new hackers come under my wing, and more often than not it is my privilege to guide them through C's finer points. Frustration and puzzlement give way to understanding of, say, array-pointer equivalence or userspace threading via sigaltstack(2) trampolines, and in their delighted faces I see a bit of my youth...how many years spent in a phosphoric VGA glow, gnashing teeth, finally greeting sunrise with the wild-eyed exhilaration of Victory, screwing a Lucky Strike between my lips and knowing the problem has been solved? Millions of programmers around the world, thousands of epiphanies a second, synapses firing and recoiling by the trillion, transistors uncountable switching through forbidden zones from 0 to 1, all of them ordered by the principles set out in 189 pages plus appendices.



Well-played, sirs.



----



update: Dennis M. Ritchie exited with status code 0, EXIT_SUCCESS, 2011-10-13. He will be missed.