📑 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

斯里尼瓦瑟·拉马努金

of numbers. Messenger Math. 1916, 45: 81–84.  Ramanujan, S. A Series for Euler's Constant γ. Messenger Math. 1916, 46: 73–80.  Ramanujan, S. On the expression

1 + 1 + 1 + 1 + …

−1⁄2”,某程度意味著「如果觀眾不知道这个,那么继续听下去是没有意义的。」 Tao, Terence, The Euler-Maclaurin formula, Bernoulli numbers, the zeta function, and real-variable analytic continuation, April

歐拉-馬斯刻若尼常數

(2002) "Collection of formulas for Euler's constant, γ. (页面存档备份,存于互联网档案馆)" Gourdon, Xavier, and Sebah, P. (2004) "The Euler constant: γ. (页面存档备份,存于互联网档案馆)"

P-code机

P-code机,來自於Pascal語言,特別是UCSD Pascal實作。 虽然這個概念在1966左右年就已首次实现(于BCPL的O-code与Euler语言的P - a code),但P-code这个词直到70年代初才首次出现。 1973年Nori, Ammann, Jensen,

隐式编程

⊢ sin ← 1 ○ ⊢ j ← {⍺←0 ⋄ ⍺+0j1×⍵} ⍝ j函数的定义不是隐式的 Euler ← *∘j = cos j sin 这里采用直接函数(英语:Direct function)定义了j函数,其中在{与}之间由⋄分隔的是守卫的表达式序列(这里只有表达式),⍺指示左参数而⍵指

Γ函数

倒數伽瑪函數 反伽瑪函數 伽玛分布 B函數 P. J., Davis. Leonhard Euler's Integral: A Historical Profile of the Gamma Function. American Mathematical Monthly. 1959 [2023-01-01]

玻色弦理論

along with a hypothetical purely topological term, proportional to the Euler characteristic: I = I 0 + λ χ ( M ) + μ 0 2 ∫ M d 2 ξ g {\displaystyle I=I_{0}+\lambda

高斯二项式系数

JSTOR 2695583. MR 1806919.  Kupershmidt, Boris A. q-Newton binomial: from Euler to Gauss. J. Nonlin. Math. Phys. 2000, 7 (2): 244–262. Bibcode:2000JNMP