Est. 2000 Advanced

Hume

A functionally based research language from Scotland that wrapped a Haskell-style expression layer inside concurrent finite-state boxes, aiming to prove - not just hope - that real-time embedded programs stay within space and time bounds.

Created by Kevin Hammond (University of St Andrews) and Greg Michaelson (Heriot-Watt University), with contributors at both institutions including Robert Pointon; the name honours the 18th-century Scottish philosopher David Hume and doubles as the backronym Higher-order Unified Meta-Environment

Paradigm Functionally based and concurrent: a purely functional, pattern-matching expression layer runs inside a coordination layer of concurrent, non-terminating finite-state "boxes" connected by asynchronous wires, in a design built around provable space and time bounds for real-time embedded systems
Typing Static, strong, inferred, with polymorphic types and arbitrary-but-sized user-defined data structures
First Appeared 2000 - first presented in "Hume: a Functionally Inspired Language for Safety-Critical Systems" at the 2nd Scottish Functional Programming Workshop in St Andrews in July 2000, followed by "The Dynamic Properties of Hume" at IFL 2000 in Aachen that September
Latest Version humec 1.0.3 (November 2008), the last compiler release recorded on the project site; the last stable language release is recorded as version 0.8 (April 25, 2008). The wider research project continued to around 2013

Hume is what happens when functional programmers take hard real-time seriously. Designed from 2000 onwards by Kevin Hammond at the University of St Andrews and Greg Michaelson at Heriot-Watt University, it is named for the 18th-century Scottish philosopher David Hume - fitting for a language built in Edinburgh’s and St Andrews’ academic orbit - with the engineer’s backronym Higher-order Unified Meta-Environment attached for good measure.

The problem Hume attacked is easy to state and brutally hard to solve. Languages like Haskell offer higher-order functions, polymorphic types, pattern matching and automatic memory management - but with essentially no way to promise how much memory or time a program will use. Embedded and safety-critical systems demand exactly those promises. Hume’s wager was that you could keep the abstraction and the guarantees, if you designed the language around cost modelling from day one.

History and origins

Hume first appeared in July 2000, in a paper titled “Hume: a Functionally Inspired Language for Safety-Critical Systems” at the 2nd Scottish Functional Programming Workshop in St Andrews, followed within months by “The Dynamic Properties of Hume” at the IFL 2000 workshop in Aachen. Both authors came from the functional-programming research community - Hammond had been deeply involved in Haskell implementation work - and the language wears that heritage openly: its expression language reads like Haskell.

But Hume was never a general-purpose Haskell competitor. Its stated purpose was to explore what the designers called the expressibility/costability spectrum: how much expressive power a language can offer while its space and time behaviour remains statically analysable. That framing - treating decidable cost analysis as a first-class design constraint, on equal footing with type safety - is Hume’s signature idea.

Design: boxes, wires, and two languages in one

A Hume program is built from boxes - concurrent processes that never terminate. Each box repeatedly pattern-matches on its inputs and generates outputs, which travel along asynchronous wires to other boxes or to streams connected to devices. The result is a layered design:

  • an outer declaration and metaprogramming layer,
  • a coordination layer describing the network of boxes, wires, streams and devices - essentially a dataflow language of communicating finite-state machines,
  • an inner expression layer - stateless and purely functional, mapping input patterns to output expressions in Haskell-like style.

State lives only in the wiring (a wire can be initialised with a value, and a box can feed its own output back to an input), so each box body stays purely functional and analysable, while the coordination layer provides the reactive, concurrent behaviour an embedded controller needs.

The canonical small example - this one adapted from the community’s LiteratePrograms archive - shows all three pieces at once. The box counts as it greets, feeding its counter back to itself while routing the printable tuple to standard output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
stream output to "std_out" ;

box hello
in (count_in::int 32)
out (count_out::int 32, shown::(string, int 32, char))
match
 99 -> (0, ("Hello World ", 99,'\n'))
 | count -> (count +1, ("Hello World ", count,'\n')) ;

wire hello
   (hello.count_out initially 0)
   (hello.count_in, output) ;

The ladder of Humes

Hume’s most distinctive contribution is that it is not one language but a nested family, each level a sublanguage of the next, each with different formal properties:

LevelWhat it allowsWhat can be proved
HW-HumeBits and tuples only - a deliberately impoverished language for characterising hardwareDecidable equivalence and termination; predictable time and space
FSM-HumeAdds fixed-precision integers, reals, strings and vectors with conditionals - finite-state-machine designsStrongly bounded time and space
HO-Hume / Template-HumeAdds a repertoire of higher-order functions with known cost models, such as map and foldCosts derived from the known models
PR-HumeAdds user-defined primitive-recursive bounded functionsTermination still guaranteed; bounds computable
Full HumeUnrestricted recursion - Turing completeGeneral analysis undecidable

The idea is that a developer writes at the highest level the problem needs, and the toolchain tells you what guarantees survive. A hardware interface might live in HW-Hume with everything decidable; a control loop in FSM-Hume with hard space and time bounds; only the parts that truly need general recursion pay the price of undecidability. Few languages before or since have made “how analysable is this program?” such an explicit, graduated dial.

EmBounded: putting the proofs on the road

The theory met practice in EmBounded (2005-2008), a €1.26M EU Framework 6 project (IST-510255) coordinated by Hammond at St Andrews, with Heriot-Watt, Ludwig-Maximilians-Universität München, the French LASMEA laboratory in Clermont-Ferrand, and the timing-analysis company AbsInt GmbH. Its goal was to automatically identify, quantify and certify resource bounds for Hume programs, evaluated against realistic applications from real-time control and computer vision.

The results gave Hume its best war stories. Researchers at LMU Munich and St Andrews developed new theoretical models - in the amortised-analysis tradition - that predict dynamic memory and time usage directly from Hume source code. AbsInt’s aiT analyser supplied worst-case-execution-time figures for the compiled code, the same class of tool used to certify avionics software. Prototype Hume implementations ran in under 30KB on a standalone Renesas M32C development board, according to the project’s 2006 report in ERCIM News - a striking footprint for a language with higher-order functions and automatic memory management. And the showcase application was real-time vision: LASMEA researchers wrote road-feature-detection algorithms in Hume, intended for CyCab, the laboratory’s small autonomous electric vehicle - reportedly capable of speeds up to about 30 km/h.

Toolchain and evolution

Over its life the project produced a full research toolchain: a Hume interpreter, the prototype phamc compiler targeting the Hume Abstract Machine (HAM), the later humec compiler (final recorded release 1.0.3, November 2008), an extended HAM interpreter, and the hamdb debugger. The last stable language release is recorded as version 0.8, on April 25, 2008. Reference implementations ran on ordinary developer machines of the era - the language’s Wikipedia entry records IA-32 and PowerPC support on Linux and macOS - alongside the embedded targets developed in EmBounded.

After EmBounded, the EPSRC-funded Islay project (2008-2011) at Heriot-Watt carried the research forward into areas including image processing, vision and control. The Heriot-Watt project page records the Hume effort as running “from around 2000 to 2013”; after that, development stopped. The language is dormant: the reports, papers, interpreters and compilers remain archived on the university sites, but there is no active community, package ecosystem or maintained distribution.

Why it matters

Hume never escaped the research world, and it is fair to say no mainstream language descends from it. Its importance is of a different kind.

It took cost seriously as a language-design problem. Most languages treat resource usage as an implementation detail to be measured afterwards. Hume made “can we statically bound this program’s space and time?” the organising principle, and its ladder of sublanguages remains one of the clearest demonstrations that expressiveness and analysability can be traded deliberately rather than surrendered wholesale.

It proved functional programming could fit a microcontroller. A pattern-matching, higher-order, garbage-collected language running in under 30KB on an embedded board, with machine-checked memory and timing bounds, was a genuinely provocative demonstration in the mid-2000s - and remains relevant as functional techniques continue to press into embedded and safety-critical domains.

It carried a research lineage bigger than itself. The amortised resource-analysis techniques sharpened on Hume during EmBounded fed a research tradition of automatic resource-bound inference that has long outlived the language. Like its philosopher namesake - who was famously sceptical about what can be known with certainty - Hume the language was an extended, rigorous inquiry into exactly how much a compiler can promise. The answers it found are still cited; the language that asked them sleeps in the archives of two Scottish universities.

Timeline

2000
Kevin Hammond (St Andrews) and Greg Michaelson (Heriot-Watt) present "Hume: a Functionally Inspired Language for Safety-Critical Systems" at the 2nd Scottish Functional Programming Workshop in St Andrews in July, introducing a language designed to combine functional-programming abstraction with guaranteed resource bounds
2000
"The Dynamic Properties of Hume: a Functionally-Based Concurrent Language with Bounded Time and Space Behaviour" is presented at the Implementation of Functional Languages workshop (IFL 2000) in Aachen in September, appearing in Springer's Lecture Notes in Computer Science in 2001
2003
"Hume: A Domain-Specific Language for Real-Time Embedded Systems" at the GPCE 2003 conference lays out the signature multi-level design - a ladder of nested sublanguages from hardware-level HW-Hume up to Turing-complete Full Hume, trading expressive power against decidable cost analysis at each rung
2004
"FSM-Hume: programming resource-limited systems using bounded automata" appears at the ACM Symposium on Applied Computing, and "The Design of Hume" is published in Springer's Domain-Specific Program Generation volume, consolidating the language's design rationale
2005
The EU Framework 6 project EmBounded (IST-510255) begins, coordinated by Kevin Hammond at St Andrews with Heriot-Watt University, Ludwig-Maximilians-Universität München, the LASMEA laboratory in Clermont-Ferrand, and timing-analysis firm AbsInt GmbH, to automatically identify, quantify and certify resource bounds for Hume programs; it runs to 2008
2006
EmBounded results are showcased in ERCIM News: prototype Hume implementations run in under 30KB on a standalone Renesas M32C development board, and real-time computer-vision algorithms written in Hume are targeted at LASMEA's CyCab autonomous vehicle
2008
Stable release 0.8 of Hume is recorded on April 25, and the humec compiler reaches version 1.0.3 in November - the final compiler release listed on the project site. The EPSRC-funded Islay project (2008-2011) at Heriot-Watt continues Hume-based research
2013
The Hume research programme winds down - the Heriot-Watt project page records it as having run from around 2000 to 2013 - leaving the compilers, reports and papers archived online but no further development

Notable Uses & Legacy

CyCab autonomous vehicle computer vision (EmBounded)

The flagship EmBounded case study developed real-time computer-vision algorithms in Hume that could detect road features from a moving vehicle, with the stated aim of applying them to the CyCab, an autonomous electric vehicle used by the LASMEA laboratory in Clermont-Ferrand - a domain where the project argued formally guaranteed memory and timing bounds matter more than raw throughput

Renesas M32C embedded deployment

EmBounded produced prototype Hume implementations compact enough to run in under 30KB on a standalone Renesas M32C development board (as reported by the project in ERCIM News, 2006), demonstrating that a garbage-collected, higher-order functional language could fit genuine microcontroller constraints

Certified worst-case timing with AbsInt's aiT

EmBounded partner AbsInt GmbH applied its aiT worst-case-execution-time analyser to compiled Hume code, so that timing guarantees for Hume programs rested on the same industrial-strength binary-level analysis used for avionics and automotive software

Resource-analysis research at LMU Munich and St Andrews

Hume served as the vehicle for a line of formal resource-analysis research: EmBounded researchers at Ludwig-Maximilians-Universität München and St Andrews built new theoretical models that predict dynamic memory and time bounds directly from Hume source, work in the amortised-analysis tradition that continued to develop long after the language itself went quiet

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: