Top Qs
Timeline
Chat
Perspective

Hope (programming language)

From Wikipedia, the free encyclopedia

Remove ads

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]

Quick Facts Paradigm, Designed by ...
Remove ads

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]

Remove ads

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]

Remove ads

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

Loading content...
Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads