mvm v0.3.0
A Go interpreter that compiles to bytecode and runs on a small stack VM — single
static binary, full standard library bundled, embeddable in Go and C.
Added
clearbuiltin (maps and slices) — the last builtin mvm was missing.comparableas a generic constraint, plus broader generics-parsing improvements.mvm run <import-path>fetches and runs a remotemainpackage; trailing args
become itsos.Args.mvm testruns and validatesExample*functions (output checked against the
// Output:comment), and-bench REGEXruns benchmarks through nativetesting.-statprints compile/execute statistics on bothrunandtest.interp.ExitErrorlets embedders catch interpretedos.Exit/log.Fatal*as a
typed error instead of terminating the host (ADR-018).cmd/mvmlint, a small linter for mvm-specific code patterns.- Stdlib bridges for
encoding/gob;encoding/xmlround-trips via a newxmlx
shim (interpretedxml/Textmarshalers work through nativeencoding/xml
in both directions). - Native method hooks and composite interface bridges (one interpreted type
satisfying several native interfaces at once). - Test infrastructure to run the Go standard library's own external
_test.go
suites against mvm's reflect bridges.
Changed
- Exit virtualization (
os.Exit,log.Fatal*) is now unconditional and wired
automatically on the firstEval(ADR-018). - Load/parse/compile errors report
file:line:colwith a source snippet and a
caret; runtime panics print a unified interpreted + native stack. mvm test -statprints the stats block after the test output, just before
PASS/FAIL.- Build targets split:
make test(race only),make cover(coverage), and a new
make fast(-short+ race) for a quick inner loop.
Fixed
Numerics (untyped-constant/float mixing, zero value, per-frame cache),
pointer-receiver method lookup and interface wrapping, type switches
(TypeBranch + interface-wrapper edges), and generics/inference (no type loss in
multi-return; inference on func-typed params), among others. Full list in
CHANGELOG.md.
Also new: a live compatibility matrix
https://mvm.sh/compat — mvm now runs the real test suites of the standard
library and ~50 popular packages through the interpreter every week and publishes
per-package pass / partial / fail with a trend over time. ~96% of individual test
cases pass today; the generator is itself a Go program run through mvm. Honest
numbers on purpose.
Try it in the browser: https://mvm.sh/playground
Install: go install github.com/mvm-sh/mvm@latest
Questions & feedback: https://github.com/mvm-sh/mvm/discussions