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
The Example Programs
| Example | Description | Scheme200341% | Perl200317% | OCaml2005100% | JavaScript201259% | JavaScript2017100% | Rust20173% | JavaScript20183% | JavaScript202328% |
|---|---|---|---|---|---|---|---|---|---|
| Jeff Binder | |||||||||
| 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 | |||||||||
| 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 | |||||||||
| 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 | |||||||||
| 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 The |
|||||||
| 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 | |||||||||
| 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 | |||||||||
| 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 |
* 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/.