Start here: the twin in a page
The twin is the reference simulation, the same rules the console’s worlds run, built as one WebAssembly module of 434,093 bytes (162,549 brotli’d). A world is a grid of integer words, one a cell, and a step is a pure function of the last: the same world, the same ops at the same frames, the same digest, on any machine. That is the contract every example on these pages stands on, and the one the replay below tests.
This is the twin, running in this page. It opened a 64-cell cube with a sea, an island and a spring, and steps it twenty times a second on a worker; the line under it is its frame, the first eight hex digits of its digest, and what it holds.
sl_stepThree ways in
- A world someone made:
[[world: <cart>]]in a page mounts the player on a cart, a world’s files and its record, with the replay witness the site checked when it built (the player). - A demo:
[[view: <id>]]mounts the view you are looking at, on a world, the ops laid on it and the steps it runs before you see it. The demos are listed in the engine’s own table,web/api.json, beside the exports they show (the engine). - By hand: the worker is a plain message protocol (the worker). Open a world, change it, step
it, run it, read its state back (this fence is written by tools/reference_pages.py from the demo
op-spherein the engine’sapi.json, its world and its op, so the code shown and the view under it cannot part):
// from a page at the site's root; the worker fetches, so it is given whole addresses
const at = (p) => new URL(p, document.baseURI).href;
const worker = new Worker(at("media/toys/lab-worker.js"), { type: "module" });
worker.onmessage = (e) => {
const m = e.data;
if (m.type === "state" && m.opened) {
worker.postMessage({ type: "op", op: { op: "sphere", x: 32, y: 8, z: 32, r: 4, mat: 2 } }); // the demo's op, at frame 0
worker.postMessage({ type: "run", on: true });
}
if (m.type === "state") console.log(m.frame, m.digest, m.census);
};
worker.postMessage({
type: "open",
wasm: at("media/world-rt/starlab_wasm.wasm"),
files: { "meta.lua": at("media/house/worlds/cube/meta.lua"), "grid.png": at("media/house/worlds/cube/grid.png") },
lay: at("media/house/worlds/cube/lay.json"),
});
That script is this demo: a sphere of water, radius 4, dropped over the island at frame 0.
sl_op_sphereTell it from a card
A StarScript card reaches the page it is on: set tell.world "meteor" is a value kept like any other, and told to the
page as it is set. Here the live view answers it: a meteor drops a ball of lava, a comet one of ice, a flash flashes
the view. Press Play on the card, with the view below it in sight.
tell.world · press Play
say s2ar "Tell the world: a meteor, a comet, a flash."
set tell.world "meteor"
say s2ar "The view beside this board took the strike."
set tell.world "flash"
end
tell.worldReplay it
A tape is the world as it opened and every op at its frame. Laid on a fresh world and stepped to its last frame, it gives the digest it was taken with, or it is not the same world: a reader refuses an op it does not know, by name, rather than skip it (the tape’s format). This one is two ops, lava at frame 30 and ice at frame 90, laid and stepped to frame 200.
loadWhere next
The tree on the left is the whole reference, folded: the engine’s exports, the worker’s messages, the view’s look, the board’s runtime, StarScript’s verbs, the formats and the apps’ verbs. Every page has a plaintext twin, the link under its title, for a reader that wants the words without the page.
The work on this page: the commits of the last 30 days on its sources, the work open against them, its checks
starlens 74b1736reference: a hand page's code fences written from their sources, and the one that had drifted (2026-11-09)
starlens 7bdd356site: the start guide's way on names the board's runtime (2026-11-06)
starlens 6f99688site: the reference, her layout: the API reference on the left (collapsed), the documentation on the right with the twin live in it; the first guide; the parser in the page documented beside a card you rewrite (D3, D4, D6 of the reference lane; X1's docs, 2026-11-05)
The work record as of , from the fold on tower.
Nothing open against these sources.
- FAIL
lint/web-reference
Generated by tools/reference_pages.py from reference-prose/guides/start.md (by hand; its fences from their sources); the twin bfaad079a7ce (434093 bytes). The words are a draft.