Revenge of the Nerds

Revenge of the Nerds

Revenge of the Nerds Paul Graham, May 2002 "We were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp." - Guy Steele, co-author of the Java spec In the software business there is an ongoing programmers working for me mysteriously always struggle between the pointy- do, I can easily replace them. headed academics, and another equally formidable force, the Well, this doesn't sound that unreasonable. But pointy-haired bosses. Everyone it's all based on one unspoken assumption, and knows who the pointy-haired boss that assumption turns out to be false. The pointy- is, right? I think most people in haired boss believes that all programming lan- the technology world not only guages are pretty much equivalent. If that were recognize this cartoon character, true, he would be right on target. If languages are but know the actual person in their company that all equivalent, sure, use whatever language eve- he is modeled upon. ryone else is using. The pointy-haired boss miraculously combines two But all languages are not equivalent, and I think I qualities that are common by themselves, but can prove this to you without even getting into the rarely seen together: (a) he knows nothing what- differences between them. If you asked the soever about technology, and (b) he has very pointy-haired boss in 1992 what language soft- strong opinions about it. ware should be written in, he would have an- swered with as little hesitation as he does today. Suppose, for example, you need to write a piece Software should be written in C++. But if lan- of software. The pointy-haired boss has no idea guages are all equivalent, why should the pointy- how this software has to work, and can't tell one haired boss's opinion ever change? In fact, why programming language from another, and yet he should the developers of Java have even bothered knows what language you should write it in. Ex- to create a new language? actly. He thinks you should write it in Java. Presumably, if you create a new language, it's be- Why does he think this? Let's take a look inside cause you think it's better in some way than what the brain of the pointy-haired boss. What he's people already had. And in fact, Gosling makes it thinking is something like this. Java is a standard. clear in the first Java white paper that Java was I know it must be, because I read about it in the designed to fix some problems with C++. So there press all the time. Since it is a standard, I won't you have it: languages are not all equivalent. If get in trouble for using it. And that also means you follow the trail through the pointy-haired there will always be lots of Java programmers, so boss's brain to Java and then back through Java's if the programmers working for me now quit, as history to its origins, you end up holding an idea that contradicts the assumption you started with. 1 So, who's right? James Gosling, If you look at these languages in order, Java, Perl, or the pointy-haired boss? Not Python, you notice an interesting pattern. At least, surprisingly, Gosling is right. you notice this pattern if you are a Lisp hacker. Some languages are better, for Each one is progressively more like Lisp. Python certain problems, than others. copies even features that many Lisp hackers con- And you know, that raises some sider to be mistakes. You could translate simple interesting questions. Java was Lisp programs into Python line for line. It's 2002, designed to be better, for certain and programming languages have almost caught problems, than C++. What problems? When is up with 1958. Java better and when is C++? Are there situations where other languages are better than either of them? Catching Up with Math Once you start considering this question, you have What I mean is that Lisp was opened a real can of worms. If the pointy-haired first discovered by John McCar- boss had to think about the problem in its full thy in 1958, and popular pro- complexity, it would make his brain explode. As gramming languages are only long as he considers all languages equivalent, all now catching up with the ideas he has to do is choose the one that seems to have he developed then. the most momentum, and since that is more a question of fashion than technology, even he can probably get the right answer. But if languages Now, how could that be true? vary, he suddenly has to solve two simultaneous Isn't computer technology equations, trying to find an optimal balance be- something that changes very tween two things he knows nothing about: the rapidly? I mean, in 1958, com- relative suitability of the twenty or so leading lan- puters were refrigerator-sized behemoths with the guages for the problem he needs to solve, and the processing power of a wristwatch. How could any odds of finding programmers, libraries, etc. for technology that old even be relevant, let alone each. If that's what's on the other side of the door, superior to the latest developments? it is no surprise that the pointy-haired boss doesn't want to open it. I'll tell you how. It's because Lisp was not really designed to be a programming language, at least The disadvantage of believing that all program- not in the sense we mean today. What we mean ming languages are equivalent is that it's not true. by a programming language is something we use But the advantage is that it makes your life a lot to tell a computer what to do. McCarthy did even- simpler. And I think that's the main reason the tually intend to develop a programming language idea is so widespread. It is a comfortable idea. in this sense, but the Lisp that we actually ended up with was based on something separate that he did as a theoretical exercise-- an effort to define a We know that Java must be pretty good, because more convenient alternative to the Turing Ma- it is the cool, new programming language. Or is it? chine. As McCarthy said later, If you look at the world of programming lan- guages from a distance, it looks like Java is the “Another way to show that Lisp was neater than latest thing. (From far enough away, all you can Turing machines was to write a universal Lisp func- see is the large, flashing billboard paid for by tion and show that it is briefer and more compre- Sun.) But if you look at this world up close, you hensible than the description of a universal Turing find that there are degrees of coolness. Within the machine. This was the Lisp function eval..., which hacker subculture, there is another language computes the value of a Lisp expression.... Writing called Perl that is considered a lot cooler than eval required inventing a notation representing Lisp Java. Slashdot, for example, is generated by Perl. functions as Lisp data, and such a notation was de- I don't think you would find those guys using Java vised for the purposes of the paper with no thought Server Pages. But there is another, newer lan- that it would be used to express Lisp programs in guage, called Python, whose users tend to look practice.” down on Perl, and more waiting in the wings. 2 What happened next was that, some time in late are fairly close to Lisp. Close, but they are still 1958, Steve Russell, one of McCarthy's grad stu- missing a few things.... dents, looked at this definition of eval and realized that if he translated it into machine language, the What Made Lisp Different result would be a Lisp interpreter. When it was first developed, This was a big surprise at the time. Here is what Lisp embodied nine new McCarthy said about it later in an interview: ideas. Some of these we now Steve Russell said, look, why don't I program this take for granted, others are eval..., and I said to him, ho, ho, you're confusing only seen in more advanced theory with practice, this eval is intended for reading, languages, and two are still not for computing. But he went ahead and did it. That unique to Lisp. The nine is, he compiled the eval in my paper into [IBM] 704 ideas are, in order of their machine code, fixing bugs, and then advertised this as a Lisp interpreter, which it certainly was. So at that adoption by the mainstream: point Lisp had essentially the form that it has today.... 1. Conditionals. A conditional is an if-then- Suddenly, in a matter of weeks I think, McCarthy else construct. We take these for granted found his theoretical exercise transformed into an now, but Fortran I didn't have them. It had actual programming language-- and a more pow- only a conditional goto closely based on erful one than he had intended. the underlying machine instruction. So the short explanation of why this 1950s lan- 2. A function type. In Lisp, functions are a guage is not obsolete is that it was not technology data type just like integers or strings. They but math, and math doesn't get stale. The right have a literal representation, can be stored thing to compare Lisp to is not 1950s hardware, in variables, can be passed as arguments, but, say, the Quicksort algorithm, which was dis- and so on.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us