PAL语言

教育算法语言 (PAL)
编程范型函数式指令式
設計者最初设计:
彼得·兰丁,
詹姆斯·H·莫里斯
重新设计:
Martin Richards, Thomas J. Barkalow, Arthur Evans, Jr., Robert M. Graham, James Morris, John Wozencraft
實作者麻省理工学院
发行时间1967年​(1967
型態系統动态
作用域词法
實作語言最初设计: LISP
重新设计: BCPL
系统平台IBM 7090, 7094; System/360
操作系统相容分时系统, BOS/360, TOS/360, DOS/360, OS/360
網站rpal.sourceforge.net
衍生副語言
右引用教育算法语言 (RPAL)
受影响于
ISWIM
影響語言
ML

PAL,是教育算法语言(Pedagogic Algorithmic Language)的首字母简写,它是在大约1967年于麻省理工学院开发的编程语言,用于帮助教授编程语言语义和设计[1][2]。它是ISWIM的直接后代,并拥有很多来自Christopher Strachey的哲学[3]

PAL最初用Lisp实现,由彼得·蘭丁和小詹姆斯·H·莫里斯(James H. Morris, Jr.)书写。后来馬丁·理察德、Thomas J. Barkalow、Arthur Evans, Jr.、Robert M. Graham、James Morris, Jr和約翰·沃森克拉夫特对它做了重新设计。Richards和Barkalow将它用BCPL实现为中间代码解释器,并运行在IBM System/360之上,它被称为PAL/360[4]

样例

// Sample PAL program.
let Abs x = // compute absolute value of argument
        x < 0.0 -> -x ! x
in
let Sqrt x = // compute square root of x
        f(x/2.0) // initial approximation is x/2
    where rec f t = // a recursive function for Newton's method
        Abs(t*t - x) < 0.005 // is t close enough?
        -> t // Yes, so return t as result.
        !  f(0.5*(t + x/t)) // No, so keep trying...
in
let i = 0 // a counter, to have its square root taken.
in
L:  // the main loop of this rather simple little program..
    Write (i, '*t', Sqrt(ItoR i), '*n');
    i := i + 1;
    i < 11 // did we just do 10?
    ->     // not yet, so keep going
        goto L
    !      // All done, so say so and go home.
    Write '*nAll done.*n'

RPAL

RPAL,即“右引用PAL”,是PAL的函数式子集的实现[5]。它被用在佛罗里达大学用于教学编程语言构造和函数式编程。程序是严格的函数式的,没有赋值运算序列。

引用

  1. ^ A. Evans. PAL -- A Reference Manual and a Primer (PDF) (报告). Department of Electrical Engineering, Massachusetts Institute of Technology. February 1968 [2021-09-24]. (原始内容 (PDF)存档于2022-03-06). 
    A. Evans. Appendix 2.1. The Complete Syntax for PAL (PDF) (报告). February 1968 [2021-09-24]. (原始内容 (PDF)存档于2022-03-06). 
  2. ^ J. M. Wozencraft, A. Evans. Notes on Programming Linguistics (PDF). M.I.T. Department of Electrical Engineering. 1971 [2021-09-24]. (原始内容 (PDF)存档于2022-03-06). 
  3. ^ Arthur Evans. PAL: a language designed for teaching programming linguistics. Proceedings ACM National Conference. ACM National Conference. Association for Computing Machinery. 1968. 
  4. ^ PAL (Pedagogic Algorithmic Language). Computer History Museum/Software Preservation Group. [2021-09-24]. (原始内容存档于2021-09-24). 
  5. ^ RPAL - The Right-reference Pedagogic Algorithmic Language. SourceForge. [2021-09-24]. (原始内容存档于2022-04-10).