The foolishness of "natural language programming" (1978)

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

On the foolishness of “natural language programming”.

关于“自然语言编程”的愚蠢之处。

Since the early days of automatic computing we have had people that have felt it as a shortcoming that programming required the care and accuracy that is characteristic for the use of any formal symbolism. They blamed the mechanical slave for its strict obedience with which it carried out its given instructions, even if a moment’s thought would have revealed that those instructions contained an obvious mistake. “But a moment is a long time, and thought is a painful process.” (A.E.Housman). They eagerly hoped and waited for more sensible machinery that would refuse to embark on such nonsensical activities as a trivial clerical error evoked at the time.

自自动计算技术诞生之初,就有人认为编程需要像使用任何形式符号系统那样保持谨慎和精确,这是一种缺陷。他们指责机械奴隶严格执行指令,即便稍加思考就能发现这些指令中包含明显的错误。“但片刻也是漫长的时光,而思考是一个痛苦的过程。”(A.E.豪斯曼)。他们热切地希望并等待着更明智的机器,能够拒绝执行诸如琐碎的笔误所引发的荒谬活动。

Machine code, with its absence of almost any form of redundancy, was soon identified as a needlessly risky interface between man and machine. Partly in response to this recognition so-called “high-level programming languages” were developed, and, as time went by, we learned to a certain extent how to enhance the protection against silly mistakes. It was a significant improvement that now many a silly mistake did result in an error message instead of in an erroneous answer. (And even this improvement wasn’t universally appreciated: some people found error messages they couldn’t ignore more annoying than wrong results, and, when judging the relative merits of programming languages, some still seem to equate “the ease of programming” with the ease of making undetected mistakes.) The (abstract) machine corresponding to a programming language remained, however, a faithful slave, i.e. the nonsensible automaton capable of carrying out nonsensical instructions. Programming remained the use of a formal symbolism and, as such, continued to require the care and accuracy required before.

机器代码几乎没有任何形式的冗余,很快被认为是一种人机之间不必要的风险接口。部分为了响应这种认识,所谓的“高级编程语言”被开发出来,随着时间的推移,我们在一定程度上学会了如何加强对愚蠢错误的防范。这是一个重大的进步,现在许多愚蠢的错误会导致错误信息,而不是错误的答案。(即使这种改进也没有得到普遍赞赏:有些人发现无法忽略的错误信息比错误的结果更令人恼火,而在评判编程语言的相对优劣时,有些人似乎仍然将“编程的简易性”等同于制造未被发现的错误的简易性。)然而,与编程语言相对应的(抽象)机器仍然是一个忠实的奴隶,即能够执行荒谬指令的无知自动机。编程仍然是形式符号的使用,因此,它继续需要以前所要求的谨慎和精确。

In order to make machines significantly easier to use, it has been proposed (to try) to design machines that we could instruct in our native tongues. this would, admittedly, make the machines much more complicated, but, it was argued, by letting the machine carry a larger share of the burden, life would become easier for us. It sounds sensible provided you blame the obligation to use a formal symbolism as the source of your difficulties. But is the argument valid? I doubt.

为了使机器使用起来显著简便,有人提议(尝试)设计出我们可以用母语进行指令的机器。诚然,这会使机器变得复杂得多,但有人认为,通过让机器承担更多的负担,我们的生活会变得更轻松。如果你将使用形式符号的义务视为困难的根源,这听起来确实合理。但这个论点成立吗?我表示怀疑。

We know in the meantime that the choice of an interface is not just a division of (a fixed amount of) labour, because the work involved in co-operating and communicating across the interface has to be added. We know in the meantime —from sobering experience, I may add— that a change of interface can easily increase at both sides of the fence the amount of work to be done (even drastically so). Hence the increased preference for what are now called “narrow interfaces”. Therefore, although changing to communication between machine and man conducted in the latter’s native tongue would greatly increase the machine’s burden, we have to challenge the assumption that this would simplify man’s life.

与此同时,我们知道接口的选择不仅仅是(固定数量的)劳动分工,因为跨接口合作和沟通所涉及的工作必须被计入。与此同时,我们从清醒的经验中得知,接口的改变很容易增加双方需要完成的工作量(甚至大幅增加)。因此,人们越来越倾向于现在所谓的“窄接口”。因此,尽管改为使用人类母语进行人机沟通会大大增加机器的负担,但我们必须质疑这种做法会简化人类生活的假设。

