Paul Graham: Revenge of the Nerds, Part 1

    We continue to translate Paul Graham's essay and book Hackers and Artists.
    Original - Revenge of the Nerds
    (who wants to join the translation - write to the PM)

    Thank you for translating Yana Shchekotova.
    May 2002

    “We chased C ++ programmers. We managed to drag a whole bunch of them halfway to Lisp. ”
    Guy Steele, co-author of the Java specification.


    imageIn the software business, there is an eternal struggle between scientists who are armed to the teeth with knowledge, and another, no less formidable force, bosses, who have one complete ignorance in their arsenal (* in the original pointy-haired boss - the character of Scott Adams's Dilbert comic book series, is not educated and a complete lack of basic knowledge of the area he manages). After all, everyone knows what kind of animal it is? I believe that most people in the technology world not only recognize this caricature character, but are also familiar with the real person from their company, from which this image is copied.

    An ignorant boss miraculously combines two qualities that are quite common in themselves, but rarely when combined in one person: (a) he knows absolutely nothing about technology, and (b) he always has the strongest beliefs in to any question concerning them.

    Suppose, for example, you need to write some program. Your ignorant boss has no idea how it should work, and cannot distinguish one programming language from another, and yet, he knows what language you should write this program in. Namely, he believes that you should write it in Java.

    Why does he think so? Let's see what is happening at this time in the head of the chief profane. What he thinks looks like this. Java is the standard. I know this should be, because I constantly read about it in the media. Since this is a standard, I will not have problems due to its use, which also means that there will always be a bunch of Java programmers. Therefore, if the programmers working for me now quit, since all the programmers working for me always do this for some mysterious reason, I can easily replace them.

    Well, that doesn't make sense. But this is all based on one unspoken assumption, which is actually false. Such a boss believes that all programming languages ​​are quite similar. If that were the case, he would have hit the nail on the head. If all languages ​​were interchangeable, then of course, any language that others use could be used.

    But all languages ​​are different, and I believe that I can prove it to you without unnecessary details about their differences. If you asked the head in 1992 what programming language the program should be written in, he would no doubt answer as he does today. Software should be written in C ++. But if all languages ​​are equivalent, then why should the opinion of the authorities change at all? That is, why should Java developers even have to worry about creating a new language?

    Apparently, if you are creating a new language, it is only because you think that it is, in some way, better than what people already have. Indeed, Gosling makes it clear in the first official Java documentation that that (the Java programming language), in turn, was created to solve some C ++ problems. And here you are. Not all languages ​​are equivalent. If you follow the train of thought in the head of our boss to Java and vice versa, through the history of Java to its origins, you will have a hunch that goes against the assumption with which you started.

    So who is right? James Gosling, or our ignorant boss? No wonder Gosling is right. Some languages ​​are better than others for specific tasks. And, you know, this raises a number of interesting questions. Java was designed to be the best for a range of tasks compared to C ++. What tasks? When is it better to use Java, and when is C ++? Are there situations where other languages ​​are better than these.

    As soon as you begin to think about this issue, you will find yourself in a confused situation. If the boss had to think about tasks comprehensively, his brains would explode. As soon as he defines all programming languages ​​as equivalent, all he needs to do is choose one that will have the most powerful pace of development. And, because it is more a matter of fashion than technology, even he is likely to be able to get the right answer. But if the languages ​​are different, he suddenly has to solve two systems of equations, trying to find the optimal balance between two things that he knows nothing about: the relative acceptability of 20 or so leading languages ​​for the problem that he needs to solve, and the complexity of the search programmers, libraries, etc. for each of them. If this is what lies behind the door, no wonder

    The lack of conviction that all programming languages ​​are equivalent is that this is actually not the case. But the advantage is that it greatly simplifies your life. And I think this is the main reason why this belief is so widespread. So convenient .

    We know that Java should be pretty good, because it is a new, modern programming language. Is it so? If you look down on the world of programming languages, it will seem that Java is the latest innovation. (If you look from a sufficiently long distance, all you can see is a large radiant billboard paid by Sun.) But if you look at this world from a fairly close distance, you will find that there is some degree of this coolness. There is another language in the hacker subculture called Perl, which is considered much cooler than Java. The Slashdot site, for example, is generated in Perl. I do not think that you would see how these guys use Java Server Pages. But there is another, newer language called Python, whose users try to look down on Perl, but that’s alsonot everything yet .

    If you look at these languages ​​in this order of Java, Perl, Python, you can notice an interesting scheme. At least this scheme is noticeable if you use Lisp. Each of them is more and more like Lisp. Python even copies features that many Lisp programmers mistake for. One could line by line translate simple Lisp programs into Python. It's 2002, and programming languages ​​are almost equal to what was developed in 1958.

    Keeping up with mathematics

    What I want to say is that Lips was first discovered by John McCarthy in 1958, and popular programming languages ​​are only now picking up ideas that he was developing at that time.

    So how can this be? Doesn't computer technology change very quickly? I just want to say that in 1958 computers were giants the size of a refrigerator with the power of processors like wrist watches. How could such an old technology remain relevant, not to mention surpassing the latest developments?

    I will tell you how. This is because Lisp, in fact, was not developed as a programming language, at least not in the sense that we understand today. What we mean by a programming language is what we use to tell the computer what to do. McCarthy, in the end, planned to develop a programming language in this sense, but the Lisp we came to was based on some separate work of his own, purelytheoretical , - an attempt to identify a more convenient alternative to the Turing machine. As McCarthy later said:

    “Another way to show that Lisp is more accurate than Turing machines is to write a universal Lisp function and show that it is shorter and more understandable than describing a universal Turing machine. Such was the Lisp function eval ... which computes the value of the Lisp expression .... The eval description required the creation of a notation that represents Lisp functions as Lisp data, and such a notation was developed for the study itself, without thinking that it would be used to express Lisp programs in practice. ”


    And then this happened. Some time later, at the end of 1958, Steve Russell, one of McCarthy's graduate students, looked at the definition of eval and realized that if he translated it into machine language, the result would be an interpreter for Lisp.

    It was a big surprise in those days. And here's what McCarthy later said in an interview about this:

    Steve Russell said: “Listen, why don't I program this eval function.” And I answered him: “Ha, you confuse theory with practice. This eval function is intended to be read, not calculated. ”But he continued with his work and did it. Thus, he compiled the eval function from my work into IBM 704 machine code, fixed the errors, and then presented it as an interpreter for Lisp, which it actually was. Thus, from this point of view, Lisp possessed basically the form that it has today ...


    Suddenly, I believe, in a few weeks, McCarthy discovered that this purely theoretical event was transformed into a real programming language, and even more powerful than he had expected.

    Thus, a brief explanation of why this language of the 1950s is not considered obsolete is the fact that its foundation was not technology, but mathematics. After all, mathematics does not have an expiration date. It would be more correct to compare Lisp not with 1950 equipment, but, say, with the quick sort algorithm, which was discovered in 1960 and is still the fastest general-purpose sort algorithm.

    There is another language that has survived from the 1950s, Fortran, and it represents the opposite approach to language development. Lisp was a theory that suddenly turned into a programming language. Fortran was originally developed as a programming language, but, as we would now evaluate, as a low-level one.

    Fortran I , developed in 1956, had a completely different berry field, unlike the current Fortran language. Fortran I was more of an assembly language with mathematics. In a way, it was weaker than the newer assembly languages. For example, it lacked subroutines, only jump operations. Modern Fortran is now perhaps closer to Lisp than to Fortran I.
    image

    Lisp and Fortran were branches of two different evolution trees. One originated from mathematics, and the second from the architecture of machines. These two trees have since been intertwined. Lisp fired powerfully and accelerated over the next 20 years. The so-called mainstream languages ​​started quickly, but at the moment the most advanced of them can hardly catch up with Lisp. They left near him, but they still lack a couple of things.

    To be continued

    Another 80+ articles by Paul Graham on Habré.
    (Who wants to help with the translation - get connected)

    P.S.
    If you are interested in getting into Y Combinator and you are close to Graham's ideas, write in a personal letter, I have a couple of ideas.

    Also popular now: