TYCHO Search

Search documentation

    ↑ ↓ to move · Enter to open · Esc to close

    What the next program says the language needs

    Status: DONE. Program: bytecode compiler for the Scheme interpreter — tools/tycho-scheme grew a compile front end lowering Scheme to tycho-vm bytecode. Outcome: differential byte-identical on all six programs; one real compiler bug found and fixed; no language phases.

    This plan is a fresh clone, 2026-08-03: the completed tycho-scheme plan lives at docs/internals/plan-tycho-scheme-DONE.md. The rule from that plan holds here: *does anything that is not the program written to want it need this?* A finding becomes a phase only when a second, independent caller exists.

    The program

    A bytecode compiler for the Scheme interpreter -- tools/tycho-scheme grows a compile front end that lowers Scheme to tycho-vm bytecode, so tycho-scheme and tycho-vm converge. It is the first real customer for tycho-vm's instruction encoding and const pools outside the tool's own fixtures, and it re-exercises the interpreter's reader (reused verbatim), symbol interning (the const pool), and scalar-match dispatch at a new scale. The differential gate: compile the same four programs, run them on the VM, and the output must be byte-identical to the interpreter's golden.

    Design, settled before a line of code:

    Findings

    The compiler works -- the differential is byte-identical. All six programs (fib, closures, ho, sort, shadow, eqsym) compile to tycho-vm bytecode and the VM's run matches the interpreter's golden byte-for-byte, including the two counter closures staying independent (1 2 1). The gate asserts that differential on every run. What the build found, all tool-level (none became a phase -- nothing outside the compiler wants it):

    Phases

    (none -- a finding becomes a phase only when a second, independent caller needs it)