Hope (programming language)

From Wikipedia, the free encyclopedia
Revision as of 15:35, 23 March 2025 by imported>Dsannella (Wikipedia cross reference to Don Sannella)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Script error: No such module "Infobox".Template:Template otherScript error: No such module "Check for unknown parameters".

Hope is a programming language based on functional programming developed in the 1970s at the University of Edinburgh.[1][2] It predates Miranda and Haskell and is contemporaneous with ML, also developed at the University. Hope was derived from NPL,[3] a simple functional language developed by Rod Burstall and John Darlington in their work on program transformation.[4] NPL and Hope are notable for being the first languages with call-by-pattern evaluation and algebraic data types.[5]

Hope was named for Sir Thomas Hope (c. 1681–1771), a Scottish agriculture reformer, after whom Hope Park Square in Edinburgh, the location of the artificial intelligence department 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.[6]

Language details

A factorial program in Hope is:

dec fact : num -> num;
--- fact 0 <= 1;
--- fact n <= n*fact(n-1);

Changing the order of clauses does not change the meaning of the program, because Hope's pattern matching always favors more specific patterns over less specific ones. Explicit declarations of data types in Hope are required; there is no type inference algorithm.

Hope provides two built-in data structures: tuples and lists.[7]

Implementations

Roger Bailey's Hope tutorial in the August 1985 issue of Byte references an interpreter for IBM PC DOS 2.0.[7] British Telecom embarked on a project with Imperial College London to implement a version of Hope. The first release was coded by Thanos Vassilakis in 1986. Further releases were coded by Mark Tasng of British Telecom.

References

Template:Reflist

External links

Template:Authority control

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Cite error: Invalid <ref> tag; no text was provided for refs named design
  4. Script error: No such module "Citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. a b Cite error: Invalid <ref> tag; no text was provided for refs named byte