STASIS
Documentation / start here

Learn the contract.

Stasis keeps state, time, and publication boundaries visible. These pages use small examples from the current language and runtime docs.

01 / First program

A complete loop

Initialize once, advance one deterministic tick at a time, then project state to the host.

global ticks: i32;

function main(): i32 {
  ticks = 0;
  return 0;
}

function tick(): i32 {
  ticks += 1;
  return 0;
}

function render(): i32 {
  return 0;
}
02 / Runtime rhythm

Four lifecycle entries.

01

main()

Initialize global state and request host resources.

02

tick()

Read the input snapshot and commit simulation changes.

03

render()

Project current state into drawing commands.

04

on_code_swap()

Repair invariants after a compatible edit.

CLI workflow

stasis new arena
stasis fmt
stasis check
stasis test
stasis play

Use the formatter and checker early; tests use the same language and compiler path. On the desktop JIT target, stasis play is the primary graphical development loop: save a .stasis file, let the candidate compile in the background, then publish it as one atomic swap between ticks. Compatible running state is kept, so edit → save → see the result stays fast.