mvm v0.4.0
Mvm is a Go interpreter: it compiles source to bytecode and runs it on a stack
VM, ships as a single static binary with the full standard library bundled in,
and embeds in Go or C host programs. Status is still alpha.
This release reworks how interpreted types meet native Go code, grows standard-
library and third-party compatibility substantially.
Highlights
- Native-speed interface dispatch. Method dispatch now synthesizes a real
Goreflecttype carrying the interpreted method set, replacing the old
per-call interface-bridge + argument-proxy layer and ~1800 lines of
hand-written shadow packages. An interpreted type can now satisfy several
native interfaces at once (e.g.Stringerandjson.Marshaler), and
reflect-walking native code sees interpreted methods on nested struct fields.
(ADR-021) - More real Go runs. 90 of 169 bridged stdlib packages and 16 of 50 curated
external modules now pass their full upstream test suite undermvm test,
with many more passing a majority. Newly green this cycle includeerrors,
text/tabwriter,log/log/slog,html/template,io/fs,runtime/debug,
andgo/types. - Preliminary complex numbers, multi-file
mvm run a.go b.go, and
cross-language benchmarks (Go, Lua, Python) underbench/. - Faster. Sieve of Eratosthenes drops from 100 ms to 32 ms (-68%), beating
lua5.4on that benchmark by ~14%.
Notable changes
Changed
- Generics inference reworked: type parameters bind through the symbol table by
identity rather than name-substitution, closing a class of inference gaps
(slices/mapsnow infer at parity withgo build). - Interface satisfaction is signature-aware (
Unwrap() []errorno longer
spuriously satisfiesinterface{ Unwrap() error }). slices,maps, andtesting/quickare now fully interpreted rather than
bridged.
Fixed
- The zero value of a
map/slicevariable is now nil, matching Go; composite
literals andmakestay non-nil, and a write to a nil map is a recoverable
panic. - Remote modules with a major-version suffix (
v2+) resolve correctly
(e.g.github.com/blang/semver/v4). - Many parser, generics, numeric, and native-boundary fixes.
Removed
- The hand-written shadow bridge packages (
errorsx,fmtx,jsonx,xmlx,
gobx), superseded by synthesized rtypes.
Full details in the CHANGELOG.