# shen $ make && make test

Build & run

Make targets

// zincvm · zinctest · zincdec · globals.csexp
git clone --recurse-submodules https://github.com/fixpoint-linux/shen-meta.git
cd shen-meta
make setup    # clone shen-scheme if not already present
make          # build C VM + decompiler (uses cosmocc, Cosmopolitan)
make test     # run 34 built-in bytecode tests
make pipeline # compile (+ 1 2) through full pipeline
make bundle   # compile bundle .shen via shen->kl → globals.csexp
make run-bundle  # run C VM with self-hosting bundle
make gate     # test + test-asan

Requires shen-scheme (Shen 41.2 on Chez Scheme) at vendor/shen-scheme/ to bootstrap the serializer. The shipped bundle is compiled by our own shen->kl.

Bytecode decompiler

// ./zincdec globals.csexp <function> [--raw|--asm|--shen|--csexp]

Standalone binary for inspecting bundled bytecode. Four output formats plus a --curried scan that flags curried partial-application calls (which the C VM can't run) and exits 1 if any are found.

./zincdec globals.csexp reverse --asm
0000: pushmark
0001: number 0
0002: prim emptylist
0003: access 0
0004: global shen.reverse-help
0005: appterm

Per-closure tracing

// ./zincvm globals.csexp --trace + --trace reverse

Trace execution of specific closures as they run, showing each instruction in raw format with PC numbers. Traces only the named function — not functions it calls unless you --trace them too.

Self-hosting test matrix

// 34 built-in VM tests + 10 self-hosting tests + GC stress
TestWhat it proves
1(+ 1 2) via bundled + → 3
2(reverse [1 2 3]) → [3 2 1]
3(factorial 5) → 120
A/B/Ctoplevel-interp / interp on tag forms
5eval-kl [+ 1 2] via marshal chain → 3
6-7read-file-as-string / load via bundled chain
7bread-from-string "(+ 1 2)" → [[+ 1 2]]
8-10load util.shen / id closure / newvar (gensym)