The Next 700 Programming Languages

The Next 700 Programming Languages

P. J. Landin

Univac Division of Sperry Rand Corp., New York, New York

"... today... 1,700 special programming languages used to 'com- municate' in over 700 application areas."

--Computer Software Issues,

an American Mathematical Association Prospectus, July 1965.

A family of unimplemented computing languages is described that is intended to span differences of application area by a unified framework. This framework dictates the rules about the uses of user-coined names, and the conventions about characterizing functional relationships. Within this framework the design of a specific language splits into two independent parts. One is the choice of written appearances of programs (or more generally, their physical representation). The other is the choice of the abstract entities (such as numbers, character-strings, lists of them, functional relations among them) that can be referred to in the language.

The system is biased towards "expressions" rather than "statements." It includes a nonprocedural (purely functional) subsystem that aims to expand the class of users' needs that can be met by a single print-instruction, without sacrificing the important properties that make conventional right-hand-side expressions easy to construct and understand.

🪶 🦉🦊🐿 🪶

该文档描述了一个未实现的计算语言家族,旨在通过一个统一框架跨越不同应用领域的差异。该框架规定了关于用户创造的名称的使用规则,以及关于描述功能关系的惯例。在这个框架内,特定语言的设计分为两个独立部分。一个是程序的书面表现形式(或更广泛地说,它们的物理表示)的选择。另一个是可以在语言中引用的抽象实体(如数字、字符字符串、它们的列表、它们之间的功能关系)的选择。

该系统偏向于"表达式"而不是"语句"。它包括一个非程序化(纯函数式)的子系统,旨在扩展用户的需求类别,这些需求可以通过单个打印指令来满足,而不会牺牲使传统右侧表达式易于构建和理解的重要属性

1. Introduction

Most programming languages are partly a way of expressing things in terms of other things and partly a basic set of given things. The IsWIM (If you See What I Mean) system is a byproduct of an attempt to disentangle these two aspects in some current languages.

This attempt has led the author to think that many linguistic idiosyneracies are concerned with the former rather than the latter, whereas aptitude for a particular class of tasks is essentially determined by the latter rather than the former. The conclusion follows that many language characteristics are irrelevant to the alleged problem orientation.

IsWIM is an attempt at a general purpose system for describing things in terms of other things, that can be problem-oriented by appropriate choice of "primitives." So it is not a language so much as a family of languages, of which each member is the result of choosing a set of primitives. The possibilities concerning this set and what is needed to specify such a set are discussed below.

IsWIM is not alone in being a family, even after mere syntactic variations have been discounted (see Section 4). In practice, this is true of most languages that achieve more than one implementation, and if the dialects are well disciplined, they might with luck be characterized as differences in the set of things provided by the library or operating system. Perhaps had ALGOL 60 been launched as a family instead of proclaimed as a language, it would have fielded some of the less relevant criticisms of its deficiencies

🪶 🦉🦊🐿 🪶

大多数编程语言在某种程度上是一种以其他事物的形式来表述事物的方式,同时也是一套基础的给定事物。ISWIM(如果你明白我在说什么)系统是尝试在一些当前语言中解开这两个方面的副产品。

这种尝试让作者认为,许多语言特性更多地与前者相关,而非后者,而对特定类别任务的适应性基本上由后者决定而非前者。所以得出的结论是,很多语言特性与所谓的问题导向无关。

ISWIM 是一种尝试,旨在通过选择适当的“原语”来描述事物与其他事物的关联性,从而实现面向问题的描述系统。因此,与其说它是一种语言,不如说是一种语言家族,其中每个成员都是选择一组原语的结果。下面讨论了与该集合有关的可能性以及指定此类集合所需的内容。

ISWIM 并不是唯一一个家族,即使在剔除了纯粹的语法变体之后(见第4节)。实际上,这对于实现了不止一种实现的大多数语言来说都是真实的,如果方言有很好的规范,那么它们可能被描述为由库或操作系统提供的一组事物的差异。也许如果 ALGOL 60 被作为一个家族推出,而不是被宣布为一种语言,它可能会避免一些不太相关的批评。

