forth stepper

A Forth interpreter that moves one step at a time: one token of the outer interpreter, or one compiled instruction of the inner one. Stack cells carry a tag (n, addr, xt, flag); headers and compiled code take space at HERE, as in gforth, so the data-space panel shows where each , lands. The default program is counting change; it opens paused inside 10 4 cc.

The machine is one immutable map and step goes from state to state, so undo is the previous state. The properties: running to completion equals stepping one step at a time (and equals any prefix of steps, step-overs and step-outs followed by a run); undo(step(s)) = s; and cc gives 1, 2, 39, 218, 292 for 1, 9, 49, 91, 100 against coins 1 5 10 25 50.

Engine: wal-sh.tools.forth-stepper.core (host-neutral .cljc, tested on the JVM with test.check); adapter: wal-sh.tools.forth-stepper.browser. Build with gmake tools-cljs; debug in isolation with gmake dev-tool TOOL=forth-stepper. Ported from a Forth Stepper prototype.