Slashdot Mirror


Knuth Releases Another Part of Volume 4

junge_m writes "Donald Knuth has released another of his by now famous pre-fascicles to Volume 4 of his epic: Pre-fascicle 2c is all about 'Generating all Combinations' supplementing his pre-fascicles 2a and 2b. Furthermore he challenges us all to do more of his daunting exercises and report our success. He thinks we are way too lazy in this respect! So come on slashdot crowd: Do your homework and get the credit from the grandmaster himself!"

33 of 248 comments (clear)

  1. Tshirts by bsDaemon · · Score: 3, Funny

    anyone else think ThinkGeek.net needs some 'Absolut Knuthingness' tshirts?

  2. A series of books like this for higher lvl coding? by ovapositor · · Score: 5, Interesting

    The main reason that I have been hesitant to purchase and slog through these books has been the fact that they are written with an outdated assembly language for a non existant processor. I realize that the point is to learn these algorithms, however, since I rarely if ever code on that level any longer, is there an alternative? Something using a language like Java, Python, or even, ack! , 'C' would be more to my liking.

    No flames please. This is just an honest question.
    Thanks

  3. I thought it was a good trait... by BomberMonkey · · Score: 4, Funny

    Technically, all programmer types are supposed to be lazy. Personally, I try to keep my code clean and commented because when I come back to it in a month, I know I'll be too lazy to read through it and figure out what I was doing. Also, being lazy aboud doing work is what leads to reduced algorithmic complexity, right?

    Necessity is the mother of invention, but laziness is the father.

    1. Re:I thought it was a good trait... by Zathrus · · Score: 3, Insightful

      Most programmers are lazy. I know I am. I know the other (senior) coder on our current project is. But it's a controlled laziness.

      Being lazy means that instead of doing something "manually" we'll find some way to make the computer do it for us. Sure, doing it by hand may only take 5 minutes and we'll spend 15 minutes just trying to convince the computer to do it, but that's not the point. The point is that - 1) you just learned something new, 2) you avoided doing a repetitive task repeatedly (yes, yes, I know), 3) odds are you'll do the same damn thing, or something similar in the future, and then you'll know how to do it in 3 seconds.

      Which is why programmers gravitate to complex but programmable tools, like vi/vim/emacs/ultraedit, to Unix, to scripting languages, etc.

      It's also why we don't understand the user more often then not. Most users just want to get the job done. Sure, there may be a more efficient way to do it if you spend some time learning the system, but they either don't view the system as their job or have been burned by it too many times to trust it. So they do things the way they know, or the way they think it should work. Which is often not the way the lazy programmer thinks.

      Laziness does have downsides though. Documentation tends to be banal. Comments are almost never as good as you'd like them to be 3 months later. And while algorithmic simplicity is a noble goal, it's often the wrong one - too simple of an algorithm can be wasteful of resources (bubble sort is a whole lot simpler than quicksort) simply because the programmer didn't learn the underlying hardware or didn't think through the implications of a design. Which leads to the issue of too simple of a design meaning massive rework as the system grows.

      Of course the more experienced programmers have learned these things and discovered that spending the time up front means you can be lazier in the long run.

      Knuth is one of these experienced programmers. There are gems of wisdom throughout his writings.

      Wish the bastard didn't want us to work to find them though.

  4. too lazy by gripdamage · · Score: 4, Funny

    He thinks we are way too lazy in this respect! So come on slashdot crowd: Do your homework and get the credit from the grandmaster himself!

    No no no... He's right [yawns, stretches, checks for new /. articles].

  5. For the ignorant... like me! by Nomad7674 · · Score: 4, Informative
    I hope I am not the only one who read that introduction and had the monosylabbic response, "Huh?" For any others like me in serious need of some explication, first the definition of "fascicle" from dictionary.com:

    fascicle Pronunciation Key (fs-kl) n.

    1. A small bundle.
    2. One of the parts of a book published in separate sections. Also called fascicule.
    3. Botany. A bundle or cluster of stems, flowers, or leaves.
    4. See fasciculus.

    I believe the definition used here is #2.

    Second, a quick definition of what this is all about: it appears to be a collection of great scientific and programming works to be used as a primer for new programmers.

    Hopefully, that allays some of the confusion I was having among others out there.

  6. Re:A series of books like this for higher lvl codi by biglig2 · · Score: 5, Insightful

    Knuth's own reply to this question can be seen at http://www-cs-faculty.stanford.edu/~knuth/mmix.htm l.

    To quote:

    "Many readers are no doubt thinking, 'Why does Knuth replace MIX by another machine instead of just sticking to a high-level programming language? Hardly anybody uses assemblers these days.'

    Such people are entitled to their opinions, and they need not bother reading the machine-language parts of my books. But the reasons for machine language that I gave in the preface to Volume 1, written in the early 1960s, remain valid today:

    One of the principal goals of my books is to show how high-level constructions are actually implemented in machines, not simply to show how they are applied. I explain coroutine linkage, tree structures, random number generation, high-precision arithmetic, radix conversion, packing of data, combinatorial searching, recursion, etc., from the ground up.
    The programs needed in my books are generally so short that their main points can be grasped easily.
    People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird.
    Machine language is necessary in any case, as output of many of the software programs I describe.
    Expressing basic methods like algorithms for sorting and searching in machine language makes it possible to carry out meaningful studies of the effects of cache and RAM size and other hardware characteristics (memory speed, pipelining, multiple issue, lookaside buffers, the size of cache blocks, etc.) when comparing different schemes.
    Moreover, if I did use a high-level language, what language should it be? In the 1960s I would probably have chosen Algol W; in the 1970s, I would then have had to rewrite my books using Pascal; in the 1980s, I would surely have changed everything to C; in the 1990s, I would have had to switch to C++ and then probably to Java. In the 2000s, yet another language will no doubt be de rigueur. I cannot afford the time to rewrite my books as languages go in and out of fashion; languages aren't the point of my books, the point is rather what you can do in your favorite language. My books focus on timeless truths. "

    --
    ~~~~~ BigLig2? You mean there's another one of me?
  7. Well, actually by Subcarrier · · Score: 4, Funny

    256 equals $100. We're being shafted.

    --
    "I have opinions of my own, strong opinions, but I don't always agree with them." -- George H. W. Bush
    1. Re:Well, actually by Subcarrier · · Score: 3, Insightful

      256 pennies would be 100 hex cents, not 100 hex dollars.

      Not quite. 256 *anything* equals $100. Several symbolic assemblers represent hexadecimals with a $ prefix. This has nothing to do with money. Claiming that the number is in fact a fixed point decimal representation is just semantics, not visible in the assembly code.

      Just to make it completely clear. ;-)

      --
      "I have opinions of my own, strong opinions, but I don't always agree with them." -- George H. W. Bush
  8. This guy is hard core by peterdaly · · Score: 4, Funny

    I just looked this author up at Amazon. Here is some of his previous work:
    The Art of Computer Programming, Volumes 1-3
    From the Inside Flap
    "The bible of all fundamental algorithms and the work that taught many of today's software developers most of what they know about computer programming."-- Byte, Sept 1995

    "If you think you're a really good programmer,...read [Knuth's] Art of Computer Programming....You should definitely send me a resume if you can read the whole thing." -- Bill Gates


    This does not sound like it is aimed at the core slashdot crowd, based on the Amazon reviews I am reading. Honestly I have never heard of the guy before. He is without a doubt more for the "hard core" among us. Volume 1 seems to have been written in the 1960's, so this guys been at it a while.

    Plenty of reader reviews. Many with comments like:
    This timeless classic is bound to make the student (Yes you ought to be a dedicated one..no casual reading here!) proficient in the art and science of constructing programs. -Ganapathy Subramaniam

    Be prepared for your brain to do some crunching if you really want to get into this guys work.

    -Pete
    (amazon affilate like to the book...just so ya know.)

    1. Re:This guy is hard core by Mr+Guy · · Score: 5, Insightful

      He is beyond hardcore. To explain Donald Knuth's relevance to computing (and geeks should all know who he is) is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.

      Reading the Art of Computer Programing is like translating the Bible from the original greek. You know there is something profound there, but until you've done it a few times and looked back on it, you are more concerned with trying to figure out each word.

      I'm a little awestruck by him.

      By the way, the Paul reference is not a flippant one, check out his other books,Things a Computer Scientist Rarely Talks About , and 3: 16: Bible Texts Illuminated, for explanations of why not every christian is a fool.

    2. Re:This guy is hard core by devonbowen · · Score: 4, Interesting

      Wow. No flame intended, but I never expected to hear Knuth called "this guy". For those that don't know the name, here are a few others you might want to check out: Turing, Minsky, Church, Shannon, Chomsky. Of course, these are just the "theory" guys and I am sure others will add to that list. Seems to me any geek should have at least a Readers Digest knowledge of who these people are and what they've done for us.

      Devon

    3. Re:This guy is hard core by Goonie · · Score: 3, Interesting
      John Von Neumann, S.A. Cook (describing NP-completeness was pretty damn cool), Ken Thompson and Dennis Ritchie, Vannevar Bush, Doug Engelbart...

      There are many others, but that's a good start.

      --

      Any sufficiently advanced technology is indistinguishable from a rigged demo
      --Andy Finkel (J. Klass?)
  9. use GCC by johnjones · · Score: 5, Informative

    just code it in C and then use gcc targeted at mmix to see the assembly and compare them with what he wrote(some of the time it wont be the same if ever because of register alocation but you get the point)

    regards

    john 'mips64' jones

  10. Re:A series of books like this for higher lvl codi by gripdamage · · Score: 5, Informative

    It's still probably helpful to know where you can obtain and learn to use a MIPS VM. Check out the GNU MDK manual Contains the MIX instruction set and a programming tutorial, as well as documentation on using the VM itself.

    For the intro:

    In his book series The Art of Computer Programming (published by Addison Wesley), D. Knuth uses an imaginary computer, the MIX, and its associated machine-code and assembly languages to ilustrate the concepts and algorithms as they are presented.

    The MIX's architecture is a simplified version of those found in real CISC CPUs, and the MIX assembly language (MIXAL) provides a set of primitives that will be very familiar to any person with a minimum experience in assembly programming. The MIX/MIXAL definition is powerful and complete enough to provide a virtual development platform for writing quite complex programs, and close enough to real computers to be worth using when learning programming techniques. At any rate, if you want to learn or improve your programming skills, a MIX development environment would come in handy.

    The MDK package aims at providing such virtual development environment on a GNU box. Thus, MDK offers you a set of utilities to simulate the MIX computer and to write, compile, run and debug MIXAL programs.

  11. rats! by cowtamer · · Score: 5, Funny

    I was actually hoping for this.

  12. Don't have a postscript viewer? by apirkle · · Score: 4, Informative
    For you poor saps running Windows with no viewer for Postscript, there is a great online viewer that converts ps, pdf, and word docs to gif images, suitable for viewing in your favorite web browser.

    Cached version of the Knuth document is here.

    1. Re:Don't have a postscript viewer? by red_crayon · · Score: 3, Insightful

      I would suggest rather getting ghostscript for Windows, the free PostScript interpreter, and also GSview, a viewer (the latter requires the former).

      Ghostscript is free as in speech, with a GNU release and a release under AFPL, a slightly different license (the GNU code is older than the AFPL code). GSview is available, as far as I can tell, under the AFPL only, which is still free but not GPL.

      With both of these properly installed on Windows, one click on the link provided by Slashdot will launch the viewer. (It must gunzip on-the-fly.)

      --
      "Never bullshit a bullshitter" All That Jazz
  13. Re:A series of books like this for higher lvl codi by cduffy · · Score: 3, Informative

    In addition to Knuth's response (given by another poster), let me add that the assembly language used does not, in practice, detract from the usefulness of the books -- and if one wishes, transcribing any of his algorithms from MIX or MMIX to C is child's play and can be done in ones' head while reading them; changing code from MIX or MMIX to an assembly language for real hardware is similarly easy -- a design goal of both.

    Further, while MIX may well be showing its age, Knuth's newer MMIX assembly language is anything but outdated; its features should map well to new processors released for years.

  14. Finally by gillbates · · Score: 3, Interesting

    I was a junior in college when I first read The Art of Computer Programming, and it really opened up my mind to what computer science is all about. It challenged me to think outside the HLL box. Knuth's work has become a timeless classic because he concentrates on the higher level concepts of computer science that transcend the currently popular architectures.

    What really blew me away about Knuth's work is that he implements all of the features found in modern HLL's in his own variant of assembler. Someone who can work through and solve the exercises in his books will find themselves able to write programs in any language, and write them well at that. He does not concern himself with the Language Wars, or the Platform Wars, but instead presents the problems and solutions which are common to all computer systems. Too many programmers have been babied intellectually by their colleges and universities, which taught them how to program in a high level language rather than teaching them the fundamentals underlying computer science. Knuth does a good job in getting down to the underlying problems of computer science without bothering the user with the details of arcane architectures that will soon be obsolete.

    For this reason, I look forward to his forthcoming work. I look forward to the new challenges which will expand my mind even farther.

    --
    The society for a thought-free internet welcomes you.
  15. TeX by mikeee · · Score: 5, Interesting

    My favorite Knuth quote, when he gave a class a snippet of code to use in their program (not verbatim, sorry):

    "Be careful with this code; I have only proven it correct, not tested it."

    A demonstration of Hacker Nature:

    He wasn't happy with the typesetting on his first book, and decided this should be done by computer, so he wrote a markup language for typesetting.

    Of course, he wanted to do it right, so this took him... well... about a decade. And when he was done, he had written TeX. He was very pleased; his publishers thought this was odd, as the new typesetting looked worse than the old.

    A few years later, high-resolution laser printers became available; TeX already suppported them, and lo and behold, the new version did look better.

    TeX is a huge monster of a programming language/application. Knuth offered a cash prize of $(2^N) for the Nth unique bug report. TeX is now, like, 20 years old, and that system cost him under $1K.

    If programmers were Jedi, he would be Yoda.
    If programmers were wizards, he was be Gandalf.

    He is the serious, friendly grandfather who can kick the butts of all us whippersnapers. So pay attention!

    1. Re:TeX by crsm · · Score: 5, Interesting

      TeX is a huge monster of a programming language/application. Knuth offered a cash prize of $(2^N) for the Nth unique bug report. TeX is now, like, 20 years old, and that system cost him under $1K.

      Take a look at the version number of TeX: 3.14159 ('tex --version'). Each release adds a new digit towards Pi and someday when he dies the release number will be bumped to be exactly Pi. After that every new bug will be declared a feature :-) Another program of his (the name escapes me) progress the in the same way towards the base of the natural logarithm e.

    2. Re:TeX by red_crayon · · Score: 5, Informative

      Another program of his (the name escapes me) progress the in the same way towards the base of the natural logarithm e.

      That would be METAFONT. It's a companion program to TeX, for making fonts.

      --
      "Never bullshit a bullshitter" All That Jazz
  16. Strange Instruction - SRI?? by 2g3-598hX · · Score: 3, Funny

    I was poking around Knuth's site, looking at the instruction set for MMIX , when I came across this instruction (SR, SRU added for comparison):

    3C SR shift right (1) rA
    3D SRI Stanford Research Institute (2) rA
    3E SRU shift right unsigned (1)


    What's that do then?

    1. Re:Strange Instruction - SRI?? by tempmpi · · Score: 3, Interesting

      It's a joke. It is "shift right immediate". Knuth always includes some hidden jokes in his books.

      --
      Jan
    2. Re:Strange Instruction - SRI?? by maxwell+demon · · Score: 3, Funny
      Isn't it clear? It sets up an internet connection to the Stanford Research Institute, and using the MMIXIEP (MMIX Internet Execution Protocol) it sends its arguments there, and waits for transmission of the result. After the result was transmitted, the Internet connection is shut down.

      It's indeed one of the most complex instructions ever found in a CISC processor. What Stanford returns as value is a well-hidden secret. There are certainly rumors about it being related to a right shift, but probably those came up just because of the irrelevant fact that this instruction is placed in between two right shifts. Don't get confused by this. It's just coincidence. Really. And of course it's also unrelated to the instructions SLI (shift left immediate (2) rA) and SRUI (shift right unsigned immediate (2)). It's tempting to think different, but it really doesn't mean anything.

      Warning: Don't use this instruction unless you are absolutely sure the arguments don't contain security relevant or confidential data!

      --
      The Tao of math: The numbers you can count are not the real numbers.
  17. Re:A series of books like this for higher lvl codi by HiThere · · Score: 3, Interesting

    Knuth is entitled to his opinion. It is certainly true that compilers tend to hide the details of the execution. And translating the prior volumes would be a lot of work, so for stylistic consistency it makes sense to continue to use MIX.

    That said, I feel it's a mistake. I have seen a large subset of C that was implementable via macros as a M68000 assembler language program. This would be a vehicle that would possess all of the virtues of MIX, while being readily understandable by most skilled programers. (They might not be able to compose in it without study, but they could understand algorithms written in it with reasonable ease.) In addition, the timings would be experimentally verifiable (if you could lay your hands on an old Mac ... either the Mac 128 or the Fat Mac [512K]). I forget whether the code was presented in Byte or Dr Dobbs. Byte I think. I'm sure it could have been done better, but it wouldn't need to be done better to provide experimental backing to the theoretical arguments. (I suppose that in a sense the MIX virtual machines also provide this, but I don't consider them any better in principle that any other interpreter, and less good than a compiler.)
    N.B.: If you don't insist on an actual hardware version of the machine, such as would be provided by the 68000, then I still don't see any advantage of MIX over a selected subset of C.

    Additionally: MIX doesn't have much similarity to a recent-generation CPU chip. There are a multitude of reasons that Assembler has fallen out of fashion. Lack of portability was one of the major ones. But an even better reason has been the increasing complexity of the chips themselves. Hand-optimizing has become increasingly counter-productive for most people. (It's also become generally less necessary, but that's a separate argument.)

    As always, however, there will be exceptions. There exist specialists who need this kind of skil, CPU version dependant though it be. Somebody needs to design the chips. Somebody needs to desigh the compiler optimization strategies. But even for these people, MIX will be a suboptimal choice.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  18. Re:A series of books like this for higher lvl codi by Reality+Master+101 · · Score: 5, Funny

    A friend of mine suggested printing post-it notes with Java code to paste over MIX code in the tAoCP.

    Suggesting that Knuth should implement his algorithms in Java is the strongest argument for MIX I've ever heard.

    --
    Sometimes it's best to just let stupid people be stupid.
  19. Re:Paying people to find bugs doesn't cost him by Skim123 · · Score: 3, Funny
    That translation of the first German article is hilarious in some spots:

    But I write my books at a PC with 600-MHz-Athlon, which I assembled last year with the help of a friend.

    c't: Under Linux?

    Knuth: Yes.

    c't: No Windows?

    Knuth: Around sky sake, no! Until that always gebootet...

    :-)
    --

    I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

  20. Right on! by A+nonymous+Coward · · Score: 4, Insightful

    Too too many programmers think a line of code is a line of code. They think strcat is just hunky-dory, and append great gobs of strings this way, without realizing that each append traverses the entire string from the beginning each time. They use malloc and free, new and delete, with abandon, not realizing how much they are thrashing the malloc heap, when local variables on the stack would do just as well 99% of the time.

    They DO NOT UNDERSTAND the concept of finite resources, that machine cycles cost time.

    I believe the first programming course should be a very few weeks of something akin to LOGO, or BASIC, just to get the concept of bugs and such out of the way, weed out those who can't stand thinking. Then a good grounding in a z80 or some other simple 8 bitter, where counting cycles and bytes is part of the course (learn how expensive those cute index registers really are). Only then, when an understanding of machine cycles and bytes has been established, should students move on to a higher level.

    Too many ivory towers out there, too many straight-A-can't-tie-their-shoelaces types.

  21. Re:Does anyone besides me... by silentmusic · · Score: 3, Interesting

    I think that you just don't like his style.

    I'm not sure what your point is about Feynman taking time out to play in a band - Knuth takes time out to play the organ if that makes a difference to you.

    Given the contents of his books, don't you think that Knuth expresses a significant amount of respect for his readers? Name another author who gives cash rewards for reporting problems with books, or even for offering suggestions for improvements. You might think that this is ego driven since the majority of the checks aren't cashed, but this is a choice made by his audience and not by Knuth himself.

    ---

    --

    Things are not as they appear, nor are they otherwise.

  22. Re:TeX SuX by cduffy · · Score: 3, Insightful

    If you'd been around when TeX came out, you wouldn't be saying that. If you were serious about preparing math-heavy documents, you wouldn't be saying that.

    What do you consider a good system now -- docbook? If so, remember that your docbook renderer uses TeX as its backend. If you consider (say) Word a good document preparation system, you have no room to speak on the subject.

    TeX is an amazingly reliable, high-quality piece of software -- I doubt that anything on its scale has ever been created with as few bugs. Yes, the input syntax is a bit dated -- but in its day, it kicked ass. No doubt if Knuth were doing it today, it'd kick ass by modern standards as well.

  23. Re:TeX SuX by jaoswald · · Score: 3, Interesting

    Yes, TeX was quite an achievement. Stable, wonderfully un-buggy, most definitely. Unfortunately, it was good enough to catch on and establish itself before its flaws could be fixed.

    My particular take:

    1) The Computer Modern fonts are not very pretty unless you have a very high resolution typesetter; even then, the letters look too thin and spidery for my taste. Sure, you can use other fonts. But most users never do, or use even uglier ones, usually sticking with Computer Modern for the formulas. Do any other really complete and compatible math fonts even exist?

    2) The programming features were hacked on as an afterthought. The syntax is fine, perhaps even near optimal, for straight mark-up, but for developing actual algorithms, it makes Perl code look self-explanatory. Right up there with Intercal. This means that packages like LaTeX or formats are very hard to modify or extend in any kind of robust way. So everyone uses the default format, borrows one that works from somebody else, or works very hard to roll their own. Making even slight adjustments or fixes is a real nightmare.

    3) The whole TeX program is terribly monolithic. Sure, the text description and commentary talks about various stages of TeX, but the code says otherwise. Knuth's optimization of the "inner loop" means there is no intermediate description of the TeX syntax.

    The program itself was written in very low-level Pascal. The data structures are defined in terms of byte layouts, with explicit memory management. All sorts of tricky details insinuate through the code. Sure, it runs great even on 1980-era machines, but God help you if you want to re-implement it in a modern high-level language. As far as I know, this has only been done using web2c, which is a hack specially made to translate TeX. What's going to happen when C compilers are as rare as Pascal compilers are today?

    4) Likewise for the file formats. Laid out with great care, byte-for-byte. Easy to read, but tough to translate into something higher-level.

    My part-time project/dream is a modern re-implementation, where the TeX typesetting algorithms are embedded in a modern (Common Lisp) environment--so you can code TeX formats and macros in a heavy-duty honest-to-god programming language, and have an high-level, truly modular implementation using real data structures that could actually be tweaked and modified to do even funkier typesetting tasks.

    Part of me says this will be easy, because something like 60% of TeX: The Program is doing stuff like memory management that Lisp will do for free, and accounting for funky character encodings (EBCDIC and 6-bit Pascal character sets) that probably can be ignored now that almost everyone is now in ASCII, or headed toward Unicode. The other part of me says this will be difficult for exactly the same reason.