Hope (programming language): Difference between revisions

Content deleted Content added
Triptropic (talk | contribs)
m wikilinks, corrected Uni name
Dsannella (talk | contribs)
m Wikipedia cross reference to Don Sannella
 
(40 intermediate revisions by 19 users not shown)
Line 1:
{{Infobox programming language
'''Hope''' is a small [[functional programming language]] developed in the 1970s at the [[University of Edinburgh]].<ref name="BMS">[[Rod Burstall |Burstall]] R.M, [[David MacQueen| MacQueen D.B]], Sannella D.T. (1980) ''Hope: An Experimental Applicative Language''. Conference Record of the 1980 LISP Conference, Stanford University, pp. 136-143.</ref><ref name="design"> 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)</ref><ref>
| name = Hope
{{cite book
| logo = <!-- Filename -->
| title = Functional Programming with Hope
| logo caption =
| series = Ellis Horwood Series in Computers and Their Applications
| screenshot = <!-- Filename -->
| last = Bailey
| screenshot caption =
| first = Roger
| sampleCode =
| publisher = Ellis Horwood Ltd
| paradigm = [[Functional programming|functional]]
| publication-date = 1 April 1990
| family =
}}</ref><ref>
| designers = [[Rod Burstall]]<br>D. B. MacQueen<br>[[Don Sannella]]
{{cite magazine
| developer =[[University of Edinburgh]]
| title = A Hope Tutorial
| released = {{Start date and age|1980}}
| last = Bailey
| latest release version =
| first = Roger
| latest release date = <!-- {{Start date and age|199y|mm|dd|df=yes}} -->
| magazine = [[Byte magazine|Byte]]
| volumetyping = 10
| memory management =
| issue = 8 (August 1985)
| scope =
| url = http://www.devili.iki.fi/library/issue/136.en.html
| programming language =
| accessdate = 1 April 2015
| discontinued = Yes
}}</ref> It predates [[Miranda programming language|Miranda]] and [[Haskell (programming language)|Haskell]] and is contemporaneous with [[ML (programming language)|ML]], also developed at the University. 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 [[Stephen Cole Kleene|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.
| platform =
| operating system =
| license =
| file ext =
| file format = <!-- or: | file formats = -->
| website = <!-- {{URL|www.example.com}} -->
| implementations =
| dialects = Hope+
| influenced by = [[NPL (programming language)|NPL]]
| influenced =
}}
 
'''Hope''' is a [[programming language]] based on [[functional programming]] developed in the 1970s at the [[University of Edinburgh]].<ref name="BMS">{{cite book |last1=Burstall |first1=R. M. |author1-link=Rod Burstall |last2=MacQueen |first2=D. B. |last3=Sannella |first3=D. T. |date=1980 |chapter=Hope: An Experimental Applicative Language |title=Proc. 1980 LISP Conference|place=Stanford University, Stanford, California, United States |page=136–143 |url=https://homepages.inf.ed.ac.uk/dts/pub/hope.pdf}}</ref><ref>
Hope was named for [[Sir Thomas Hope, 8th Baronet|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.
{{cite book |last1=Bailey |first1=Roger |date=1 April 1990 |title=Functional Programming with Hope |series=Ellis Horwood Series in Computers and Their Applications |publisher=Ellis Horwood Ltd}}</ref>
}}</ref> It predates [[Miranda (programming language)|Miranda]] and [[Haskell (programming language)|Haskell]] and is contemporaneous with [[ML (programming language)|ML]], also developed at the University. 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>{{cite journal |last1=Burstall |first1=R. M. |author1-link=Rod Burstall and|last2=Darlington |first2=J. |author2-link=John Darlington. |date=1977 |title=A transformation system for developing recursive programs. |journal=Journal of the Association for Computing Machinery, |volume=24( |issue=1): |pages=44–67 (1977)}}</ref> NPL was, in turn, derived from [[Stephen Cole Kleene|Kleene recursion equations]]. NPL and Hope are notable for being the first languages with call-by-pattern evaluation and [[algebraic data typestype]]s.<ref>{{CitationCite book needed|datelast1=FebruaryHudak 2014}}|first1=Paul (Though|author1-link=Paul [[SNOBOL]]Hudak is|last2=Hughes even|first2=John older,|author2-link=John andHughes its(computer 'patterns'scientist) may|last3=Peyton qualifyJones as|first3=Simon a|author3-link=Simon hybridPeyton betweenJones call-by-pattern|last4=Wadler and|first4=Philip regular|author4-link=Philip expressionWadler matching.){{Citation needed|date=April2007-06-09 2013}}|title=A Hopehistory isof anHaskell: importantbeing languagelazy inwith theclass development|publisher=ACM of|pages=12–1 functional programming|doi=10.1145/1238844.1238856 |isbn=9781595937667 |s2cid=52847907}}</ref>
 
Hope was named for [[Sir Thomas Hope, 8th Baronet|Sir Thomas Hope]] (c. 1681–1771), a Scottish agricultural[[agriculture]] reformer, after whom ''Hope Park Square'' in [[Edinburgh]], the ___location of the Department[[artificial of Artificialintelligence]] Intelligencedepartment at the time of the development of Hope, was also named.
 
The first implementation of Hope used [[strict evaluation]], but there have since been [[lazy evaluation]] versions and strict versions with lazy constructors. A successor language Hope+, developed jointly between [[Imperial College]] and [[International Computers Limited]], added annotations to dictate either strict or lazy evaluation.<ref name=annotations>{{cite book |last1=Kewley |first1=John |last2=Glynn |first2=Kevin |date=1989 |chapter=Evaluation Annotations for Hope+ |editor1-last=Davis |editor1-first=Kei |editor2-last=Hughes |editor2-first=R. J. M. |title=Functional Programming: Proceedings of the 1989 Glasgow Workshop, Workshops in Computing |pages=329–337 |place=London, United Kingdom |publication-date=1990 |publisher=[[Springer-Verlag]]}}</ref>
 
==Language details==
A [[factorial]] program in Hope is:
dec fact : num -> num;
--- fact 0 <= 1;
--- fact n <= n*fact(n-1);
 
Unlike [[Haskell (programming language)|Haskell]], changingChanging the order of the clauses does 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 andExplicit [[:Category:MLDeclaration (computer programming language family)|MLdeclarations]] isof that explicit[[data type declarations]]s in Hope are required:; there is no option[[type to use a type-inference]] algorithm in Hope.
 
Hope provides two built-in [[data structure]]s: [[tuple]]s and [[List (abstract data type)|lists]].<ref name=byte/>
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). British Telecom embarked on a project with [[Imperial College London|Imperial College]] to implement a strict version. The first release was coded by Thanos Vassilakis in 1986. Further releases were coded by Mark Tasng of BT.
 