At first sight the facilities provided in IsWIM will appear comparatively meager. This appearance will be especially misleading to someone who has not appreciated how much of current manuals are devoted to the explanation of common (i.e., problem-orientation independent) logical structure rather than problem-oriented specialties. For example, in almost every language a user can coin names, obeying certain rules about the contexts in which the name is used and their relation to the textual segments that introduce, define, declare, or otherwise constrain its use. These rules vary considerably from one language to another, and frequently even within a single language there may be different conventions for different classes of names, with near-analogies that come irritatingly close to being exact. (Note that restrictions on what names can be coined also vary, but these are trivial differences. When they have any logical significance it is likely to be pernicious, by leading to puns such as ALGOL'S integer labels.)

So rules about user-coined names is an area in which we might expect to see the history of computer applications give ground to their logic. Another such area is in specifying functional relations. In fact these two areas are closely related since any use of a user-coined name implicitly involves a functional relation; e.g., compare

$ x(x+a) $

where $x = b -4- 2c$

$ f(b+2c) $

where $f(x) = x(x+a) $

ISWIM is thus part. programming language and part program for research. A possible first step in the research program is 1700 doctoral theses called "A Correspondence between x and Church's X-notation.

🪶 🦉🦊🐿 🪶

乍一看,ISWIM 提供的功能会显得相对较少。这种观点将尤其误导那些还没有意识到当前手册中有多少是专门用来解释常见(即,与问题导向无关)的逻辑结构,而非问题导向的特殊性的人。例如,在几乎每一种语言中,用户都可以创造名称,在名称使用的上下文以及它们和介绍、定义、声明或者以其他方式限制其使用的文本段落的关系方面遵循某些规则。这些规则从一种语言到另一种语言会有很大的差异,甚至在一种语言内也可能存在不同类别的名称的不同惯例,近似的类比会让人烦躁不安,因为它们接近于完全一致。(请注意,可以创造的名称的限制也会有所不同,但这些都是微不足道的差异。当它们具有任何逻辑意义的时候,可能会引起恶劣的效果,比如导致像 ALGOL 的整数标签那样的双关语。)

因此,关于用户创造的名称的规则是我们可以预期看到计算机应用程序的历史让位于其逻辑的领域之一。另一个这样的领域是在指定功能关系方面。事实上,这两个领域是密切相关的,因为任何使用用户创造的名称都隐含了一个功能关系。例如,比较一下。

$ x(x+a) $

where $ x=b-4-2c $

$ f(b+2c) $

where $ f(x)=x(x+a) $

因此,ISWIM 是编程语言的一部分,也是研究项目的一部分。研究项目的可能的第一步是 1700 篇名为“ x 与 Church's X-记法之间的对应关系”的博士论文。

2、The where-Notation

In ordinary mathematical communication, these uses of 'where' require no explanation. Nor do the following:

$ f(b+2c) + f(2b-c) $

where $ f(x) = x(x+a) $

$ f(b+2c) + f(2b-c) $

where $ f(x) = x(x+a) $

and $b=\mu/(\mu+1)$

and $c=\nu/(\nu+1)$

$g(f$ where $f(x)=ax^{2}+bx+c$,

$\mu/(\mu+1)$

$\nu/(\nu+1))$

where $g(f,p,q) = f(p+2q, 2p-q)$

A phrase of the form 'where definition' will be called a "where-clause." An expression of the form 'expression where-clause' is a "where-expression." Its two principal components are called, respectively, its "main clause" and its "supporting definition." To put 'where' into a programming language the following questions need answers

🪶 🦉🦊🐿 🪶

在普通的数学交流中,这些“where”的使用不需要解释。以下情况也不需要解释:

$ f(b+2c) + f(2b-c) $

where $ f(x) = x(x+a) $

$ f(b+2c) + f(2b-c) $

where $ f(x) = x(x+a) $

and $b=\mu/(\mu+1)$

and $c=\nu/(\nu+1)$

$g(f$ where $f(x)=ax^{2}+bx+c$,

$\mu/(\mu+1)$

$\nu/(\nu+1))$

where $g(f,p,q) = f(p+2q, 2p-q)$

一个形式为 “where definition” 的短语将被称为 “where子句”。一个形式为 “expression where-clause” 的表达式是一个 “where表达式”。它的两个主要组成部分分别被称为其“主句”和其“支持定义”。要将 “where” 放入编程语言中,需要回答以下问题:

Linguistic Structure. What structures of expression can appropriately be qualified by a where-clause, e.g., conditional expressions, operand-listings, statements, declarations, where-expressions?

Likewise, what structures of expression can appropriately be written as the right-hand side (rhs) of a supporting definition? What contexts are appropriate for a where-expression, e.g., as an arm of a conditional expression, an operator, the main-clause of a where-expression, the left-hand side (lhs) of a supporting definition, the rhs of a supporting definition?

Syntax. Having answered the above questions, what are the rules for writing the acceptable configurations unambiguously? E.g., where are brackets optional or obligatory? or other punctuation? or line breaks? or indentation? Note the separation of decisions about structure from decisions about syntax. (This is not a denial that language designers might iterate, like hardware designers who distinguish levels of hardware design.)

Semantic Constraints on Linguistic Structure. In the above examples each main clause was a numerical expression; i.e., given appropriate meanings for the various identifiers in it, it denoted a number. What other kinds of meaning are appropriate for a mainclause, e.g., arrays, functions, structure descriptions, print-formats?

Likewise what kinds of meaning are appropriate for rhs's of supporting definitions? Notice there is not a third question analogous to the third question above under linguistic structure. This is because a where-expression must mean the same kind of thing as its main clause and hence raises no new question concerning what contexts are meaningful. Notice also that the questions about meaning are almost entirely independent of those about structure. They depend on classifying expressions in two ways that run across each other.

🪶 🦉🦊🐿 🪶

语言结构。哪些表达式结构可以恰当地被一个 where 子句所修饰,例如,条件表达式,操作数列表,语句,声明,where 表达式?

同样,哪些表达式的结构可以适当地作为支持定义的右侧(rhs)编写?哪些上下文适合用where表达式,例如,作为条件表达式的分支,操作符,where 表达式的主从句,支持定义的左侧(lhs),支持定义的 rhs ?

语法。回答了上述问题后,如何写出可接受的配置的明确规则是什么?例如,括号是可选还是必需的?或者其他标点符号?或者换行符?或者缩进?请注意将关于结构的决定与关于语法的决定分开。(这并不是否认语言设计者可能会像区分不同级别的硬件设计的硬件设计者一样进行迭代。)

对语言结构的语义约束。在上述例子中,每个主从句都是一个数值表达式;也就是说,给定其中各种标识符的适当含义,它表示一个数字。主从句适合什么其他类型的含义,例如,数组,函数,结构描述,打印格式?

同样,支持定义的 rhs 适合哪种类型的含义?注意,没有与上述语言结构下的第三个问题类似的第三个问题。这是因为 where 表达式必须表示与其主从句相同类型的东西,因此不会引起关于哪些上下文是有意义的新问题。还要注意,关于意义的问题几乎完全独立于关于结构的问题。它们依赖于以彼此交叉的两种方式对表达式进行分类

Outcome. What is the outcome of the more recondite structural configurations among those deemed admissible, e.g. mixed nests of where-expressions, function definitions, conditional expressions, etc.?

Experimental programming has led the author to think that there is no configuration, however unpromising it might seem when judged cold, that will not turn up quite naturally. Furthermore, some configurations of 'where' that might first appear to reflect somewhat pedantic distinctions, in fact provide close matches for current language features such as name/value and own (see [2, 3]).

All these questions are not answered in this paper. The techniques for answering them are outlined in Section 4

One other issue arises when 'where' is added to a programming language-types and specifications. A method of expressing these functionally is explained in [2]. It amounts to using named transfer-functions instead of class names like integer, i.e., writing

where $ n = round(n) $

instead of the specification

integer $ n $

Thus the use of functional notation does not jeopardize the determination of type from textual evidence

🪶 🦉🦊🐿 🪶

结果。在那些被认为可接受的结构配置中,更难以理解的结构配置的结果是什么?例如混合的where表达式、函数定义、条件表达式等的嵌套结构。

实验编程使作者认为,无论某种配置看起来多么不具前景,只要进行实际尝试,它都会自然地出现。此外,一些初看起来可能显得有些学究气的'where'配置,实际上与当前的语言特性(如名称/值和own)非常匹配(参见[2, 3])。

所有这些问题在本文中都没有得到解答。回答它们的技术在第4节中有所概述。

当'where'添加到编程语言中时,还会出现其他问题——类型和规范。在[2]中解释了这些功能性表达的方法。这就像使用命名转移函数而不是像整数一样的类名,即,编写

where $ n = round(n) $

而不是类型

integer $ n $

因此,使用函数符号并不会危及从文本证据中确定类型。

3. Physical ISWIM and :Logical ISWIM

Like ALGOL 60, ISWIM has no prescribed physical appearance. ALGOL 60'S designers sought to avoid commitment to any particular sets of characters or type faces. Accordingly they distinguish between "publication language," "reference language" and "hardware languages." Of these the reference language was the standard and was used in the report itself whenever pieces of ALGOL 60 occurred. Publication and hardware languages are transliterations of the reference language, varying according to the individual taste, needs and physical constraints on available type faces and characters.

Such variations are different physical representations of a single abstraction, whose most faithful physical representation is the reference language. In describing ISWIM we distinguish an abstract language called "logical ISWIM," whose texts are made up of "textual elements," characterized without commitment to a particular physical representation. There is a physical representation suitable for the medium of this report, and used for presenting each piece of ISWIM that occurs in this report. So this physical representation corresponds to "reference ALGOL 60," and is called "reference ISWIM," or the "ISWIM reference representation," or the "ISWIM reference language."

To avoid imprecision one should never speak just of "ISWIM," but always of "logical IswxM" or of "such-and-such physical ISWlM." However, in loose speech, where the precise intention is clear or unimportant, we refer to "ISWlM" without qualification. We aim at a more formal relation between physical and logical languages than was the case in the ALGOL 60. This is necessary since we wish to systematize and mechanize the use of different physical representations.

🪶 🦉🦊🐿 🪶

就像 ALGOL 60 一样,ISWIM 没有规定的物理表现形式。ALGOL 60 的设计者们力图避免对任何特定的字符集或字体类型的承诺。因此,他们区分了“出版语言”,“参考语言”和“硬件语言”。其中,参考语言是标准,且在报告本身中,每当出现 ALGOL 60 的部分时,都会使用该语言。出版和硬件语言是参考语言的转写,它们根据个人品味、需求以及可用字体和字符的物理限制而变化。

这些变化是单个抽象的不同物理表示形式,其最忠实的物理表示形式是参考语言。在描述 ISWIM 时,我们区分了一个称为“逻辑 ISWIM ”的抽象语言,其文本由“文本元素”组成,不依赖于特定的物理表示形式。对于本报告的媒介来说,存在一种适合的物理表示形式,用于呈现本报告中出现的每个 ISWIM 片段。因此,这种物理表示形式对应于“参考 ALGOL 60 ”,并被称为“参考 ISWIM ”或“ ISWIM 参考表示形式”或“ ISWIM 参考语言”。

为了避免不准确,我们永远不应该只谈论“ ISWIM ”,而应该总是谈论“逻辑 ISWXM ”或“某种物理 ISWIM ”。然而,在松散的口语中,如果精确的意图明确或不重要,我们可以不加限定地提到“ ISWIM”。我们的目标是在物理语言和逻辑语言之间建立比 ALGOL 60 更正式的关系。我们需要这样做,因为我们希望系统化和机械化地使用不同的物理表示。

4. Four Levels of Abstraction

The "physical/logical" terminology is often used to distinguish features that are a fortuitous consequence of physical conditions from features that are in some sense more essential. This idea is carried further by making a similar distinction among the "more essential" features. In fact ISWIM is presented here as a four-level concept comprising the following:

(1) physical ISWIM'S, of which one is the reference language and others are various publication and hardware languages (not described here)

(2) logical ISWIM, which is uncommitted as to character sets and type faces, but committed as to the sequence of textual elements, and the grammatical rules for grouping them, e.g., by parentheses, indentation and precedence relations.

(3) abstract ISWIM, which is uncommitted as to the grammatical rules of sequence and grouping, but committed as to the grammatical categories and their nesting structure. Thus abstract Iswim is a “tree language’ of which logical ISWIM is one linearization

(4) applicative expressions (AEs), which constitute another tree language, structurally more austere than abstract ISWIM,and providing certain basic grammatical categories in terms of which all of Iswim's more numerous categories can be expressed.

The set of acceptable texts of a physical Iswim is specified by the relations between 1 and 2, and between 2 and 3. The outcome of each text is specified by these relations, together with a "frame of reference", i.e., a rule that associates a meaning with each of a chosen set of identifiers

These are the things that vary from one member of our language family to the next. The specification of the family is completed by the relation between abstract ISWIM and AEs, together with an abstract machine that interpret AEs. These elements are the same for all members of the family and are not discussed in this paper (see [1, 2, 4]).

The relationship between physical ISWIM and logical ISWIM is fixed by saying what physical texts represent each logical element, and also what layout is permitted in stringing them together. The relationship between logical ISWIM and abstract ISWIM is fixed by a formal grammar not unlike the one in the ALGOL 60 report, together with astatement connecting the phrase categories with the abstract grammatical categories

These two relations cover what is usually called the “syntax’ or “grammar’ of a language. In this paper syntax is not discussed beyond a few general remarks anda few examples whose meaning should be obvious

The relationship between abstract ISWIM and AEs is fixed by giving the form of AE equivalent to each abstract ISWIM grammatical category. It happens that these latter include a subset that exactly matches AEs. Hence this link in our chain of relations is roughly a mapping of ISWIM into an essential kernel’ of ISWIM, of which all the rest is mere decoration.

🪶 🦉🦊🐿 🪶

“物理/逻辑”术语经常用来区分那些偶然由物理条件产生的特性和在某种意义上更本质的特性。这个理念在区分“更本质”特性中得到了进一步体现。事实上,ISWIM在这里被作为一个四级概念展现,包括以下几点:

  1. 物理ISWIM,其中一个是参考语言,其他的是各种出版和硬件语言(这里没有描述)

  2. 逻辑ISWIM,它不依赖于字符集和字体,但依赖于文本元素的顺序和将它们分组的语法规则,例如使用括号、缩进和优先关系

  3. 抽象ISWIM,它不依赖于顺序和分组的语法规则,但依赖于语法类别及其嵌套结构。因此,抽象ISWIM是一种“树形语言”,逻辑ISWIM是其一种线性表示形式

  4. 应用表达式(AEs),它们构成了另一种树形语言,结构上比抽象ISWIM更为简洁,并提供了一些基本的语法类别,可以根据这些类别表达ISWIM中更多的类别。

一个物理 ISWIM 的接受文本集是由 1 和 2 之间的关系,以及 2 和 3 之间的关系来规定的。每个文本的结果由这些关系及一个“参照系”规定,参照系指的是一个规则,它将每个选定的标识符集合的意义关联起来

这些是从我们的语言家族的一个成员到另一个成员之间变化的事物。通过抽象 ISWIM 和 AEs 之间的关系以及解释 AEs 的抽象机器来完成对家族的规范。这些元素对于家族的所有成员都是相同的,并且本文中没有讨论(请参见[1, 2, 4])

物理 ISWIM 和逻辑 ISWIM 之间的关系是通过说明哪些物理文本表示每个逻辑元素以及在将它们连接在一起时允许的布局来固定的。逻辑 ISWIM 和抽象 ISWIM 之间的关系是通过类似于 ALGOL 60 报告中使用的正式语法以及将短语类别与抽象语法类别联系起来的语句来固定的

这两个关系涵盖了通常被称为语言的“语法”或“句法”。在本文中,除了一些一般性的评论和几个应该很明显的例子之外,不会讨论语法

抽象 ISWIM 和 AEs 之间的关系是通过给出与每个抽象 ISWIM 语法类别等价的 AE 的形式来固定的。后者包括了一个与 AEs 完全匹配的子集。因此,在我们的关系链中,这个链接大致是将 ISWIM 映射到一个核心的“内核”,其余的都是装饰品

5. Abstract ISWIM

The texts of abstract ISWIM are composite information structures called amessage's. The following structure definition defines the class amessage in terms of a class called identifier. It also defines several functions for manipulating amessage's. These comprise the predicates demand, simple, infixed, etc; also the selectors body, rator,leflarm, nee, etc; also (taking for granted certain unformalized conventions concerning structure definitions) the constructors, consdemand, conscombination (elsewhere abbreviated to combine), consstandardadef, etc. Examples of reference ISWIM are given alongside, against the right margin.

An amessage is either a demand, and has a body which is an aexpression,or else a definition,

$ [Print \qquad a+2b $

$ [Def \qquad x=a+2b $

🪶 🦉🦊🐿 🪶

抽象ISWIM的文本是由称为amessage的信息结构组成的。以下的结构定义将类amessage定义为一个称为标识符的类。它也定义了几个用于处理amessage的函数。这些包括需求、简单、中缀等谓词;还有选择器body、rator、leflarm、nee等;还有(假设接受某些未正式化的结构定义约定)构造函数,如consdemand、conscombination(在其他地方缩写为combine)、consstandardadef等。参照ISWIM的示例针对右边边界给出。

一个消息可能是一个需求,它的主体是一个表达式,或者是一个定义.

5.1 where rec

an aexpression (aexp) is

5.1.1 either simple, and has a body which is an identifier

$ [C Ath231'' $

5.1.2 or a combination,

in which case

  • it has a rator,

    which is an aexp,

    $ [sin(a+2b) $

  • and a rand,

    which is an aexp,

    $ a+2b $

5.1.3 or conditional, in which case it is

  • either two-armed,

    and has a condition, which is an aexp, and a leftarm, which is an aexp, and a rightarm, which is an aexp,

    $ [p\to a+2b ; \quad 2a-b$

  • or one-armed,

    and has a condition, which is an aexp, and an arm, which is an aexp

    $ [p\to 2a-b$

5.1.4 or a listing, and has a body which is an aexp-list,

$ [a+b,c+d,e+f $

5.1.5 or beet, and has

  • a mainclause,

    which is an aexp,

    $ [x(x+1) \quad where \quad x=a+2b $

  • and a support

    which is an adef

    $ let \quad x=a+2b; \quad x(x+1) $

5.2 and an a definition (adef)

5.2.1 is either standard,

and has

a definee (nee), which is an abv,

and a defniens (niens), which is an aexp

$ [x=a+2b $

5.2.2 or functionform,

and has

  • a lefthandside (lhs) which is an abv-list of length $\ge 2$

  • and a righthandside (rhs), which is an aexp

$[f(x)=x(x+1)$

5.2.3 or programpoint,

and has a body which is an adef.

$[pp \quad f(x)=x(x+1)$

5.2.4 or circular,

and has a body which is an adef.

$ [rcc \quad f(n)=(n=0) \to 1; nf(n-1)$

5.2.5 or simultaneous,

and has a body, which is an adef-list.

$ [x=a+2b \quad and \quad y=2a-b$

5.2.6 or beet, and has

a mainclause which is an adef and a support, which is an adef

$ f(y)=x(x+y) \quad where \quad x=a+2b$

5.3 where an abv is

5.3.1 either simple,

and has a body, which is an identifier.

5.3.2 or else, is an abv-list.

$ [k, (y, z), w$

A program-point definition introduces a deviant kind of function. Applying such a function precipitates premature termination of the where-expression containing it, and causes its result to be delivered as the value of theentire where expression.

Program-points are ISWIM's, nearest thing to jumping. Assignment is covered as a particular case of an operator. For both of these the precise specification is in terms of the underlying abstract machine.

🪶 🦉🦊🐿 🪶

5.1 其中关于rec,可能是

5.1.1 简单的,其主体是一个标识符

$ [C Ath231'' $

5.1.2 或者是一个组合,

(1) 它有一个运算符,是一个表达式

$ [sin(a+2b) $

(2) 和一个操作数, 也是一个表达式

$ a+2b $

5.1.3 或者是条件的,这种情况下,它是

(1) 两个分支的, 并且具有一个条件,这是一个表达式,左值是一个表达式,右值是一个表达式,

$ [p\to a+2b ; \quad 2a-b$

(2) 或者是单分支,并且具有一个条件,这是一个表达式,一个分支,也是表达式。

$ [p\to 2a-b$

5.1.4 或者是列表,拥有一个主体,这是一个表达式列表

$ [a+b,c+d,e+f $

5.1.5 或者,

(1) 具有一个主句,这是一个表达式

$ [x(x+1) \quad where \quad x=a+2b $

(2) 或者有一个定义

$ let \quad x=a+2b; \quad x(x+1) $

5.2 一个定义,可能是

5.2.1 它可以是标准的

有个定义者和被定义者

$ [x=a+2b $

5.2.2 或者是函数形式,

它有一个左值是长度 $\ge 2$ 的缩略词列表,还有一个右值,是一个表达式

$[f(x)=x(x+1)$

5.2.3 或者是程序,

并且有一个主体,这是一个定义。

$[pp \quad f(x)=x(x+1)$

5.2.4 或者是环形的,

并且有一个是定义的主体。

$ [rcc \quad f(n)=(n=0) \to 1; nf(n-1)$

5.2.5 或者是同时的,

并且有一个主体,这是一个定义列表

$ [x=a+2b \quad and \quad y=2a-b$

5.2.6 或者

一个主句是一个定义,而一个从句是一个定义

$ f(y)=x(x+y) \quad where \quad x=a+2b$

5.3 其中,简称

5.3.1 要么是简单的,并且具有一个标识符。

5.3.2 或者是一个简称列表。

$ [k, (y, z), w$

程序点定义引入了一种异常的函数。 应用此类函数会导致包含该函数的 where 表达式提前终止,并导致其结果作为整个 where 表达式的值进行传递。

程序点是 ISWIM 的,最接近跳跃的东西。 赋值被视为运算符的特殊情况。 对于这两者,精确的规范是根据底层抽象机来进行的。

6. Relationship to LISP

ISWIM can be looked on as an attempt to deliver LISP from its eponymous commitment to lists, its reputation for hand-to-mouth storage allocation, the hardware dependent flavor of its pedagogy, its heavy bracketing, and its compromises with tradition. These five points are now dealt with in turn:

(1) ISWIM has no particular problem orientation. Experiments so far have been mainly in numerical work and language processing with brief excursions into "commercial" programming and elsewhere. No bias towards or away from a particular field of application has emerged

(2) Outside a certain subset (corresponding closely to ALGOL 0 without dynamic own arrays), ISWIM needs garbage collection. An experimental prototype implementation followed common ALGOL 60 practice. It used dynamic storage allocation with two sources, one LIFO and the other garbage collected, with the intention that the LIFO source should take as big a share as possible.

However, as with ALGOL 60, there is a latent potential for prealloeating storage in certain favorable and commonly useful situations. Compared with LISP the chief amelioration of storage allocation comes out of a mere syntactic difference, namely, the use of where ( 'let' which is exactly equal in power and program structure). This provides a block-structure not dissimilar in textual appearance from ALGOL 60'S, though it slips off the pen more easily, and is in many respects more general.

(3) Lisp has some dark corners, especially outside "pure LISP," in which both teachers and programmers resort to talking about addresses and to drawing storage diagrams. The abstract machine underlying ISWIM is aimed at illuminating these corners with a mininmm of hardware dependence.

(4) The textual appearance of ISWIM is not like Lisp's S-expressions. It is nearer to LISP'S M-expressions (which constitute an informal language used as an intermediate result in hand-preparing LISP programs). ISWIM has the following additional features:

(a) "Auxiliary" definitions, indicated by 'let' or 'where', with two decorations: 'and' for simultaneous definitions, and 'rec' for self-referential definitions (not to be mistaken for a warning about recursive activation, which can of course also arise from self-application, and without self-reference).

(b) Infixed operators, incorporated systematically. A logical ISWIM can be defined in terms of four unspecified parameters: three subsets of the class of identifiers, for use as prefixed, infixed and postfixed operators; and a precedence relation defined over the union of these subsets.

(c) Indentation, used to indicate program structure. A physical ISWIM can be defined in terms of an unspecified parameter: a subset of phrase categories, instances of which are restricted in layout by the following rule called "the offside rule." The southeast quadrant that just contains the phrase's first symbol must contain the entire phrase, except possibly for bracketed subsegments. This rule has three important features. It is based on vertical alignment, not character width, and hence is equally appropriate in handwritten, typeset or typed texts. Its use is not obligatory, and use of it can be mixed freely with more conventional alternatives like punctuation. Also, it is incorporated in ISWIM in a systematic way that admits of alternatives without changing other features of ISWIM and that can be applied to other languages

(5) The most important contribution of Lisp was not in listprocessing or storage allocation or in notation, but in the logical properties lying behind the notation, Here ISWIM makes little improvement because, except for a few minor details, Lisp left none to make. There are two equivalent ways of stating these properties.

(a) Lisp simplified the equivalence relations that determine the extent to which pieces of program can be interchanged without affecting the outcome.

(b) Lisp brought the class of entities that are denoted by expressions a programmer can write nearer to those that arise in models of physical systems and in mathematical and logical systems.

These remarks are expanded in Sections 7 and 8.

🪶 🦉🦊🐿 🪶

ISWIM 可以说是 LISP 的一次尝试,它使 LISP 摆脱了对列表的承诺、对存储分配的手忙脚乱、教学法对硬件的依赖、大量的括号以及对传统的妥协。下面将依次讨论这五点:

(1) ISWIM 没有特定的问题导向。迄今为止,主要在数值工作和语言处理方面进行了实验,并在 "商业 "编程和其他方面进行了短暂的尝试。没有出现偏向或偏离某一特定应用领域的情况

(2) 除了某个子集(与没有动态数组的 ALGOL 0 非常接近)外,ISWIM 需要垃圾收集。实验原型的实现遵循 ALGOL 60 的通用做法。它使用动态存储分配,有两个源,一个是后进先出源,另一个是垃圾收集源,目的是让后进先出源占据尽可能大的份额。

然而,与 ALGOL 60 一样,在某些有利且常用的情境下,ISWIM 也具有预先分配存储的潜在可能性。与 LISP 相比,存储分配的主要改进仅源于语法上的差异,即使用 where(在功能和程序结构上与 'let' 完全等价)。这提供了一种块结构,其文本外观与 ALGOL 60 的类似,尽管它更容易书写,并且在许多方面更为通用

(3) Lisp 有一些阴暗的角落,尤其是在 "纯 LISP "之外,在这些角落里,教师和程序员都在谈论地址和绘制存储图。ISWIM 的抽象机器旨在以最小的硬件依赖性照亮这些角落。

(4) ISWIM 的文本外观与 Lisp 的 S 表达式不同。它更接近于 LISP 的 M 表达式(构成一种非正式语言,用作手工编制 LISP 程序的中间结果)。ISWIM 还具有以下特点:

(a) "辅助 "定义,用 "let "或 "where "表示,有两种装饰: 'and'表示同时定义,'rec'表示自引用定义(不要误认为是对递归激活的警告,当然递归激活也可能来自自应用,而且没有自引用)。

(b) 内置运算符,系统整合。逻辑 ISWIM 可以用四个未指定的参数来定义:标识符类的三个子集,分别用作前缀、后缀和后缀运算符;以及定义在这些子集的联合之上的优先关系。

(c) 缩进,用于表示程序结构。一个物理ISWIM可以根据未指定的参数来定义:词组类别的一个子集,其实例的布局通过以下名为“偏移规则”的规则进行限制。刚好包含词组第一个符号的东南象限必须包含整个词组,除非可能的带括号的子段。此规则有三个重要特点。它基于垂直对齐,而不是字符宽度,因此在手写,排版或键入的文本中同样适用。其使用不是强制性的,且其使用可以自由地与更传统的替代方案如标点混合使用。此外,它以一种系统化的方式纳入ISWIM,可以在不更改ISWIM的其他特征的情况下提供替代方案,并且可以应用于其他语言。

(5) Lisp 最重要的贡献不在于列表处理或存储分配,也不在于符号,而在于符号背后的逻辑属性。ISWIM 在这方面几乎没有改进,因为除了一些小细节外,Lisp 没有留下任何改进的余地。有两种等效的方法来说明这些属性。

(a) Lisp 简化了等价关系,这些等价关系决定了程序片段可以在不影响结果的情况下互换的程度。

(b) Lisp 使程序员可以编写的表达式所表示的实体类别更接近物理系统模型以及数学和逻辑系统中出现的实体类别。

第 7 节和第 8 节将进一步阐述这些观点。

7. The Characteristic Equivalences of ISWIM

For most programming languages there are certain statements of the kind, "There is a systematic equivalence between pieces of program like this, and pieces like that," that nearly hold but not quite. For instance in ALGOL 60 there is a nearly true such statement concerning procedure calls and blocks.

At first sight it might appear pedantic to quibble about such untidiness--"What's the point of having two different ways of doing the same thing anyway? Isn't it better to have two facilities than just one?" The author believes that expressive power should be by design rather than accident, and that there is great point in equivalences that hold without exception. It is a platitude that any given outcome can be achieved by a wide variety of programs. The practicability of all kinds of program-processing (optimizing, checking satisfaction of given conditions, constructing a program satisfying given conditions) depends on there being elegant equivalence rules. For ISWIM there are four groups, concerning:

(1) the extent to which a subexpression can be replaced by an equivalent subexpression without disturbing the equivalence class of the whole expression. Without this group the other rules would be applicable only to complete expressions, not to subexpressions.

(2) user-coined names, i.e., in definitions and, in particu- lar, function definitions.

(3) built-in entities implicit in special forms of expression. The only iiistanees of this in ISWIM are conditional expressions, listings and self-referential definitions.

(4) named entities added in any specific problem orientation of ISWIM.

🪶 🦉🦊🐿 🪶

对于大多数程序设计语言来说,"这样的程序片段和那样的程序片段之间存在着系统的等价关系 "这种说法几乎成立,但又不完全成立。例如,在 ALGOL 60 中,关于过程调用和程序块就有这样一种近乎正确的说法。

乍一看,对这种不整洁进行争论可能显得有些吹毛求疵——“毕竟,用两种不同的方式做同一件事有什么意义呢?拥有两种设施不是比只有一种更好吗?”作者认为,表达能力应该是经过设计的而不是偶然的,而且毫无例外地成立的等价性具有很大的重要性。众所周知,任何给定的结果都可以通过多种程序来实现。各种程序处理(优化、检查满足给定条件、构造满足给定条件的程序)的可行性取决于存在优雅的等价规则。对于 ISWIM 来说,有四组相关的特征等价性:

(1) 子表达式可以在不干扰整个表达式的等价类的情况下被等价的子表达式替换的程度。没有这个组,其他规则只适用于完整的表达式,而不适用于子表达式。 (2) 用户创造的名称,即在定义和特别是函数定义中。

(3) 内置实体隐含在表达式的特殊形式中。在ISWIM中,只有条件表达式、列表和自我参照定义是这个例子。

(4) 在ISWIM的任何特定问题定向中添加的命名实体。

7.1 Group 1

$(\mu) \quad If \quad L \equiv L' \quad then \quad L(M) \equiv L'(M)$

$(\nu) \quad If \quad M \equiv M' \quad then \quad L(M) \equiv L(M')$

$(\nu') \quad If \quad M \equiv M' \quad then \quad (L,...,M,...,N) \equiv (L,...,M',...N)$

$(\nu'') \quad If \quad L \equiv L' \quad then \quad (L \to M; N) \equiv (L' \to M; N)$

$(\nu''') \quad If \quad M \equiv M' \quad then \quad (L \to M; N) \equiv (L \to M'; N) $

$(\nu^{iv}) \quad If \quad N \equiv N' \quad then \quad (L \to M; N) \equiv (L \to M; N')$

$(\nu^{v}) \quad If \quad M \equiv M' \quad then \quad (L : where : x = M) \equiv (L : where : x = M')$

The significant omissions here are the main-clause in the last case above, the rhs of a function definition $"f(x) = M" $ and of a circular definition $ "rec x = M" $.

7.2 Group 2

$(let) \quad let : x = M; L \quad \equiv \quad L : where : x = M$

$(I')\quad f(x) = L \quad \equiv \quad f=(g : where : g(x)=L)$

$\quad \quad f(a, b, c)(x, y) = L \quad \equiv \quad f(a,b,c) = (g : where : g(x,y) = L)$

and so on for each shape of left-hand side

$(I) \quad (f : where : f(x)=L) M \quad \equiv \quad L : where : x=M $

$(\beta') \quad (x=L) : where : y=M \quad \equiv x=(L : where : y=M)$

$(D') \quad x = L : and : y=M : and \quad \equiv ... : and : z=N \quad \equiv (x,y,...,z) = (L,M,...,N)$

🪶 🦉🦊🐿 🪶
Creative Commons License Flag Counter