Hope (programming language): Difference between revisions

Content deleted Content added
links for NPL and Burstall, removed stale ref, new section
Line 7:
| publisher = Ellis Horwood Ltd
| publication-date = 1 April 1990
}}</ref><ref>
{{cite web
| last = Bailey
| first = Roger
| url=http://www.soi.city.ac.uk/~ross/Hope/hope_tut/hope_tut.html
| archive-url = https://web.archive.org/web/20140910194058/http://www.soi.city.ac.uk/~ross/Hope/hope_tut/hope_tut.html
| archive-date= 10 September 2014
| title = A Hope Tutorial
| publisher = Soi.city.ac.uk
| accessdate = 1 April 2015
}}</ref><ref>
{{cite magazine
Line 27 ⟶ 17:
| url = http://www.devili.iki.fi/library/issue/136.en.html
| accessdate = 1 April 2015
}}</ref> It predates [[Miranda programming language|Miranda]] and [[Haskell (programming language)|Haskell]] and is contemporaneous with [[ML (programming language)|ML]] (also developed at Edinburgh). Hope was derived from [[NPL, (programming language)|NPL]],<ref name="design"/> a simple functional language developed by [[Rod Burstall]] and John Darlington in their work on program transformation.<ref> 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)</ref> NPL was, in turn, derived from Kleene Recursion Equations. NPL and Hope are notable for being the first languages with call-by-pattern evaluation and algebraic data types.{{Citation needed|date=February 2014}} (Though [[SNOBOL]] is even older, and its 'patterns' may qualify as a hybrid between call-by-pattern and regular expression matching.){{Citation needed|date=April 2013}} Hope is an important language in the development of functional programming.
 
Hope was named for Sir Thomas Hope (c. 1681–1771), a Scottish agricultural reformer, after whom ''Hope Park Square'' in Edinburgh, the ___location of the Department of Artificial Intelligence at the time of the development of Hope, was also named.
 
==Language details==
A factorial program in Hope is:
dec fact : num -> num;
--- fact 0 <= 1;
--- fact n <= n*fact(n-1);
Unlike in [[Haskell (programming language)|Haskell]], changing the order of the clauses woulddoes not change the meaning of the program, because Hope's pattern matching always favors more specific patterns over less specific ones. Another way in which Hope differs from Haskell and [[:Category:ML programming language family|ML]] is that explicit type declarations in Hope are required: there is no option to use a type-inference algorithm in Hope.
 
Another way in which Hope differs from Haskell and [[:Category:ML programming language family|ML]] is that explicit type declarations in Hope are required: there is no option to use a type-inference algorithm in Hope.
 
The first implementation of Hope was [[strict evaluation|strict]], but since that one there have been [[lazy evaluation|lazy]] versions and strict versions with lazy constructors (the language described in <ref name="BMS"/> has a lazy constructor for lists only).
Line 45 ⟶ 34:
 
==External links==
*[http://haskell.org/haskellwiki/History_of_Haskell History of Haskell] wiki.
*[https://web.archive.org/20130801064002/http://www.hopemachine.co.uk/ Hope Interpreter for Windows]