==Implementations==
TheRoger firstBailey's implementationHope oftutorial Hopein wasthe August 1985 issue of ''[[strictByte evaluation(magazine)|strictByte]],'' butreferences since that one there have beenan [[lazyInterpreter evaluation(computing)|lazyinterpreter]] versionsfor and[[IBM strictPC versions with lazy constructors (the language described inDOS]] 2.0.<ref name="BMS"byte/> has a lazy constructor for lists only).[[BT Group|British Telecom]] embarked on a project with [[Imperial College London|Imperial College]] to implement a strict version of Hope. The first release was coded by Thanos Vassilakis in 1986. Further releases were coded by Mark Tasng of BTBritish Telecom.
 
==References==
{{Reflist}}|refs=
<ref name="design">{{cite conference |last1=Burstall |first1=R. M. |author1-link=Rod Burstall |date=1977 |title=Design considerations for a functional programming language (invited paper) |conference=Proceedings Infotech State of the Art Conference "The Software Revolution" |place=Copenhagen |pages=45–57}}</ref>
<ref name=byte>{{cite magazine |last1=Bailey |first1=Roger |date=August 1985 |url=https://archive.org/stream/BYTE_Vol_10-08_1985-08_The_Amiga#page/n241/mode/2up |title=A Hope Tutorial |magazine=[[Byte (magazine)|Byte]] |volume=10 |issue=8 |page=235–258 |access-date=13 January 2025}}</ref>
}}
 
==External links==
*[https://web.archive.org/web/20130801064002/http://www.hopemachine.co.uk/ Hope Interpreter for Windows]
*[http://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl?_key=Hope Entry in the online Dictionary of Programming Languages]
 
{{Authority control}}
 
{{DEFAULTSORT:Hope (Programming Language)}}
[[Category:Functional languages]]
[[Category:Academic programming languages]]
[[Category:History of computing in the United Kingdom]]
[[Category:Statically typed programming languages]]
[[Category:University of Edinburgh]]
 
<!-- Hidden categories below -->
 
[[Category:Articles with example code]]
{{compu-lang-stub}}