Trevor Burnham

Sure, it works in practice…

Lispers See All

March 23rd, 2010

This is the seventh in a series of posts about Paul Graham’s book Hackers & Painters.

xkcd on Lisp

Ask anyone in academia about Lisp, and there’s a good chance that they’ll say it’s a great language for AI research, but not for industry. Paul Graham, on the other hand, calls it the “secret weapon” that allowed Viaweb to outdo their com­peti­tors at every turn. He adds a second dat­a­point: ITA Software, the company that powers Orbitz, also taps into the power of Lisp, which he believes was critical to the site’s success against Trav­e­loc­ity and Expedia.

Chapter 12, “Beating the Averages,” is all about what makes Lisp so great. He argues that it’s not just one of many high-​​level lan­guages, but the highest-​​level language. Why don’t other pro­gram­mers acknowl­edge this? He supposes that a pro­gram­mer uses a language called Blub, which lies some­where on the language spectrum near Java and Python. “As long as our hypo­thet­i­cal Blub pro­gram­mer is looking down the power con­tin­uum, he knows he’s looking down. Lan­guages less powerful than Blub are obvi­ously less powerful, because they’re missing some feature he’s used to. But when our hypo­thet­i­cal Blub pro­gram­mer looks in the other direc­tion, up the power con­tin­uum, he doesn’t realize he’s looking up. What he sees are merely weird lan­guages. He probably con­sid­ers them about equiv­a­lent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.”

Fol­low­ing this line of rea­son­ing to its con­clu­sion, Graham writes, “the only pro­gram­mers in a position to see all the dif­fer­ences in power between various lan­guages are those who under­stand the most powerful one.” Which, in his mind, is Lisp. He’s con­fi­dent of this fact because Lisp is the only language with macros, and whenever he looks at another language, he wonders how those pro­gram­mers can get anything done without macros.

In the next chapter, “Revenge of the Nerds,” Graham claims that main­stream lan­guages are grad­u­ally moving ever closer to the ideal, Lisp, which was invented by John McCarthy all the way back in the 1950s. (Fas­ci­nat­ingly, McCarthy invented the language only as a the­o­ret­i­cal notation. He had no intent of actually “running” that notation until one of his grad students, Steve Russell, wrote the first Lisp inter­preter.) Ruby, for instance, is very nearly Lisp with a prettier syntax. The chapter includes an appendix of code examples that demon­strate the superior brevity of Lisp and Ruby for a par­tic­u­lar (con­trived) task. To my mind, the JavaScript code, though slightly longer, is the most readable; but this is unde­ni­ably because I tend to think in JavaScript.

I feel as though I should be arguing against Graham—his fervor borders on the religious—but I’m in no position to do so. What little I know about Lisp, I’ve learned from reading Hacker News. And cer­tainly, there are some lan­guages (Python, Scala) are superior to their more popular rivals (PHP, Java). So it seems that I have no alter­na­tive: I’ll have to learn Lisp. Maybe I, too, will be able to gaze down at all the other hackers one day.

[Addendum: Graham revisits “Revenge of the Nerds” in his 2002 essay “Suc­cinct­ness is Power.”]

Tags:     No Comments

0 responses so far ↓

Comments are closed.