如果Lisp这么好

Paul Graham 2003-05-01

如果Lisp这么好

2003年5月

如果Lisp这么好,为什么没有更多人使用它?我最近在一次演讲中被听众中的一个学生问到了这个问题。而且不是第一次了。

在语言方面,就像在许多事情中一样,流行度和质量之间没有太大关联。为什么约翰·格里沙姆(《诉讼之王》销售排名第44)比简·奥斯汀(《傲慢与偏见》销售排名第6191)卖得更好?即使是格里沙姆会声称这是因为他是更好的作家吗?

这是《傲慢与偏见》的第一句话:“凡是有钱的单身汉,总想娶位太太,这已经成了一条举世公认的真理。”

“举世公认的真理?” 对于一个爱情故事的第一句话来说,这些词太长了。

就像简·奥斯汀的作品一样,Lisp看起来很难。它的语法,或者说缺乏语法,使它看起来完全不同于大多数人习惯的语言。在学习Lisp之前,我也害怕它。我最近发现了一本1983年的笔记本,我在上面写道:“我想我应该学习Lisp,但它看起来太陌生了。“幸运的是,我当时19岁,对学习新东西没有太多抵触。我非常无知,学习几乎任何东西都意味着学习新事物。

被Lisp吓到的人们编造了其他不使用它的理由。当C是默认语言时,标准的借口是Lisp太慢。现在Lisp方言是可用语言中较快的之一,这个借口已经消失了。现在的标准借口是公开循环的:其他语言更流行。

(小心这种推理。它会让你得到Windows。)

流行度总是自我延续的,但在编程语言中尤其如此。为流行语言编写的库更多,这使它们更流行。程序经常必须与现有程序一起工作,如果它们用相同的语言编写,这会更容易,所以语言像病毒一样从程序传播到程序。管理者更喜欢流行的语言,因为它们给他们更多对开发者的控制力,开发者可以更容易被替换。

确实,如果编程语言都或多或少等价,那么使用除最流行语言之外的任何语言都没有什么理由。但它们并不都等价,差远了。这就是为什么不那么流行的语言,像简·奥斯汀的小说,继续存在的原因。当其他人在阅读最新的约翰·格里沙姆小说时,总会有一小部分人在阅读简·奥斯汀。


日语翻译 | 罗马尼亚语翻译 | 西班牙语翻译

If Lisp is So Great

May 2003

If Lisp is so great, why don’t more people use it? I was asked this question by a student in the audience at a talk I gave recently. Not for the first time, either.

In languages, as in so many things, there’s not much correlation between popularity and quality. Why does John Grisham (King of Torts sales rank, 44) outsell Jane Austen (Pride and Prejudice sales rank, 6191)? Would even Grisham claim that it’s because he’s a better writer?

Here’s the first sentence of Pride and Prejudice: “It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife.”

“It is a truth universally acknowledged?” Long words for the first sentence of a love story.

Like Jane Austen, Lisp looks hard. Its syntax, or lack of syntax, makes it look completely unlike the languages most people are used to. Before I learned Lisp, I was afraid of it too. I recently came across a notebook from 1983 in which I’d written: “I suppose I should learn Lisp, but it seems so foreign.” Fortunately, I was 19 at the time and not too resistant to learning new things. I was so ignorant that learning almost anything meant learning new things.

People frightened by Lisp make up other reasons for not using it. The standard excuse, back when C was the default language, was that Lisp was too slow. Now that Lisp dialects are among the faster languages available, that excuse has gone away. Now the standard excuse is openly circular: that other languages are more popular.

(Beware of such reasoning. It gets you Windows.)

Popularity is always self-perpetuating, but it’s especially so in programming languages. More libraries get written for popular languages, which makes them still more popular. Programs often have to work with existing programs, and this is easier if they’re written in the same language, so languages spread from program to program like a virus. And managers prefer popular languages, because they give them more leverage over developers, who can more easily be replaced.

Indeed, if programming languages were all more or less equivalent, there would be little justification for using any but the most popular. But they aren’t all equivalent, not by a long shot. And that’s why less popular languages, like Jane Austen’s novels, continue to survive at all. When everyone else is reading the latest John Grisham novel, there will always be a few people reading Jane Austen instead.


Japanese Translation | Romanian Translation | Spanish Translation