编程范型 | 函数式,面向堆栈 |
---|---|
設計者 | Robin Popplestone,Rod Burstall |
发行时间 | 1970年 |
啟發語言 | |
COWSEL,ALGOL 60,ISWIM | |
影響語言 | |
POP-10,POP-11,ML |
POP-2(也称为POP2,Package for Online Programming:在线编程包),是Robin Popplestone和Rod Burstall在大约1970年于爱丁堡大学开发的编程语言,起源于更早的语言POP-1(Robin Popplestone在1968年开发,最初叫做COWSEL)[1]。它根源于很多来源:LISP和ALGOL 60语言,和来自Peter J. Landin的理论上的想法。它使用增量编译器,这给与它某些解释型语言的灵活性,包括允许在运行时间定义新函数,和在程序运行时修改函数定义(二者都是动态编译的特征),而没有解释型语言的开销。
POP-2是具有动态绑定和动态(运行时间)确定类型的函数式语言,它的语法是ALGOL风格的,而它的特征受到了Strachey和Landin工作的重大影响。它有一些显著特征,比如在部份应用中具有的一种形式的函数闭包,和受到Landin的J算子启发的一种逃脱机制(jumpout
函数),它扮演了与Lisp中的catch
/throw
类似的角色。
POP-2对ML的设计有着重要的影响,这来自它的记录结构,这里定义了数据构造子和并以字段名字作为选择子,和它的section ... endsection
指令,这是提供了初步模块性支持的一种简单名字空间管理机制,ML后来把它替代为local ... in ... end
。[2]
POP-2 was designed by Robin Popplestone and Burstall in the late 1960s [1977; 1968; 1968a], following on Popplestone’s earlier POP-1 language [1968b]. Like Lisp, POP-2 was a functional language with dynamic binding and dynamic (i.e., runtime) typing, but its syntax was in the ALGOL-style, and its features were heavily influenced by the work of Strachey and Landin. It had a number of notable features such as a form of function closure via partial application and an escape mechanism (the jumpout function) inspired by Landin’s J operator that plays a rôle similar to catch/throw in Lisp. The design of ML was also influenced by POP-2’s record structures and by its sections, a simple mechanism for name-space management that provided rudimentary support for modularity.