Blog

JSON And The Algorithms

Phase One 8 May 2026

Underneath the friendly syntax, a Program is stored as something almost defiantly plain: nested JSON arrays. Each array is a command, and its first element says which command it is. The whole language is a short list of these. Here is a small program in stored form, a piece of state, a derived label, and a line out:

[
    ["R", [
        ["$", "count", "Maths.Integer", 0],
        ["=", "label", "Text", ["Maths.Integer.ToString", [], ["count"]]],
        [">", "Console.Line", [], ["label"]]
    ]]
]

Every row is one command, named by its first element:

That really is most of it. A function is a sequence of = bindings ending in a value; a binding's value is a call, written as a name with its arguments; an effect is the same but emitted rather than returned. Because the form is this regular, walking it and emitting code is almost mechanical, which is exactly why Program can render the same module into JavaScript, Swift, Go, Rust and the rest, each target being a small plug-in that knows how to print each command in its own punctuation. The JSON is the source of truth; every other language is a view of it.

← Back to the blog