Sigil 0.12.0
Register VM stabilized, stack VM removed, and experimental native C codegen. This release makes the register-based virtual machine the sole execution backend — the legacy stack VM and direct compiler have been removed. The register VM is now battle-tested across production MCP servers (folio, courier, bureau) and the full Sigil ecosystem. This release also introduces an experimental C native code generation backend.
Stack VM Removal
The stack-based virtual machine and direct compiler have been removed. The CPS compiler and register VM are now the only toolchain — no opt-in flags needed.
- Removed stack VM interpreter, direct compiler, and CPS stack emitter
- Removed mixed-mode dispatch
- Renamed opcodes and headers (
ROP_→OP_,regvm.h→opcodes.h) - SGB format v8+ only (older binaries rejected)
Register VM Stabilization
The register VM introduced as opt-in in 0.11.0 is now the default and only backend. It has been stabilized through extensive testing and production use:
- All ecosystem tests pass (~2,700 tests across 23 repos)
- Running in production as the backend for MCP servers (folio, courier, bureau, minder)
- 20+ bug fixes addressing edge cases in exception handling, macro hygiene, continuations, and module loading
Experimental Native C Codegen
New --backend=native flag for sigil build compiles Sigil programs to C, then to native binaries via the Zig toolchain. This is opt-in and experimental.
The native codegen compiles CPS IR directly to C functions with a trampoline-based calling convention. All modules — entry and dependencies — are compiled to native C. Features:
- Full-program native compilation — all modules compiled to C, linked into a single binary
- Module system support — cross-module calls, binding caches, module initialization
- Delimited continuations — fiber-based C stack capture via ucontext (Linux/glibc)
- Async goroutines — native fibers for concurrent I/O (scheduler, stdin read loops)
- GC integration — shadow stack for local variables, conservative C stack scanning, trampoline closure rooting
- MCP server support — folio and courier run as native MCP servers through Claude Code
87 of 91 native differential test files pass (matching bytecode output). The native backend is functional for real applications and delivers significant performance improvements over the bytecode VM.
Platform Limitations
- Linux (glibc): Full support including async fibers
- Linux (musl): Builds and runs, but no fiber support (musl ucontext stubs return ENOSYS)
- macOS: Builds and runs, but no fiber support (ucontext is deprecated)
- Windows: Builds and runs, but no dynamic native module initialization
Async goroutines require fiber support. On platforms without it, persistent servers (MCP, HTTP) that use goroutines for I/O will not work in native mode.
Bug Fixes
- Fix macro hygiene: literal comparison and free identifier resolution
- Fix
let*variable scope leak causing GET_CELL crash - Fix
raise-continuablein tail position - Fix GC use-after-free in compile-file for dependency builds
- Fix register VM parallel arg move clobbering in tail calls
- Fix
define-librarybody defines leaking to top level - Fix
guard/with-exception-handleracross eval boundaries and tail calls - Fix
collect_internal_definesand capture analysis for module bodies - Fix MCP server crash on
resources/templates/listrequests