📑 Table of Contents

CPL(英語:Combined Programming Language,原名Cambridge Programming Language),一種計算機程式語言。源自於ALGOL 60,在1963年,由英国剑桥大学伦敦大学首先開發出來。CPL语言在ALGOL 60的基础上更接近硬件一些,但规模比较大,难以实现。BCPL是它的後繼語言。

CPL
编程范型多范型: 过程式, 指令式, 结构化, 函数式
設計者Christopher Strachey
发行时间1963年,​63年前​(1963
受影响于
ALGOL 60
影響語言
BCPL, POP-2

例子

编辑

下面是Christopher Strachey等人在1963年论文中举出了的例子,它对应ALGOL 60报告中欧拉变换的例子:

function Euler [function Fct, real Eps, integer Tim] = result of
    || Euler computes the sum of Fct[i] fo​r i from zero up to infinity by 
    || means of a suitably refined Euler transformation. The summation is
    || stopped as soon as Tim ti​mes i​n succession the absolute value of 
    || the terms of the transformed series are found to be less than Eps.
    || Hence, one should provide a fu​nction Fct with one integer argument,
    || an upper bound Eps, and an integer Tim. The output is the sum Sum.
    || Euler is particularly efficient i​n the ca​se of a slowly convergent
    || or divergent alternating series.
    §1 dec §1.1 real Mn, Ds, Sum
                integer i, t
                index n = 0
                m = Array [real, (0, 15)] §⃒1.1
       i, t, m[0] := 0, 0, Fct[0]
       Sum := m[0]/2
       §1.2 i := i + 1
            Mn := Fct[i]
            for k = step 0, 1, n do
                m[k], Mn := Mn, (Mn + m[k])/2
            test Mod[Mn] < Mod[m[n]]  n < 15
                then do Ds, n, m[n+l] := Mn/2, n + 1, Mn
                or do Ds := Mn
            Sum := Sum + Ds
            t := (Mod[Ds] < Eps)  t + 1, 0 §⃒1.2
       repeat while t < Tim
       result := Sum §⃒1.

result of或实现为value of,同时result :=或实现为result is。与开符号§相匹配的闭符号是有竖杠贯穿的§。这个符号在Unicode中可以复合为§⃒,它是§(U+00A7)复合于(U+20D2),但在浏览器中不一定能正确的显示出来这个§⃒。

实现

编辑

据认为CPL在1960年代从未被完全实现,它是作为具有一些关于部份实现的研究工作的理论性构造而存在的[1][2]

Peter Norvig曾经用Yapps(一个Python编译器生成器)为现代机器写出了一个简单的CPL到Python转译器[3][4]

引用

编辑
  1. ^ Coulouris, G. F. The London CPL1 compiler. The Computer Journal. 1 January 1968, 11: 26–30. doi:10.1093/comjnl/11.1.26  (英语). 
  2. ^ Coulouris, George. Computer Resurrection Issue 62 / The Compiler Compiler - Reflections of a User 50 Years On / The CPL1 Compiler. Computer Conservation Society. 2013 [2023-05-03]. 
  3. ^ Peter Norvig. Prescient but Not Perfect: A Look Back at a 1966 Scientific American Article on Systems Analysis. Blogs.scientificamerican.com. [2013-08-18]. 
  4. ^ Norvig, Peter. Complete Annotated Checkers Program. norvig.com. [11 June 2021]. 

参考书目

编辑

📚 Artikel Terkait di Wikipedia

69

OpenVMS User's Guide. Elsevier Science. 1998: 272. ISBN 9781555582036.  Clifford, Jerrold R.; Clifford, Martin. Computer Mathematics Handbook. Allyn &

ALGOL W

变量和表达式(英语:Expression (computer science))的类型通过附缀来的表示。例如,⟨τ function identifier⟩是针对返回类型τ的值的函数的一个语法实体,如果这个标识符已经在当前作用域内被声明为整数函数,那么它被展开为⟨integer function identifier⟩。

−2

Sequence A004171. The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.  Knuth, Donald, The Art of Computer Programming, Volume 2 3rd: 204–205, 1998 

ALGOL 60

nit):简单变量、数组、标签、接转(switch)和过程。表达式(英语:Expression (computer science))及其构成者和数组标识符,被称为拥有值。各种“类型”即integer、real和Boolean,指称(denote)值的基本的属性。

SQLAlchemy

具包及对象关系映射器(ORM),是在MIT许可证下发行的软件。 SQLAlchemy提供企业级持久化(英语:Persistence (computer science))模式,首次发行于2006年2月。SQLAlchemy的理念是:关系数据库随着规模变大并且性能开始成为顾虑,而表现得不像对象搜集;而

斐波那契

Goonatilake. Toward a Global Science. Indiana University Press. 1998: 126. ISBN 978-0-253-33388-9.  Donald Knuth. The Art of Computer Programming: Generating

L符號

K. Lenstra; Hendrik W. Lenstra, Jr. Algorithms in Number Theory. Handbook of Theoretical Computer Science (vol. A): Algorithms and Complexity. 1991. 

Modula-3

0]。声明一个空类型的一个变量是静态错误。 所有的表达式(英语:Expression (computer science))都有一个唯一的类型,但是一个值可以是很多类型的一个成员,例如值6是[0..9]和INTEGER二者的成员,因此论述“一个值的类型”将会是有歧义的。短语“x的类型”,意味着“表达式