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:
R, the root, the program's top-level body.M, a module, a named group of definitions.D/U, a data structure or a union, the shapes your values take.F, a function body, a block of commands; a closure is the same thing, unnamed.N, a native definition, where a primitive is given a per-target implementation.$, a state binding, the only thing that really changes.=, a let binding, a name for the result of a call.>, an effect, a value emitted into a channel.#, a literal value./, a comment.
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.