Beating the Averages
<img src="http://www.virtumundo.com/images/spacer.gif" height=15 width=1> Want to start a startup?
<img src="http://www.virtumundo.com/images/spacer.gif" height=15 width=1> 想要创业吗?
Get funded by Y Combinator .
获得 Y Combinator 的资助。
</td > April 2001, rev.
</td> 2001 年 4 月,修订版。
April 2003 (This article is derived from a talk given at the 2001 Franz Developer Symposium.) In the summer of 1995, my friend Robert Morris and I started a startup called Viaweb .
2003 年 4 月(本文摘自 2001 年 Franz 开发者研讨会上的一次演讲。)1995 年夏天,我和朋友 Robert Morris 创办了一家名为 Viaweb 的初创公司。
Our plan was to write software that would let end users build online stores.
我们的计划是编写可以让最终用户建立在线商店的软件。
What was novel about this software, at the time, was that it ran on our server, using ordinary Web pages as the interface.
当时该软件的新颖之处在于它在我们的服务器上运行,使用普通网页作为界面。
A lot of people could have been having this idea at the same time, of course, but as far as I know, Viaweb was the first Web-based application.
当然,很多人可能同时有这个想法,但据我所知,Viaweb 是第一个基于 Web 的应用程序。
It seemed such a novel idea to us that we named the company after it: Viaweb, because our software worked via the Web, instead of running on your desktop computer.
这对我们来说似乎是一个新颖的想法,因此我们以它的名字命名了公司:Viaweb,因为我们的软件通过网络运行,而不是在桌面计算机上运行。
Another unusual thing about this software was that it was written primarily in a programming language called Lisp.
该软件的另一个不寻常之处在于它主要是用一种名为 Lisp 的编程语言编写的。
It was one of the first big end-user applications to be written in Lisp, which up till then had been used mostly in universities and research labs.
它是最早用 Lisp 编写的大型最终用户应用程序之一,到目前为止,Lisp 主要在大学和研究实验室使用。
[1] The Secret Weapon Eric Raymond has written an essay called "How to Become a Hacker," and in it, among other things, he tells would-be hackers what
[1] 秘密武器 埃里克·雷蒙德 (Eric Raymond) 写了一篇名为“如何成为黑客”的文章,其中除其他外,他告诉未来的黑客什么
languages they should learn.
他们应该学习的语言。
He suggests starting with Python and Java, because they are easy to learn.
他建议从 Python 和 Java 开始,因为它们很容易学习。
The serious hacker will also want to learn C, in order to hack Unix, and Perl for system administration and cgi scripts.
认真的黑客还想学习 C 语言,以便破解 Unix,学习 Perl 进行系统管理和 cgi 脚本。
Finally, the truly serious hacker should consider learning Lisp: Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make
最后,真正认真的黑客应该考虑学习Lisp:Lisp值得学习,因为当你最终得到它时,你会有深刻的启蒙体验;那种经历会让
you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.
即使你实际上从未经常使用 Lisp 本身,你在余下的日子里也会成为一个更好的程序员。
This is the same argument you tend to hear for learning Latin.
这与您在学习拉丁语时经常听到的论点相同。
It won't get you a job, except perhaps as a classics professor, but it will improve your mind, and make you a better writer in languages you do want to use, like English.
它不会给你带来一份工作,除非你是一名古典学教授,但它会提高你的思维,让你成为一个更好的作家,用你想要使用的语言,比如英语。
But wait a minute.
但等一下。
This metaphor doesn't stretch that far.
这个比喻并没有延伸那么远。
The reason Latin won't get you a job is that no one speaks it.
拉丁语无法给你找到工作的原因是没人会说拉丁语。
If you
如果你
write in Latin, no one can understand you.
用拉丁文写,没有人能理解你。
But Lisp is a computer language, and computers speak whatever language you, the programmer, tell them to.
但 Lisp 是一种计算机语言,计算机会说你(程序员)告诉它们的任何语言。
So if Lisp makes you a better programmer, like he says, why wouldn't you want to use it?
因此,如果 Lisp 让你成为一名更好的程序员,就像他所说的那样,你为什么不想使用它呢?
If a painter were offered a brush that would make him a better painter, it seems to me that he would want to use it in all his paintings, wouldn't he?
如果给一位画家提供一支画笔,使他成为更好的画家,在我看来,他会想在他所有的画作中使用它,不是吗?
I'm not trying to make
我并不想让
fun of Eric Raymond here.
埃里克·雷蒙德在这里很有趣。
On the whole, his advice is good.
总的来说,他的建议是好的。
What he says about Lisp is pretty much the conventional wisdom.
他对 Lisp 的评价几乎是传统观点。
But there is a contradiction in the conventional wisdom: Lisp will make you a better programmer, and yet you won't use it.
但传统观点存在一个矛盾:Lisp 会让你成为更好的程序员,但你却不会使用它。
Why not?
为什么不呢?
Programming languages are just tools, after all.
毕竟,编程语言只是工具。
If Lisp really does yield better programs, you should use it.
如果 Lisp 确实能产生更好的程序,那么你应该使用它。
And if it doesn't, then who needs it?
如果没有,那么谁需要它?
This is not just a theoretical question.
这不仅仅是一个理论问题。
Software is a very competitive business, prone to natural monopolies.
软件是一个竞争非常激烈的行业,容易出现自然垄断。
A company that gets software written faster and better will, all other things being equal, put its competitors out of business.
在其他条件相同的情况下,一家能够更快更好地编写软件的公司将使其竞争对手破产。
And when you're starting a startup, you feel this very keenly.
当你开始创业时,你会非常敏锐地感受到这一点。
Startups tend to be an all or nothing proposition.
初创公司往往是一个全有或全无的命题。
You either get rich, or you get nothing.
你要么变得富有,要么一无所有。
In a startup, if you bet on the wrong technology, your
在初创公司中,如果你押注于错误的技术,你的
competitors will crush you.
竞争对手会压垮你。
Robert and I both knew Lisp well, and we couldn't see any reason not to trust our instincts and go with Lisp.
Robert 和我都非常了解 Lisp,我们找不到任何理由不相信自己的直觉并选择 Lisp。
We knew that everyone else was writing their software in C++ or Perl.
我们知道其他人都在用 C++ 或 Perl 编写软件。
But we also knew that that didn't mean anything.
但我们也知道这没有任何意义。
If you chose technology that way, you'd be running Windows.
如果您以这种方式选择技术,您就会运行 Windows。
When you choose technology, you have to ignore what other people are doing, and consider only what will
当你选择技术时,你必须忽略其他人在做什么,而只考虑将要做什么
work the best.
工作最好。
This is especially true in a startup.
对于初创公司来说尤其如此。
In a big company, you can do what all the other big companies are doing.
在一家大公司,你可以做所有其他大公司正在做的事情。
But a startup can't do what all the other startups do.
但一家初创公司无法做所有其他初创公司所做的事情。
I don't think a lot of people realize this, even in startups.
我认为很多人都没有意识到这一点,即使是在初创企业中。
The average big company grows at about ten percent a year.
大公司平均每年增长约百分之十。
So if you're running a big company and you do everything the way the average big company does it, you can expect to do as well as the
因此,如果您经营一家大公司,并且您按照一般大公司的方式做所有事情,那么您可以期望做得和大公司一样好。
average big company-- that is, to grow about ten percent a year.
一般大公司——也就是说,每年增长约百分之十。
The same thing will happen if you're running a startup, of course.
当然,如果你正在经营一家初创公司,同样的事情也会发生。
If you do everything the way the average startup does it, you should expect average performance.
如果你按照普通初创公司的方式做所有事情,那么你应该期望得到平均的性能。
The problem here is, average performance means that you'll go out of business.
这里的问题是,平均绩效意味着您将破产。
The survival rate for startups is way less than fifty percent.
初创公司的生存率远低于百分之五十。
So if you're running a startup,
所以如果你正在经营一家初创公司
you had better be doing something odd.
你最好做点奇怪的事。
If not, you're in trouble.
如果没有,你就有麻烦了。
Back in 1995, we knew something that I don't think our competitors understood, and few understand even now: when you're writing software that only has to run on your own servers, you can use any language you want.
早在 1995 年,我们就知道一些我认为我们的竞争对手不理解的事情,甚至现在也很少有人理解:当您编写只需要在自己的服务器上运行的软件时,您可以使用任何您想要的语言。
When you're writing desktop software, there's a strong bias toward writing applications in the same language as the operating system.
当您编写桌面软件时,您会强烈倾向于使用与操作系统相同的语言来编写应用程序。
Ten years ago, writing applications
十年前,写应用程序
meant writing applications in C.
意味着用 C 语言编写应用程序。
But with Web-based software, especially when you have the source code of both the language and the operating system, you can use whatever language you want.
但对于基于 Web 的软件,尤其是当您同时拥有该语言和操作系统的源代码时,您可以使用任何您想要的语言。
This new freedom is a double-edged sword, however.
然而,这种新的自由是一把双刃剑。
Now that you can use any language, you have to think about which one to use.
现在您可以使用任何语言,您必须考虑使用哪一种。
Companies that try to pretend nothing has changed risk finding that their competitors do not.
试图假装什么都没有改变的公司可能会发现他们的竞争对手没有改变。
If you can use any language, which do you use?
如果你会使用任何一种语言,你会使用哪种语言?
We chose Lisp.
我们选择了 Lisp。
For one thing, it was obvious that rapid development would be important in this market.
一方面,很明显,快速发展对于这个市场来说非常重要。
We were all starting from scratch, so a company that could get new features done before its competitors would have a big advantage.
我们都是从头开始,因此能够在竞争对手之前完成新功能的公司将拥有很大的优势。
We knew Lisp was a really good language for writing software quickly, and server-based applications magnify the effect of rapid development, because you can release software
我们知道 Lisp 是一种非常适合快速编写软件的语言,而基于服务器的应用程序放大了快速开发的效果,因为您可以发布软件
the minute it's done.
完成的那一刻。
If other companies didn't want to use Lisp, so much the better.
如果其他公司不想使用 Lisp,那就更好了。
It might give us a technological edge, and we needed all the help we could get.
它可能会给我们带来技术优势,而我们需要所有可以获得的帮助。
When we started Viaweb, we had no experience in business.
当我们创办 Viaweb 时,我们没有商业经验。
We didn't know anything about marketing, or hiring people, or raising money, or getting customers.
我们对营销、招聘、筹集资金或吸引客户一无所知。
Neither of us had ever even had what you would call a real job.
我们俩都没有做过所谓的真正的工作。
The only thing we
我们唯一的事
were good at was writing software.
我们擅长编写软件。
We hoped that would save us.
我们希望这能拯救我们。
Any advantage we could get in the software department, we would take.
我们会利用软件部门能够获得的任何优势。
So you could say that using Lisp was an experiment.
所以你可以说使用 Lisp 是一个实验。
Our hypothesis was that if we wrote our software in Lisp, we'd be able to get features done faster than our competitors, and also to do things in our software that they couldn't do.
我们的假设是,如果我们用 Lisp 编写软件,我们就能比竞争对手更快地完成功能,并且能够在我们的软件中完成他们无法完成的事情。
And because Lisp was so high-level, we wouldn't need a big development team, so our costs
而且由于 Lisp 的水平非常高,我们不需要一个庞大的开发团队,所以我们的成本
would be lower.
会更低。
If this were so, we could offer a better product for less money, and still make a profit.
如果是这样,我们就可以用更少的钱提供更好的产品,并且仍然可以盈利。
We would end up getting all the users, and our competitors would get none, and eventually go out of business.
我们最终会获得所有用户,而我们的竞争对手则得不到任何用户,并最终倒闭。
That was what we hoped would happen, anyway.
无论如何,这就是我们希望发生的事情。
What were the results of this experiment?
这个实验的结果是什么?
Somewhat surprisingly, it worked.
有点令人惊讶的是,它奏效了。
We eventually had many competitors, on the order of twenty to thirty of them, but none of their software could compete
我们最终有很多竞争对手,大约有二十到三十个,但他们的软件都无法竞争
with ours.
与我们的。
We had a wysiwyg online store builder that ran on the server and yet felt like a desktop application.
我们有一个所见即所得的在线商店构建器,它在服务器上运行,但感觉就像一个桌面应用程序。
Our competitors had cgi scripts.
我们的竞争对手有 CGI 脚本。
And we were always far ahead of them in features.
而且我们在功能上始终遥遥领先于他们。
Sometimes, in desperation, competitors would try to introduce features that we didn't have.
有时,在绝望中,竞争对手会尝试引入我们没有的功能。
But with Lisp our development cycle was so fast that we could sometimes duplicate a new feature within a day or two of a competitor announcing it in a press release.
但使用 Lisp,我们的开发周期非常快,有时我们可以在竞争对手在新闻稿中宣布新功能后一两天内复制新功能。
By
由
the time journalists covering the press release got round to calling us, we would have the new feature too.
当报道新闻稿的记者抽出时间给我们打电话时,我们也会有这个新功能。
It must have seemed to our competitors that we had some kind of secret weapon-- that we were decoding their Enigma traffic or something.
在我们的竞争对手看来,我们一定认为我们拥有某种秘密武器——我们正在解码他们的恩尼格玛密码流量之类的东西。
In fact we did have a secret weapon, but it was simpler than they realized.
事实上我们确实有一个秘密武器,但它比他们想象的要简单。
No one was leaking news of their features to us.
没有人向我们泄露其功能的消息。
We were just able to develop software faster than anyone
我们能够比任何人更快地开发软件
thought possible.
认为可能。
When I was about nine I happened to get hold of a copy of The Day of the Jackal, by Frederick Forsyth.
当我九岁左右的时候,我碰巧得到了一本弗雷德里克·福赛思(Frederick Forsyth)所著的《豺狼之日》。
The main character is an assassin who is hired to kill the president of France.
主角是一名受雇刺杀法国总统的刺客。
The assassin has to get past the police to get up to an apartment that overlooks the president's route.
刺客必须绕过警察才能到达一间俯瞰总统路线的公寓。
He walks right by them, dressed up as an old man on crutches, and they never suspect him.
他从他们身边走过,打扮成一个拄着拐杖的老人,他们从来没有怀疑过他。
Our secret weapon was similar.
我们的秘密武器是相似的。
We wrote our software in a weird
我们用一种奇怪的方式编写我们的软件
AI language, with a bizarre syntax full of parentheses.
AI语言,具有充满括号的奇怪语法。
For years it had annoyed me to hear Lisp described that way.
多年来,听到这样描述 Lisp 一直让我很恼火。
But now it worked to our advantage.
但现在它对我们有利。
In business, there is nothing more valuable than a technical advantage your competitors don't understand.
在商业中,没有什么比竞争对手不了解的技术优势更有价值的了。
In business, as in war, surprise is worth as much as force.
在商业中,就像在战争中一样,出其不意与武力同等重要。
And so, I'm a little embarrassed to say, I never said anything publicly about Lisp while we were working on Viaweb.
所以,我有点不好意思地说,当我们在 Viaweb 工作时,我从未公开说过任何关于 Lisp 的事情。
We never
我们从来不
mentioned it to the press, and if you searched for Lisp on our Web site, all you'd find were the titles of two books in my bio.
我向媒体提到过这件事,如果你在我们的网站上搜索 Lisp,你会发现我的简历中只有两本书的书名。
This was no accident.
这并非偶然。
A startup should give its competitors as little information as possible.
初创公司应该向竞争对手提供尽可能少的信息。
If they didn't know what language our software was written in, or didn't care, I wanted to keep it that way.[2] The people who understood our technology best were the customers.
如果他们不知道我们的软件是用什么语言编写的,或者不在乎,我想保持这种状态。[2]最了解我们技术的人是客户。
They didn't care what language Viaweb was written in either, but they noticed that it worked really well.
他们也不关心 Viaweb 是用什么语言编写的,但他们注意到它运行得非常好。
It let them build great looking online stores literally in minutes.
它让他们在几分钟内就可以建立漂亮的在线商店。
And so, by word of mouth mostly, we got more and more users.
因此,主要是通过口耳相传,我们获得了越来越多的用户。
By the end of 1996 we had about 70 stores online.
到 1996 年底,我们拥有大约 70 家在线商店。
At the end of 1997 we had 500.
1997 年底,我们有 500 名。
Six months later, when Yahoo bought us, we had 1070 users.
六个月后,当雅虎收购我们时,我们拥有 1070 个用户。
Today, as Yahoo Store, this software continues to dominate its market.
如今,作为雅虎商店,该软件继续主导其市场。
It's
这是
one of the more profitable pieces of Yahoo, and the stores built with it are the foundation of Yahoo Shopping.
雅虎最赚钱的部分之一,用它建立的商店是雅虎购物的基础。
I left Yahoo in 1999, so I don't know exactly how many users they have now, but the last I heard there were about 20,000.
我1999年离开雅虎,所以我不知道他们现在有多少用户,但我最后听说大约有20,000人。
<!-- People sometimes ask me if Yahoo Store still uses Lisp.
<!-- 人们有时会问我雅虎商店是否仍然使用 Lisp。
Yes, all the Lisp code is still there.
是的,所有 Lisp 代码都还在那里。
Yahoo has server-side software written in all five of the languages Eric Raymond recommends to
雅虎拥有用 Eric Raymond 推荐的所有五种语言编写的服务器端软件
hackers.
黑客。
--> The Blub Paradox What's so great about Lisp?
--> Blub 悖论 Lisp 有何伟大之处?
And if Lisp is so great, why doesn't everyone use it?
如果 Lisp 如此出色,为什么不是每个人都使用它呢?
These sound like rhetorical questions, but actually they have straightforward answers.
这些听起来像是反问句,但实际上它们有简单的答案。
Lisp is so great not because of some magic quality visible only to devotees, but because it is simply the most powerful language available.
Lisp 如此伟大,并不是因为某些只有爱好者才能看到的神奇品质,而是因为它是可用的最强大的语言。
And the reason everyone doesn't use it is that programming languages are not merely
每个人都不使用它的原因是编程语言不仅仅是
technologies, but habits of mind as well, and nothing changes slower.
技术,还有思维习惯,没有什么改变得更慢。
Of course, both these answers need explaining.
当然,这两个答案都需要解释。
I'll begin with a shockingly controversial statement: programming languages vary in power.
我将从一个令人震惊的争议性声明开始:编程语言的能力各不相同。
Few would dispute, at least, that high level languages are more powerful than machine language.
至少很少有人会质疑高级语言比机器语言更强大。
Most programmers today would agree that you do not, ordinarily, want to program in machine language.
今天,大多数程序员都会同意,通常情况下,您不想用机器语言进行编程。
Instead, you should program in a high-level language, and have a compiler translate it into machine language for you.
相反,您应该使用高级语言进行编程,然后让编译器将其翻译为机器语言。
This idea is even built into the hardware now: since the 1980s, instruction sets have been designed for compilers rather than human programmers.
这个想法现在甚至已经融入到硬件中:自 20 世纪 80 年代以来,指令集是为编译器而不是人类程序员设计的。
Everyone knows it's a mistake to write your whole program by hand in machine language.
每个人都知道用机器语言手工编写整个程序是错误的。
What's less often understood is that there is a more general principle here: that if you have a choice of
很少有人理解的是,这里有一个更普遍的原则:如果你可以选择
several languages, it is, all other things being equal, a mistake to program in anything but the most powerful one.
在其他条件相同的情况下,使用多种语言进行编程,除了最强大的语言之外,都是错误的。
[3] There are many exceptions to this rule.
[3] 这条规则有很多例外。
If you're writing a program that has to work very closely with a program written in a certain language, it might be a good idea to write the new program in the same language.
如果您正在编写的程序必须与用某种语言编写的程序非常紧密地配合,那么用同一种语言编写新程序可能是个好主意。
If you're writing a program that only has to do something very simple, like number crunching or bit manipulation,
如果您正在编写一个只需要执行一些非常简单的操作的程序,例如数字运算或位操作,
you may as well use a less abstract language, especially since it may be slightly faster.
您也可以使用不太抽象的语言,特别是因为它可能会稍微快一些。
And if you're writing a short, throwaway program, you may be better off just using whatever language has the best library functions for the task.
如果您正在编写一个简短的一次性程序,那么您最好使用具有最适合该任务的库函数的语言。
But in general, for application software, you want to be using the most powerful (reasonably efficient) language you can get, and using anything else is a mistake, of exactly the same kind, though possibly in a
但一般来说,对于应用程序软件,您希望使用您可以获得的最强大(相当有效)的语言,并且使用其他任何语言都是一个错误,完全相同的类型,尽管可能是在一个错误中。
lesser degree, as programming in machine language.
程度较低,如机器语言编程。
You can see that machine language is very low level.
你可以看到机器语言的水平非常低。
But, at least as a kind of social convention, high-level languages are often all treated as equivalent.
但是,至少作为一种社会惯例,高级语言通常都被视为等效的。
They're not.
他们不是。
Technically the term "high-level language" doesn't mean anything very definite.
从技术上讲,“高级语言”一词并不意味着任何非常明确的东西。
There's no dividing line with machine languages on one side and all the high-level languages on the other.
一侧是机器语言,另一侧是所有高级语言,没有分界线。
Languages fall along a continuum [4] of
语言属于一个连续体 [4]
abstractness, from the most powerful all the way down to machine languages, which themselves vary in power.
抽象性,从最强大的语言一直到机器语言,它们本身的能力各不相同。
Consider Cobol.
考虑一下科博尔。
Cobol is a high-level language, in the sense that it gets compiled into machine language.
Cobol 是一种高级语言,因为它被编译成机器语言。
Would anyone seriously argue that Cobol is equivalent in power to, say, Python?
有人会认真地争论 Cobol 的功能相当于 Python 等吗?
It's probably closer to machine language than Python.
它可能比 Python 更接近机器语言。
Or how about Perl 4?
或者 Perl 4 怎么样?
Between Perl 4 and Perl 5, lexical closures
Perl 4 和 Perl 5 之间,词法闭包
got added to the language.
被添加到语言中。
Most Perl hackers would agree that Perl 5 is more powerful than Perl 4.
大多数 Perl 黑客都会同意 Perl 5 比 Perl 4 更强大。
But once you've admitted that, you've admitted that one high level language can be more powerful than another.
但一旦你承认了这一点,你就承认一种高级语言可以比另一种更强大。
And it follows inexorably that, except in special cases, you ought to use the most powerful you can get.
不可避免的是,除了特殊情况外,你应该使用你能得到的最强大的东西。
This idea is rarely followed to its conclusion, though.
不过,这个想法很少得到结论。
After a certain age, programmers rarely switch languages voluntarily.
到了一定年龄之后,程序员很少会自愿切换语言。
Whatever language people happen to be used to, they tend to consider just good enough.
无论人们习惯使用什么语言,他们都倾向于认为已经足够好了。
Programmers get very attached to their favorite languages, and I don't want to hurt anyone's feelings, so to explain this point I'm going to use a hypothetical language called Blub.
程序员非常依恋他们最喜欢的语言,我不想伤害任何人的感情,所以为了解释这一点,我将使用一种名为 Blub 的假设语言。
Blub falls right in the middle of the abstractness continuum.
Blub 正好处于抽象连续体的中间。
It is not the most powerful language, but it is more powerful than Cobol or machine
它不是最强大的语言,但它比 Cobol 或机器更强大
language.
语言。
And in fact, our hypothetical Blub programmer wouldn't use either of them.
事实上,我们假设的 Blub 程序员不会使用它们中的任何一个。
Of course he wouldn't program in machine language.
他当然不会用机器语言编程。
That's what compilers are for.
这就是编译器的用途。
And as for Cobol, he doesn't know how anyone can get anything done with it.
至于科博尔,他不知道如何才能用它完成任何事情。
It doesn't even have x (Blub feature of your choice).
它甚至没有 x(您选择的 Blub 功能)。
As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down.
只要我们假设的 Blub 程序员一直在向下看权力连续体,他就知道自己在向下看。
Languages less powerful
语言功能较弱
than Blub are obviously less powerful, because they're missing some feature he's used to.
比 Blub 显然不那么强大,因为它们缺少一些他习惯的功能。
But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up.
但是,当我们假设的 Blub 程序员朝另一个方向(即功率连续体)向上看时,他并没有意识到自己正在向上看。
What he sees are merely weird languages.
他看到的只是奇怪的语言。
He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well.
他可能认为它们的力量与 Blub 相当,但还加入了所有其他毛茸茸的东西。
Blub is good enough for him, because he thinks in Blub.
Blub 对他来说已经足够好了,因为他用 Blub 思考。
When we switch to the point of view of a programmer using any of the languages higher up the power continuum, however, we find that he in turn looks down upon Blub.
然而,当我们切换到使用任何更高权力连续体语言的程序员的观点时,我们发现他反过来看不起 Blub。
How can you get anything done in Blub?
如何在 Blub 中完成任何事情?
It doesn't even have y.
它甚至没有 y。
By induction, the only programmers in a position to see all the differences in power between the various languages are those who understand the most powerful one.
通过归纳,唯一能够看到各种语言之间能力差异的程序员是那些了解最强大语言的程序员。
(This is probably what Eric
(这大概就是艾瑞克
Raymond meant about Lisp making you a better programmer.) You can't trust the opinions of the others, because of the Blub paradox: they're satisfied with whatever language they happen to use, because it dictates the way they think about programs.
Raymond 的意思是 Lisp 让你成为更好的程序员。)你不能相信其他人的意见,因为 Blub 悖论:他们对他们碰巧使用的任何语言感到满意,因为它决定了他们思考程序的方式。
I know this from my own experience, as a high school kid writing programs in Basic.
我从自己的经验中知道了这一点,当时我还是一个用 Basic 编写程序的高中生。
That language didn't even support recursion.
该语言甚至不支持递归。
It's hard to imagine writing programs without using recursion, but
很难想象不使用递归来编写程序,但是
I didn't miss it at the time.
我当时并没有错过。
I thought in Basic.
我在Basic中想到了。
And I was a whiz at it.
我是这方面的高手。
Master of all I surveyed.
我调查过的所有大师。
The five languages that Eric Raymond recommends to hackers fall at various points on the power continuum.
埃里克·雷蒙德向黑客推荐的五种语言分别位于权力连续体的不同点。
Where they fall relative to one another is a sensitive topic.
它们之间的相对关系是一个敏感话题。
What I will say is that I think Lisp is at the top.
我要说的是,我认为 Lisp 处于领先地位。
And to support this claim I'll tell you about one of the things I find missing when I look at the other
为了支持这一说法,我将告诉你当我查看另一件事时我发现缺少的一件事
four languages.
四种语言。
How can you get anything done in them, I think, without macros?
我想,如果没有宏,你怎么能在其中完成任何事情呢?
[5] Many languages have something called a macro.
[5] 许多语言都有一种称为宏的东西。
But Lisp macros are unique.
但 Lisp 宏是独一无二的。
And believe it or not, what they do is related to the parentheses.
不管你信不信,他们所做的事情都与括号有关。
The designers of Lisp didn't put all those parentheses in the language just to be different.
Lisp 的设计者在语言中放入所有这些括号并不是为了与众不同。
To the Blub programmer, Lisp code looks weird.
对于 Blub 程序员来说,Lisp 代码看起来很奇怪。
But those parentheses are there for a reason.
但这些括号的存在是有原因的。
They are the outward evidence of a fundamental difference between Lisp and other languages.
它们是 Lisp 与其他语言之间根本区别的外在证据。
Lisp code is made out of Lisp data objects.
Lisp 代码是由 Lisp 数据对象组成的。
And not in the trivial sense that the source files contain characters, and strings are one of the data types supported by the language.
这并不是说源文件包含字符,字符串是该语言支持的数据类型之一。
Lisp code, after it's read by the parser, is made of data structures that you can traverse.
Lisp 代码在被解析器读取后,由您可以遍历的数据结构组成。
If you understand how compilers work, what's really going on is
如果您了解编译器的工作原理,那么真正发生的事情是
not so much that Lisp has a strange syntax as that Lisp has no syntax.
与其说 Lisp 有奇怪的语法,不如说 Lisp 没有语法。
You write programs in the parse trees that get generated within the compiler when other languages are parsed.
您可以在解析树中编写程序,这些程序在解析其他语言时在编译器中生成。
But these parse trees are fully accessible to your programs.
但您的程序可以完全访问这些解析树。
You can write programs that manipulate them.
您可以编写操作它们的程序。
In Lisp, these programs are called macros.
在 Lisp 中,这些程序称为宏。
They are programs that write programs.
它们是编写程序的程序。
Programs that write programs?
写程序的程序?
When would you ever want to do that?
你什么时候愿意这样做?
Not very often, if you think in Cobol.
如果你用 Cobol 来思考的话,这种情况并不常见。
All the time, if you think in Lisp.
一直以来,如果你用 Lisp 思考的话。
It would be convenient here if I could give an example of a powerful macro, and say there!
如果我能给出一个强大的宏的例子,并在那里说的话,那就方便了!
how about that?
那怎么样?
But if I did, it would just look like gibberish to someone who didn't know Lisp; there isn't room here to explain everything you'd need to know to understand what it meant.
但如果我这样做,对于不懂 Lisp 的人来说,它看起来就像是胡言乱语;这里没有空间解释您需要了解的所有内容以了解其含义。
In Ansi Common Lisp I tried to move things along as fast as I could, and even so I didn't get to macros
在 Ansi Common Lisp 中,我尝试尽可能快地移动事物,但即便如此我也没有接触到宏
until page 160.
直到第 160 页。
But I think I can give a kind of argument that might be convincing.
但我想我可以给出一种可能令人信服的论证。
The source code of the Viaweb editor was probably about 20-25% macros.
Viaweb 编辑器的源代码大概有 20-25% 是宏。
Macros are harder to write than ordinary Lisp functions, and it's considered to be bad style to use them when they're not necessary.
宏比普通的 Lisp 函数更难编写,并且在不需要时使用它们被认为是不好的风格。
So every macro in that code is there because it has to be.
所以该代码中的每个宏都在那里,因为它必须在那里。
What that means is that at least 20-25% of the code in this
这意味着此中至少 20-25% 的代码
program is doing things that you can't easily do in any other language.
程序正在做一些用任何其他语言都无法轻松完成的事情。
However skeptical the Blub programmer might be about my claims for the mysterious powers of Lisp, this ought to make him curious.
不管 Blub 程序员对我关于 Lisp 神秘力量的说法可能持怀疑态度,这应该让他感到好奇。
We weren't writing this code for our own amusement.
我们编写这段代码并不是为了自娱自乐。
We were a tiny startup, programming as hard as we could in order to put technical barriers between us and our competitors.
我们是一家小型初创公司,尽我们所能地进行编程,以便在我们和竞争对手之间设置技术障碍。
A suspicious person might begin to wonder if there was some
一个多疑的人可能会开始怀疑是否有一些
correlation here.
这里的相关性。
A big chunk of our code was doing things that are very hard to do in other languages.
我们的代码的很大一部分是在做其他语言很难做的事情。
The resulting software did things our competitors' software couldn't do.
由此产生的软件可以完成我们竞争对手的软件无法做到的事情。
Maybe there was some kind of connection.
也许有某种联系。
I encourage you to follow that thread.
我鼓励您遵循该主题。
There may be more to that old man hobbling along on his crutches than meets the eye.
那个拄着拐杖一瘸一拐地走着的老人,背后的真相可能比表面上看到的要复杂得多。
Aikido for Startups But I don't expect to convince anyone ( over 25 )
适合初创公司的合气道 但我不希望说服任何人(超过 25 岁)
to go out and learn Lisp.
出去学习Lisp。
The purpose of this article is not to change anyone's mind, but to reassure people already interested in using Lisp-- people who know that Lisp is a powerful language, but worry because it isn't widely used.
本文的目的不是要改变任何人的想法,而是为了让那些已经对使用 Lisp 感兴趣的人放心——他们知道 Lisp 是一种强大的语言,但因为它没有被广泛使用而担心。
In a competitive situation, that's an advantage.
在竞争的情况下,这是一个优势。
Lisp's power is multiplied by the fact that your competitors don't get it.
Lisp 的力量因你的竞争对手无法理解这一事实而倍增。
If you think of using Lisp in a startup, you shouldn't worry that
如果您考虑在初创公司中使用 Lisp,那么您不必担心
it isn't widely understood.
它没有被广泛理解。
You should hope that it stays that way.
你应该希望它保持这种状态。
And it's likely to.
而且很可能会。
It's the nature of programming languages to make most people satisfied with whatever they currently use.
编程语言的本质就是让大多数人对他们当前使用的任何东西感到满意。
Computer hardware changes so much faster than personal habits that programming practice is usually ten to twenty years behind the processor.
计算机硬件的变化速度比个人习惯的变化速度快得多,以至于编程实践通常比处理器落后十到二十年。
At places like MIT they were writing programs in high-level languages in the early 1960s, but many companies continued
在 MIT 这样的地方,他们在 20 世纪 60 年代初就开始用高级语言编写程序,但许多公司仍在继续
to write code in machine language well into the 1980s.
直到 20 世纪 80 年代,人们才开始用机器语言编写代码。
I bet a lot of people continued to write machine language until the processor, like a bartender eager to close up and go home, finally kicked them out by switching to a risc instruction set.
我敢打赌,很多人会继续编写机器语言,直到处理器像渴望关门回家的酒保一样,最终通过切换到 RISC 指令集将他们踢出局。
Ordinarily technology changes fast.
通常技术变化很快。
But programming languages are different: programming languages are not just technology, but what programmers think in.
但编程语言不同:编程语言不仅仅是技术,更是程序员的思考方式。
They're half technology and half religion.[6]
它们一半是技术,一半是宗教。[6]
And so the median language, meaning whatever language the median programmer uses, moves as slow as an iceberg.
因此,中位语言(即中位程序员使用的任何语言)的移动速度就像冰山一样缓慢。
Garbage collection, introduced by Lisp in about 1960, is now widely considered to be a good thing.
垃圾收集由 Lisp 于 1960 年左右引入,现在被广泛认为是一件好事。
Runtime typing, ditto, is growing in popularity.
运行时类型,同上,越来越受欢迎。
Lexical closures, introduced by Lisp in the early 1970s, are now, just barely, on the radar screen.
词法闭包由 Lisp 在 20 世纪 70 年代初引入,现在才刚刚出现在雷达屏幕上。
Macros, introduced by Lisp in the mid 1960s, are still terra incognita.
Lisp 在 20 世纪 60 年代中期引入的宏仍然是未知领域。
Obviously, the median language has enormous momentum.
显然,中位语言有着巨大的动力。
I'm not proposing that you can fight this powerful force.
我并不是建议你可以对抗这种强大的力量。
What I'm proposing is exactly the opposite: that, like a practitioner of Aikido, you can use it against your opponents.
我的建议恰恰相反:就像合气道练习者一样,你可以用它来对抗你的对手。
If you work for a big company, this may not be easy.
如果你在一家大公司工作,这可能并不容易。
You will have a hard time convincing the pointy-haired boss to let you build things in Lisp, when he has just read in the paper that some other
你将很难说服尖头发的老板让你用 Lisp 构建东西,因为他刚刚在报纸上读到其他一些东西
language is poised, like Ada was twenty years ago, to take over the world.
就像二十年前的艾达一样,语言已经准备好接管世界。
But if you work for a startup that doesn't have pointy-haired bosses yet, you can, like we did, turn the Blub paradox to your advantage: you can use technology that your competitors, glued immovably to the median language, will never be able to match.
但如果你在一家还没有尖头发老板的初创公司工作,你就可以像我们一样,将 Blub 悖论转化为你的优势:你可以使用你的竞争对手永远无法比拟的技术,这些技术牢牢地粘在中间语言上。
If you ever do find yourself working for a startup, here's a handy tip for evaluating competitors.
如果您确实在一家初创公司工作,这里有一个评估竞争对手的实用技巧。
Read their job listings.
阅读他们的职位列表。
Everything
一切
else on their site may be stock photos or the prose equivalent, but the job listings have to be specific about what they want, or they'll get the wrong candidates.
他们网站上的其他内容可能是库存照片或同等的散文,但职位列表必须具体说明他们想要什么,否则他们会找到错误的候选人。
During the years we worked on Viaweb I read a lot of job descriptions.
在我们为 Viaweb 工作的这些年里,我读了很多职位描述。
A new competitor seemed to emerge out of the woodwork every month or so.
似乎每个月左右就会出现一个新的竞争对手。
The first thing I would do, after checking to see if they had a live online demo, was look at their job listings.
在检查他们是否有现场在线演示后,我要做的第一件事就是查看他们的职位列表。
After a
经过一个
couple years of this I could tell which companies to worry about and which not to.
经过几年的努力,我可以判断哪些公司值得担心,哪些公司不必担心。
The more of an IT flavor the job descriptions had, the less dangerous the company was.
职位描述的 IT 风格越多,公司的危险性就越小。
The safest kind were the ones that wanted Oracle experience.
最安全的类型是那些想要 Oracle 经验的人。
You never had to worry about those.
你永远不必担心这些。
You were also safe if they said they wanted C++ or Java developers.
如果他们说他们想要 C++ 或 Java 开发人员,你也是安全的。
If they wanted Perl or Python programmers, that would be a bit frightening-- that's starting to sound like a company
如果他们想要 Perl 或 Python 程序员,那就有点可怕了——这听起来像一家公司
where the technical side, at least, is run by real hackers.
至少技术方面是由真正的黑客运行的。
If I had ever seen a job posting looking for Lisp hackers, I would have been really worried.
如果我曾经看到过招聘 Lisp 黑客的招聘信息,我会非常担心。
Notes [1] Viaweb at first had two parts: the editor, written in Lisp, which people used to build their sites, and the ordering system, written in C, which handled orders.
注释 [1] Viaweb 最初有两个部分:用 Lisp 编写的编辑器,人们用它来构建网站;以及用 C 编写的订购系统,用于处理订单。
The first version was mostly Lisp, because the ordering system was small.
第一个版本主要是 Lisp,因为订购系统很小。
Later we added two
后来我们又加了两个
more modules, an image generator written in C, and a back-office manager written mostly in Perl.
更多模块,用 C 编写的图像生成器,以及主要用 Perl 编写的后台管理器。
In January 2003, Yahoo released a new version of the editor written in C++ and Perl.
2003 年 1 月,雅虎发布了用 C++ 和 Perl 编写的新版本编辑器。
It's hard to say whether the program is no longer written in Lisp, though, because to translate this program into C++ they literally had to write a Lisp interpreter: the source files of all the page-generating templates are still, as far as I
不过,很难说这个程序是否不再用 Lisp 编写,因为要将这个程序翻译成 C++,他们实际上必须编写一个 Lisp 解释器:据我所知,所有页面生成模板的源文件仍然存在。
know, Lisp code.
知道,Lisp 代码。
(See Greenspun's Tenth Rule .) [2] Robert Morris says that I didn't need to be secretive, because even if our competitors had known we were using Lisp, they wouldn't have understood why: "If they were that smart they'd already be programming in Lisp." [3] All languages are equally powerful in the sense of being Turing equivalent, but that's not the sense of the word programmers care
(参见 Greenspun 的第十条规则。) [2] Robert Morris 说我不需要保密,因为即使我们的竞争对手知道我们在使用 Lisp,他们也不会理解为什么:“如果他们那么聪明,他们就已经在用 Lisp 编程了。” [3] 所有语言在图灵等价意义上都同样强大,但这不是程序员关心的这个词的含义
about.
关于。
(No one wants to program a Turing machine.) The kind of power programmers care about may not be formally definable, but one way to explain it would be to say that it refers to features you could only get in the less powerful language by writing an interpreter for the more powerful language in it.
(没有人愿意对图灵机进行编程。)程序员所关心的那种强大功能可能无法正式定义,但解释它的一种方法是,它指的是只有通过为功能更强大的语言编写解释器才能在功能较弱的语言中获得的功能。
If language A has an operator for removing spaces from strings and language B doesn't, that probably doesn't make A more powerful, because you
如果语言 A 有一个用于从字符串中删除空格的运算符,而语言 B 没有,那么这可能不会使 A 更强大,因为你
can probably write a subroutine to do it in B.
也许可以在 B 中编写一个子例程来执行此操作。
But if A supports, say, recursion, and B doesn't, that's not likely to be something you can fix by writing library functions.
但是,如果 A 支持递归,而 B 不支持,那么您不太可能通过编写库函数来解决这个问题。
[4] Note to nerds: or possibly a lattice, narrowing toward the top; it's not the shape that matters here but the idea that there is at least a partial order.
[4] 书呆子注意:或者可能是一个格子,朝顶部变窄;这里重要的不是形状,而是至少存在部分顺序的想法。
[5] It is a bit misleading to treat macros as a separate feature.
[5] 将宏视为一个单独的功能有点误导。
In practice their usefulness is greatly enhanced by other Lisp
在实践中,其他 Lisp 大大增强了它们的实用性
features like lexical closures and rest parameters.
诸如词法闭包和剩余参数之类的功能。
[6] As a result, comparisons of programming languages either take the form of religious wars or undergraduate textbooks so determinedly neutral that they're really works of anthropology.
[6] 因此,编程语言的比较要么采取宗教战争的形式,要么采取绝对中立的本科教科书的形式,以至于它们实际上是人类学的著作。
People who value their peace, or want tenure, avoid the topic.
珍视和平或想要终身职位的人会回避这个话题。
But the question is only half a religious one; there is something there worth studying, especially if you want to design new languages.
但这个问题只是半个宗教问题;那里有一些值得研究的东西,特别是如果你想设计新的语言。