Lisp的根源
Lisp的根源
2001年5月
(我写这篇文章是为了帮助自己准确理解McCarthy的发现。你不需要知道这些东西来用Lisp编程,但对于想要理解Lisp本质的人来说——无论是从起源还是语义核心的角度——这应该是有帮助的。Lisp拥有这样一个核心是其区别于其他语言的特征之一,也是为什么与其他语言不同,Lisp有方言的原因。)
1960年,John McCarthy发表了一篇非凡的论文,他在编程领域做了类似于欧几里得对几何学所做的事情。他展示了,给定一些简单的操作符和函数表示法,如何构建一个完整的编程语言。他称这种语言为Lisp,即”列表处理”,因为他的一个关键想法是使用一种称为列表的简单数据结构来同时表示代码和数据。
值得理解McCarthy的发现,不仅作为计算机史上的里程碑,而且作为我们时代编程发展方向的模型。在我看来,迄今为止有两个真正干净、一致的编程模型:C模型和Lisp模型。这两个模型似乎像是高地,之间是沼泽般的低地。随着计算机变得越来越强大,正在开发的新语言一直在稳步向Lisp模型移动。过去20年来,新编程语言的一个流行配方是采用C计算模型,然后零散地添加从Lisp模型中提取的部分,如运行时类型和垃圾收集。
在这篇文章中,我将尝试用最简单的术语解释McCarthy的发现。重点不仅仅是了解某人40年前想出的一个有趣的理论结果,而是展示语言的发展方向。Lisp的不寻常之处——事实上,Lisp的定义性特征——是它可以用自身来编写。要理解McCarthy的意思,我们将追溯他的步骤,将他的数学表示法转换为运行的Common Lisp代码。
注意:这似乎是一篇较长文章的介绍或摘要。全文可能作为PostScript文件提供,在原始来源中链接为”Complete Article (Postscript)”。
相关链接:
- What Made Lisp Different
- The Code
- 中文翻译
- 日语翻译
- 葡萄牙语翻译
- 韩语翻译
The Roots of Lisp
May 2001
(I wrote this article to help myself understand exactly what McCarthy discovered. You don’t need to know this stuff to program in Lisp, but it should be helpful to anyone who wants to understand the essence of Lisp — both in the sense of its origins and its semantic core. The fact that it has such a core is one of Lisp’s distinguishing features, and the reason why, unlike other languages, Lisp has dialects.)
In 1960, John McCarthy published a remarkable paper in which he did for programming something like what Euclid did for geometry. He showed how, given a handful of simple operators and a notation for functions, you can build a whole programming language. He called this language Lisp, for “List Processing,” because one of his key ideas was to use a simple data structure called a list for both code and data.
It’s worth understanding what McCarthy discovered, not just as a landmark in the history of computers, but as a model for what programming is tending to become in our own time. It seems to me that there have been two really clean, consistent models of programming so far: the C model and the Lisp model. These two seem points of high ground, with swampy lowlands between them. As computers have grown more powerful, the new languages being developed have been moving steadily toward the Lisp model. A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection.
In this article I’m going to try to explain in the simplest possible terms what McCarthy discovered. The point is not just to learn about an interesting theoretical result someone figured out forty years ago, but to show where languages are heading. The unusual thing about Lisp — in fact, the defining quality of Lisp — is that it can be written in itself. To understand what McCarthy meant by this, we’re going to retrace his steps, with his mathematical notation translated into running Common Lisp code.
Note: This appears to be an introduction or abstract for a longer article. The full text may be available as a PostScript file linked as “Complete Article (Postscript)” in the original source.
Related Links:
- What Made Lisp Different
- The Code
- Chinese Translation
- Japanese Translation
- Portuguese Translation
- Korean Translation