A short look at the history of mathematics shows how justified this challenge is. Greek mathematics got stuck because it remained a verbal, pictorial activity, Moslem “algebra”, after a timid attempt at symbolism, died when it returned to the rhetoric style, and the modern civilized world could only emerge —for better or for worse— when Western Europe could free itself from the fetters of medieval scholasticism —a vain attempt at verbal precision!— thanks to the carefully, or at least consciously designed formal symbolisms that we owe to people like Vieta, Descartes, Leibniz, and (later) Boole.

简要回顾数学史,就会发现这种质疑是多么合理。希腊数学陷入停滞,因为它始终是一种口头的、图画式的活动;穆斯林“代数”在尝试了符号化之后,因回归修辞风格而消亡;现代文明世界之所以能够出现——无论好坏——是因为西欧能够摆脱中世纪经院哲学的束缚(那是一种对语言精确性的徒劳尝试!),这要归功于我们应归功于韦达、笛卡尔、莱布尼茨以及(后来)布尔等人的精心设计或至少是有意识设计的形式符号系统。

The virtue of formal texts is that their manipulations, in order to be legitimate, need to satisfy only a few simple rules; they are, when you come to think of it, an amazingly effective tool for ruling out all sorts of nonsense that, when we use our native tongues, are almost impossible to avoid.

形式文本的优点在于,它们的操纵为了合法,只需满足少数几条简单的规则;当你仔细思考时,它们是一种极其有效的工具,可以排除各种各样的荒谬,而当我们使用母语时,这些荒谬几乎是无法避免的。

Instead of regarding the obligation to use formal symbols as a burden, we should regard the convenience of using them as a privilege: thanks to them, school children can learn to do what in earlier days only genius could achieve. (This was evidently not understood by the author that wrote —in 1977— in the preface of a technical report that “even the standard symbols used for logical connectives have been avoided for the sake of clarity”. The occurrence of that sentence suggests that the author’s misunderstanding is not confined to him alone.) When all is said and told, the “naturalness” with which we use our native tongues boils down to the ease with which we can use them for making statements the nonsense of which is not obvious.

我们不应将使用形式符号的义务视为负担,而应将使用它们的便利视为一种特权:多亏了它们,学童们可以学会过去只有天才才能完成的事情。(显然,1977年在一份技术报告序言中写道“为了清晰起见,甚至避免使用逻辑连接词的标准符号”的作者并没有理解这一点。这句话的出现表明,该作者的误解并非他一人所独有。)归根结底,我们使用母语的“自然性”归结为我们能够轻易地用它们做出其荒谬性并不明显的陈述。

It may be illuminating to try to imagine what would have happened if, right from the start our native tongue would have been the only vehicle for the input into and the output from our information processing equipment. My considered guess is that history would, in a sense, have repeated itself, and that computer science would consist mainly of the indeed black art how to bootstrap from there to a sufficiently well-defined formal system. We would need all the intellect in the world to get the interface narrow enough to be usable, and, in view of the history of mankind, it may not be overly pessimistic to guess that to do the job well enough would require again a few thousand years.

试着想象一下,如果从一开始我们的母语就是信息处理设备输入和输出的唯一载体,会发生什么,这可能会很有启发性。我的深思熟虑的猜测是,历史在某种意义上会重演,计算机科学将主要由如何从那里引导到一个足够定义明确的形式系统的“黑魔法”组成。我们需要世界上所有的智慧才能使接口窄到足以使用,考虑到人类的历史,猜测要做好这项工作可能还需要几千年,这或许并不算过于悲观。

Remark. As a result of the educational trend away from intellectual discipline, the last decades have shown in the Western world a sharp decline of people’s mastery of their own language: many people that by the standards of a previous generation should know better, are no longer able to use their native tongue effectively, even for purposes for which it is pretty adequate. (You have only to look at the indeed alarming amount of on close reading meaningless verbiage in scientific articles, technical reports, government publications etc.) This phenomenon —known as “The New Illiteracy”— should discourage those believers in natural language programming that

备注。由于教育趋势背离了智力训练,过去几十年里,西方世界人们对自身语言的掌握能力急剧下降:许多按前一代人的标准本应表现更好的人,已经无法有效地使用他们的母语,即使是用于那些它完全能够胜任的目的。(你只需看看科学文章、技术报告、政府出版物等中那些仔细阅读后毫无意义的冗词赘句,数量之多令人震惊。)这种被称为“新文盲”的现象,应该会让那些自然语言编程的信徒们感到灰心,因为……