Oh, God! "The Art of Computer Programming" quoted the famous Wang Yin's comment on TAOCP: I had long wanted to write an opinion about Knuth's The Art of Computer Programming. I didn't expect to find a similar TAOCP about Knuth as soon as I went to Amazon. I think most people who claim to have read his book or bought his book are just as a kind of bragging rights or decoration. My classmate across from me bought a set of three brand new hardcover books a few years ago, which cost more than 200 yuan. But, he never looked. I borrowed it, read a few pages, and then left it there without reading. How could I have time to watch him implement a simple linked list using machine language with 6 bits per byte! One day a junior fellow student walked in and saw the set of books on my bookshelf. He showed a sense of awe: "Dig! Senior brother! You are so awesome! You actually read such a profound book!" I was stunned. Well, not bad. This set of books will make people look at me with admiration when placed on the bookshelf. That's probably what it actually does for a lot of people. Others can help deify this set of books and deify themselves at the same time. For example, he can say: "If anyone has read Don Knuth's The Art of Computer Programming, I will hire him!" This can make him appear to be more knowledgeable than the average person who has read the book. Be a bit higher. It is said that Bill Gates did this. I doubt he has read it himself. One of the reasons I hate this book is that Knuth deliberately wrote it in the machine language of a processor called MIX. Although he designed a new processor MMIX in the new version of the book, it was a change of soup but not medicine. He believed that a "timeless" computer programming book should not use high-level languages ??because they would easily become obsolete. But he was wrong. Machine language is precisely the thing that is most likely to become outdated. Just look at how many brands of updated processors there are now. There are indeed very high-level languages ??in the world that have not become obsolete from the 1960s to the present. I predict that MMIX will be eliminated in the near future. What’s funny is that MMIX adds an “M” to MIX, which stands for Millennium. The monograph about it is also named MMIXware---A RISC Computer for the Third Millennium. A thousand years or even just a hundred years or a few decades from now, it is unclear whether computers will still be binary integrated circuits or not. Moreover, this processor is actually borrowed from other processors such as RISC II, Sparc and the like. , there is no big innovation. He printed the processor's simulation program on paper and sold it, saying: "An excellent program should be as easy to read as a good novel. An excellent programmer will win the Pulitzer Prize in the future." It's okay to write a little introductory part of computer science in machine language, but using it to write an entire book would easily make readers miss the forest for the trees. One of the most common phenomena when watching TAOCP is, "Wow! So this program can be written like this." But you don't know why it is written like that. Although some underlying reasons can be known, readers will never understand the most fundamental principles. It's like seeing every pixel in a picture clearly, but not being able to recognize that the picture is actually an acquaintance. You can see clearly where every piece on the chessboard can move, but you can't win the game. Dijkstra said computing science should not be called "computer science," just like surgery should not be called "knife science." But what does this have to do with Knuth? His book is called The Art of... Let's talk about his check... Many people took Knuth's check as something to show off. I once saw a photo of a Knuth check hanging on a Cambridge professor's homepage. Does Knuth's check really serve as bragging rights? Let me tell you, the errors I found were just typos. I didn’t expect him to give me a check. Who told him that he could type Millennium as Millenium if he was not careful when typing? Hey! When I collected enough money to pay for a meal, I wanted to go to the Bank of China to cash it and prepare to exchange the money for a big meal.
But the bank clerk told me that they had to send the check back to the United States to get the cash. The cost of doing this was much higher than the value of the check itself! So Knuth gave me some empty promises. Damn! He should have thought of it a long time ago, why didn't he transfer money to everyone's credit cards instead of using something outdated like a check! He obviously felt that no one would cash the check with his signature, and even framed it as a souvenir. Hmmm... I guess you're being ruthless~ Okay, it's a long time. Let’s take a look at this book review written by someone else. White elephant, this really expresses how I feel about this set of books. (However, I disagree with some of the reviewer's views, such as "O(n) notation is enough.") I hope there will be such public comments on the paper in the future! Dan Friedman's Story (4) - C311 When I first transferred to IU from Cornell, Dan Friedman asked me to take his graduate programming language class B521. I used the excuse that I had taken a programming language course at Cornell not to take his class. Friedman called me into his office, asked me to sit down next to him, and said to me kindly: "Wang Yin, I know you have taken this kind of class at Cornell. I also know that Cornell is a much better school than IU. But every teacher’s teaching method is different. You should come to my class. My friends and I are professors here, not because we like this school, but because our family and friends are here. "Later, because the time coincided with the course B522 of Amr Sabry (my current tutor), he specially arranged for me to sit in the undergraduate course C311, but I took the credit of the graduate course. Later I discovered that there was basically no difference in the content of the two courses, except that graduate students had more homework. In the first class, he said something that I still remember: ""The Little Schemer" and "Essentials of Programming Languages" are the reference textbooks for this class, but I never talk about the contents of my books in class. "As soon as I started, I found that this course was very different from what I learned at Cornell. Although there are some concepts, such as closure and CPS, that I have learned at Cornell, in his class, I saw a completely different side of these concepts, so much so that I felt that I actually did not understand these concepts at all before! This is because when Cornell learned these things, they were just used for homework, but in Friedman's class, I used them to accomplish practical goals, so I truly realized the connotation and value of these concepts. An example is that a few weeks into the course, we began to write an interpreter to execute simple Scheme programs. Then we perform CPS transformation on this interpreter, introduce global variables as "registers" (register), and convert the continuation generated by CPS into a data structure (that is, a stack). What we end up with is an abstract machine, which is essentially equivalent to a central processing unit (CPU) or a virtual machine (such as a JVM) in a real machine. So we actually “invented” the CPU from scratch! From here, I really understood the nature of registers, stacks, etc., and why we need them. Only then did I really understand why the von Neumann architecture was designed like this. Later, he asked us to read a paper by his good friend Olivier Danvy, describing how to derive different types of abstract machine models from various interpreters through CPS transformation. This was the first time I felt the tremendous power of programming language theory in the real world, and it also made me understand that machines are not the essence of computing. Machines can be implemented using any feasible technology, such as integrated circuits, lasers, quantum, molecules, genes... But no matter what material is used as the machine, the semantics we want to express, that is, the essence of computing, remains unchanged. And these are not all the contents of my C311.
In the second half of the semester, we started learning miniKanren, a logic programming language he designed for teaching. This language is similar to Prolog, but it removes many of Prolog's shortcomings and becomes easier to understand. The textbook is "The Reasoned Schemer" given to us for free. At the end of the book, in two pages, is the implementation of the entire miniKanren language! I learned relatively quickly, and later started tinkering with the implementation, redesigning some parts, and then adding some features I wanted. This kind of teaching gave me the ability to design logical languages, rather than just being a user. This is something that is impossible to do when learning Prolog, because the complexity of Prolog implementation will make it impossible for beginners to start and can only stay at the user stage. I'm so lucky that I listened to him and took this class, otherwise I wouldn't be where I am today. Who is the real programming language expert? Knuth once said something similar: "If you can't understand TAOCP, don't be a programmer." He is always hailed as the "god of computer science" and talks about literature in his speeches. , art, God and religion, giving people a sudden sense of mystery. He always said that programmers should learn machine language, not high-level language, because machines are the unchanging truth. But Knuth looked at this issue not from a scientific perspective, but from his own personal bias. When he saw that the development of languages ??such as Fortran, Lisp, ALGOL, Pascal, C, C++, and Java seemed to have no end, he did not understand the unchanging principles. He is not a strong person in the design of programming languages. It's quite possible that he doesn't understand lambda calculus and type theory at all, otherwise he wouldn't have designed a language as disorganized as TeX. The quality of TeX typesetting is understandable, but in 1978 he still used dynamic scoping, which had long been hated by programming language experts, coupled with other crappy designs, indicating his lack of understanding of programming language theory. In fact, TeX contains a Turing-complete extension language because Knuth adopted the suggestion of Guy Steele (the inventor of Scheme), but Knuth did not design it well. Knuth felt that machines were the immutable truth, so he insisted on writing TAOCP in machine language. But because machine language lacks abstraction, programmers cannot focus on the real problem. Using machine language to describe algorithms will make an originally simple problem appear profound and difficult to understand, as if the book will never be finished. How many people have actually seen TAOCP? I'm afraid most people will buy this set of books and just put them on their bookshelves to show off. As long as someone says that machine language is too difficult to understand, these people will say that you are not smart enough to be a programmer. In fact, they have never seen it themselves. Many people, including Dijkstra, have long seen the fact that machines are not the essence of computing. He said: "Computer science is a wrong name because it is not the science of computers, just like surgery is not the science of knives." And this is a truth that almost every programming language expert understands. In their eyes, this is no longer hearsay or personal opinion, but a fact that can be proven using logic. People who truly understand the nature of computing can design brand new hardware to meet semantic needs, rather than being controlled by the design of the processor. They can even go beyond integrated circuits and use other technologies to build machines. These all show that computing is actually independent of the machine. It doesn't matter if you have bad ideas, but if you insist on describing bad ideas as good, it will hinder the development of history. I do not deny the important contributions of Knuth and Ritchie to algorithms, typesetting, and operating systems, but since they and their admirers often mislead the public about matters related to language, I feel the need to point out some of their limitations. Linus Torvalds, Guido van Rossum, Eric Raymond, and Paul Graham also often make comments on language, which are regarded as edicts by many people, but in fact there are few insights in their remarks.
In fact, what I want to say is that most of the idols that programmers worship are not real programming language experts. I hope you don't think this is alarmist. In fact, these are things that most world-class computer scientists have known for many years.