Hope (编程语言)
Hope是在爱丁堡大学于1970年代开发的小型函数式编程语言[1][2]。Hope派生自NPL[3],它是Rod Burstall和John Darlington在他们关于程序变换著作中的简单函数式语言[4]。它是Miranda和Haskell的先驱,并与在同一所大学开发的ML同时代。NPL和Hope著名于是具有传模式调用的求值和代数数据类型的最初语言[5]。
函数式 | |
設計者 | Rod Burstall, John Darlington |
1980年 | |
啟發語言 | |
NPL | |
影響語言 | |
Miranda |
Hope以Sir Thomas Hope(约1681年–1771年)命名。
语言细节
阶乘程序用Hope写为:
dec fact : num -> num;
--- fact 0 <= 1;
--- fact n <= n*fact(n-1);
改变子句的次序不改变程序的含义,因为Hope的模式匹配总是偏好更加特殊的模式胜过不太特殊的模式。在Hope要求显式类型声明;在Hope中没有使用类型推论的选择余地。
Hope提供两种内建数据结构:元组和列表[6]。
引用
- Burstall R.M, MacQueen D.B, Sannella D.T. (1980) Hope: An Experimental Applicative Language. Conference Record of the 1980 LISP Conference, Stanford University, pp. 136-143.
- Bailey, Roger. . Ellis Horwood Series in Computers and Their Applications. Ellis Horwood Ltd. 1 April 1990.
- R.M. Burstall. Design considerations for a functional programming language. Invited paper, Proc. Infotech State of the Art Conf. “The Software Revolution”, Copenhagen, 45–57 (1977)
- R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the Association for Computing Machinery, 24(1):44–67 (1977)
- Hudak, Paul; Hughes, John; Peyton Jones, Simon; Wadler, Philip. . ACM. 2007-06-09: 12–1. ISBN 9781595937667. doi:10.1145/1238844.1238856.
- Bailey, Roger. . BYTE. Vol. 10 no. 8. August 1985 [1 April 2015].
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.