Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know why Knuth is writing some form of C? AFAIK none of the other TAOCP contain C, or anything other than (M)MIX and pseudocode. Why change now?



I haven't watched through the whole thing, but the C code I saw from skipping through looks like it's actually the output from CWEB [1], one of Knuth's literate programming tools. It combines C source code with long-form documentation, and it can either be preprocessed to TeX (to give that nice, pretty printed document that Knuth shows in the video) or to standard C source code to compile and run.

CWEB is one of Knuth's languages of choice, and he's got tons of code written in it on his website [2], including versions of some of the stuff he's demoing on-screen.

[1] http://www-cs-faculty.stanford.edu/~uno/cweb.html

[2] http://www-cs-faculty.stanford.edu/~uno/programs.html


Knuth has been using C for quite a long time now (he has not "changed now"), and it's fair to say that he likes it, based on the following:

More than 20 years ago, knuth ported his literate programming system to C, resulting in CWEB.

Here is a 1993 interview with Knuth about CWEB: http://tex.loria.fr/historique/interviews/knuth-clb1993.html

Key quote (on the subject of C):

I think C has a lot of features that are very important. The way C handles pointers, for example, was a brilliant innovation; it solved a lot of problems that we had before in data structuring and made the programs look good afterwards. C isn't the perfect language, no language is, but I think it has a lot of virtues, and you can avoid the parts you don't like. I do like C as a language, especially because it blends in with the operating system (if you're using UNIX, for example).

I can only guess that Knuth doesn't use C in TAOCP because C isn't defined in the kind of way that he thinks is suitable for teaching. Every port of C to some given architecture has different parameters which effectively render it a different dialect, and there are undefined behaviors all over the place.




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

Search: