We continue the translation of the essay and the book by Paul Graham "Hackers and Artists."
Original -
Revenge of the Nerds(who wants to join the translation - write in a personal)Thanks for the translation thanks to Shchyokotova Yana.May 2002“We were chasing C ++ programmers. We managed to drag them a whole bunch halfway to Lisp. ”
Guy Steele, coauthor of the Java specification.
')

In the software business, there is an eternal struggle between scientists, armed to the teeth, and another, no less formidable force, bosses, in the arsenal of which one sheer ignorance (* in the original pointy-haired boss - the character of the comic book series “Dilbert” by Scott Adams, is not educated and a complete lack of basic knowledge of the area that he manages). After all, everyone knows what kind of animal it is? I suppose that most people in the technology world not only recognize this cartoon character, but also know a real person from their company, from whom this image is drawn.
An ignorant boss miraculously combines two qualities that are quite common in themselves, but rarely when combined in one person: (a) he absolutely does not know anything about technology, and (b) he always has the strongest convictions on 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 in what language you should write this program. 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 head-layman. What he thinks looks like this. Java is standard. I know it must be so 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 who work for me now quit, because all the programmers who work for me always do this for some mysterious reason, I can easily replace them.
Well, this is not a big deal. But this is all based on one tacit assumption, which is actually false. Such a boss believes that all programming languages are quite similar. If this were the case, he would have hit the nail on the head. If all languages were interchangeable, then of course, you could use any language used by others.
But all languages are different, and I believe that I can prove it to you without undue detail about their differences. If you asked the head in 1992 in what programming language should a program be written, 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 did 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 the one (the Java programming language), in turn, was created to solve some C ++ problems. And so, please. Not all languages are equivalent. If you follow the course of thoughts in the head of our boss to Java and back, through the history of Java to its origins, you will have a hunch that goes with the assumption 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 C ++? Are there any situations where other languages are better than these?
As soon as you start thinking about this issue, you will get into a confused situation. If the boss had to think about the tasks in a complex, his brain would have exploded. As soon as he identifies all programming languages as equivalent, all he needs to do is choose the one with the most powerful pace of development. And, because it's more a matter of fashion than technology, even he can probably 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 doesn’t know anything about: the relative acceptability of 20 or so leading languages for the problem 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, it is not surprising that an ignorant boss will not want to open it.
The disadvantage of believing that all programming languages are equivalent is that this is not true. 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 novelty. (When viewed from a sufficiently large distance, all that can be seen is a large, glowing billboard paid for by Sun.) But if you look at this world from a fairly close distance, you will find that there is some degree of coolness. In the hacker subculture, there is another language called Perl, which is considered much cooler than Java. The Slashdot site, for example, is generated on Perl. I don't think you would see these guys using Java Server Pages. But there is another newer language called Python, whose users try to look down on Perl, but that
’s not all .
If we consider these languages in the following order: Java, Perl, Python, then we 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 take for errors. It would be possible to translate simple Python Lisp programs line by line. It was 2002, and the programming languages were almost equal to what was developed in 1958.
Keeping pace with mathWhat I want to say is that Lips was first discovered by John McCarthy in 1958, and popular programming languages are only now catching on the ideas that he was developing at the time.
So how can this be? Don't computer technology change so fast? I just want to say that in 1958 computers were giants the size of a refrigerator with the power of processors like a wristwatch. How could such an old technology remain relevant, not to mention surpassing recent developments?
I will tell you how. That's because Lisp was not really developed as a programming language, at least not in the sense that we understand today. What we mean by programming language is what we use to tell the computer what to do. McCarthy, after all, planned to develop a programming language in this sense, but the Lisp to which we arrived was based on some separate work of his own, purely
theoretical in nature , trying to define 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 generic Lisp function and show that it is shorter and more understandable than a description of a universal Turing machine. Such was the Lisp function eval ..., which computes the value of the Lisp expression .... The description of eval required the creation of a notation representing Lisp functions as Lisp data, and this notation was developed for the sake of the study itself, without thinking that it would be used to express Lisp programs in practice. ”
And then this is what 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 this is 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 meant for reading, not calculation. ”But he continued the work and did it. So he compiled the eval function from my work into the 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 had basically the form that it has today ...
Suddenly, I believe, in just a few weeks, McCarthy discovered that this purely theoretical exercise had transformed itself into a real programming language, and even more powerful than he had imagined.
Thus, a brief explanation of why this language of the 1950s is not obsolete is the fact that its basis was not technology, but mathematics. After all, mathematics does not have a shelf life. It would be more correct to compare Lisp not with the hardware of 1950, but, say, with the quick sort algorithm, which was opened in 1960 and is still the fastest general purpose sorting algorithm.
There is another language that has survived since the 1950s, Fortran, and it represents the opposite approach to language design. Lisp was a theory that suddenly turned into a programming language. Fortran was originally developed as a programming language, but, as we would now appreciate, as a low-level one.
Fortran I , developed in 1956, was a completely different berry field, unlike the current language Fortran. Fortran I was more of an assembly language with mathematics. In some ways he was weaker than newer assembly languages. For example, it lacked subroutines, only transition operations. Modern Fortran is now perhaps closer to Lisp than Fortran I.

Lisp and Fortran were branches of two different evolution trees. One took its origin from mathematics, and the second from the architecture of machines. These two trees are intertwined ever since. Lisp powerfully shot and accelerated over the next 20 years. The so-called mainstream languages quickly started, but at the moment the most advanced of them can hardly be compared with Lisp. They are not far from him, but they still lack a couple of things.
To be continuedAnother 80+ articles by Paul Graham on Habré.(Who wants to help with the translation - connect)P.S.If you are interested in getting into Y Combinator and Graham's ideas are close to you, write in a personal, I have a couple of ideas.