Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download

HOPE

< >

HOPE is a programming language created in 1978.

#836on PLDB 46Years Old
Wikipedia

Hope is a small functional programming language developed in the 1970s at Edinburgh University. It predates Miranda and Haskell and is contemporaneous with ML (also developed at Edinburgh). Hope was derived from NPL, a simple functional language developed by Rod Burstall and John Darlington in their work on program transformation. Read more on Wikipedia...


Example from Wikipedia:
dec fact : num -> num; --- fact 0 <= 1; --- fact n <= n*fact(n-1);
and or not char num div mod dec X # : -> ; --- if then else > <= + ( ) , infix - truval :: nil " <> == in where data ++ lambda

Language features

Feature Supported Example Token
Conditionals ✓
Comments ✓
--- A comment
Line Comments ✓
--- A comment
---
Single-Type Arrays ✓
[1,2,3]
Letter-first Identifiers ✓
Anonymous Functions ✓
lambda(x,y) => x + y
Integers ✓
Infix Notation ✓
max(10,20) + max(1,max(2,3));
Pattern Matching ✓
Merges Whitespace ✓
hasUserDefinedOperators ✓
Hope enables us to use a function with two arguments as an infix operator. e must assign it a priority and use it as an infix operator everywhere, including the equations that define it. A bigger number in the infix declaration means a higher priority. Most of Hope's standard functions are supplied as infix operators.
infix mult 8;
dec mult : num # num - > num;
---xmulty<= ifY=0then0elsexmult(y-1)+x;
Semantic Indentation X
While Loops X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll