Homespring.cloud

Interpreters

The original Homespring specification shipped with an interpreter and another implementation was created the next day. This page documents all of the known interpreter implementations, along with a compatibility matrix showing which interpreters can run which of the collected example programs.

Programs are grouped by author and listed under their original filenames.

The Interpreters

41%
Guile Scheme 2003-04-14
Jeff Binder
github.com/iamcal/Homespring
The original reference implementation.
17%
Perl 2003-04-15
Cal Henderson
github.com/iamcal/perl-Language-Homespring
The first third party interpreter, including a tree visualizer.
100%
OCaml 2005-11-24
Joe Neeman
github.com/jneem/homespring
Released along with an updated spec.
59%
JavaScript 2012-10-30
Quin Kennedy
github.com/quinkennedy/Homespring
The first JavaScript implementation.
100%
JavaScript 2017-01-29
Cal Henderson
github.com/iamcal/homespring.js
The implementation that powers this website.
3%
Rust 2017-12-19
Addison Bean
github.com/Addisonbean/Homespring-rs
An incomplete WIP — parses programs, but only a few node types and ticks are implemented.
3%
JavaScript 2018-05-30
Martijn Arts
github.com/martijnarts/homespring-js
A demo implementation with HTML visualizer.
28%
JavaScript 2023-01-02
James Thistlewood
github.com/jthistle/homespring-visualizer
A browser visualizer with an embedded interpreter; driven headlessly here.

The Example Programs

Example Description Scheme200341% Perl200317% OCaml2005100% JavaScript201259% JavaScript2017100% Rust20173% JavaScript20183% JavaScript202328%
Jeff Binder — 2003 · author of Homespring and its original Scheme interpreter
add.hs Reads two numbers from input and outputs their sum. yes no yes yes* yes no no no
cat.hs Echoes its input straight to output, like the Unix cat utility. yes no yes yes* yes no no no
first.hs A minimal "Hello, world" — a single hatchery feeding a bear. yes yes yes yes* yes no no yes
hello-1.hs "Hello, World!" using a universe, a hatchery, and snowmelt-powered rapids. yes yes yes yes* yes no no yes
hello-2.hs "Hello, World!" — an alternative arrangement using the power-override rule. yes yes yes yes* yes no no yes
hello-3.hs "Hello, World!" using marshy force, field-sense shallows, and a hydro-power spring. yes no yes yes* yes no no no
hi.hs Prompts the user for their name and greets them back with a "Hi". yes no yes yes* yes no no no
name.hs An acrostic program whose node names spell out HOMESPRING line by line. no no yes no yes no no no
null.hs The empty program — zero bytes, does nothing. yes no yes yes* yes no no no
quiz.hs A tiny maths quiz that asks "what's six times four?" and grades the reply. yes no yes yes* yes no no no
simple.hs The simplest possible non-empty program — a single node. yes yes yes yes yes yes yes yes
Cal Henderson — 2003 · author of the Perl interpreter
hello2.hs A compact "Hello, World!" — shipped with the Perl interpreter as a test program. yes yes yes yes* yes no no yes
Joe Neeman — 2005 · author of the OCaml interpreter
flipflop.hs A flip-flop that alternates state using an inverse-lock and a pair of pump/switch nodes. no no yes no yes no no no
tic.hs A tic-tac-toe implementation — the most elaborate program in the collection. no no yes no yes no no no
Quin Kennedy — 2012 · author of a JavaScript interpreter
reverse.hsg Reverses the input using a force.up node and a split.

Quin's example files don't run correctly on compliant interpreters, due to two important mistakes in the implementation.

The reverse*.hsg examples rely on the force up node allowing upstream salmon to move to the first child, which it should be blocking.

The split.hsg example relies on an incorrect implementation of append up where the appending logic is supposed to run in the misc tick, but instead runs in the fish tick down, before any upstream salmon have had a chance to arrive (or leave, from the previous tick).

reverse-2.hsg Reverses the input — a more poetic variant ("split wings calm the ebb and flow").
reverse-3.hsg Reverses the input — a third variation of the same arrangement.
split.hsg Splits input into pieces.
Benito van der Zander — 2013 · author of the HomeSpringTree compiler; most are generated from HomeSpringTree (.hst) sources
clock.hs(.hst) A ticking clock driven by the time node and a range-switch cascade. no no yes yes* yes no no no
count.hs(.hst) Counts from 0 to 9 and then to 100 using a bridged bear and hatchery cascade. no no yes yes* yes no no no
count2.hs(.hst) A more elaborate counter built from digit generators. no no yes no yes no no no
count3.hs(.hst) Another counter variant. no no yes no yes no no no
count4.hs(.hst) A larger counter implementation (~10 KB of source). no no yes no yes no no no
count.poem.hs(.hst) A counter written in the poetic style Homespring is intended to be read in. no no yes yes* yes no no no
count.poem.withfillers.hs A poetic counter with additional filler words for extra flow. no no yes yes* yes no no no
fizzbuzz.hs(.hst) Classic FizzBuzz — prints Fizz for multiples of 3, Buzz for 5, FizzBuzz for both. no no yes no yes no no no
fizzbuzz.poem.hs(.hst) FizzBuzz written in the poetic style — considerably longer. no no yes no yes no no no
fizzbuzztick.hs(.hst) A compact FizzBuzz variant driven by time ticks. no no yes no yes no no no
helloworld.hs(.hst) A fourth take on "Hello, World!" — generated from a HomeSpringTree source. no no yes yes* yes no no yes
Cal Henderson — 2026 · focused tests for this harness, each written to exercise one node whose behaviour the older programs barely touched
test-waterfall.hs Upstream salmon are blocked by the waterfall and spawn there instead of climbing to the leaf. no no yes no yes no no no
test-clone.hs clone duplicates each passing salmon, so every cycle emits multiple homeless before Hello. no no yes no yes no no yes
test-young-bear.hs young. bear eats every other mature salmon, letting only half the homeless fish reach the root. no no yes no yes no no no
test-spawn.hs spawn forces upstream salmon to spawn in place, so the output is the node's own name. yes no yes yes* yes no no yes
yes  runs correctly yes  runs correctly, with caveats (hover for details) no  does not run correctly (hover for details) ?  no canonical expected output

* Quin Kennedy's interpreter appends an extra newline to every output — the program produces the correct text but with one trailing \n beyond what the other interpreters emit.

Compatibility data is generated by the test harness in tests/, which runs every example above under every interpreter and writes per-adapter reports under tests/results/. Hover over a cell for further details about that specific result. The full interpreter source repositories are checked in as submodules under interpreters/.