Subrust: a no_std, alloc-free interpreter for a Rust subset
Subrust is a zero-dependency, no_std/no-alloc interpreter for a Rust subset that guarantees rustc-identical behavior and bootstraps from a 229-byte seed.
Subrust is a dependency-free interpreter for a strict subset of Rust where every accepted program is also valid Rust and behaves identically under rustc. A differential test suite enforces two invariants — the source compiles (L1) and produces the same result as rustc's debug-profile semantics (L2). The library is #![no_std], heap-free, forbids unsafe code, and has zero dependencies.
That combination targets sandboxed, deterministic, air-gapped systems that need user-editable control logic. A script can be hot-reloaded and interpreted during development, then the identical source is compiled natively with rustc for release, leaving no interpreter in the shipped binary. Fuel limits, call-depth bounds, and memory caps guarantee untrusted scripts always terminate and can only invoke effects the embedder explicitly exposes — making the design viable for microcontrollers and even kernel-space code.
The language itself is a tower of three strictly nested subsets (SR-seed ⊂ SR-intermediate ⊂ subrust ⊂ Rust), each one valid Rust. The whole toolchain is reproducible from a 229-byte hex0 seed with no reliance on a pre-existing compiler — a classic C-based bootstrap path and a separate C-free path both produce a byte-identical interpreter, cross-checked against rustc.