github mvm-sh/mvm v0.4.0
mvm v0.4.0

5 hours ago

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
    Go reflect type 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. Stringer and json.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 under mvm test,
    with many more passing a majority. Newly green this cycle include errors,
    text/tabwriter, log/log/slog, html/template, io/fs, runtime/debug,
    and go/types.
  • Preliminary complex numbers, multi-file mvm run a.go b.go, and
    cross-language benchmarks (Go, Lua, Python) under bench/.
  • Faster. Sieve of Eratosthenes drops from 100 ms to 32 ms (-68%), beating
    lua5.4 on 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/maps now infer at parity with go build).
  • Interface satisfaction is signature-aware (Unwrap() []error no longer
    spuriously satisfies interface{ Unwrap() error }).
  • slices, maps, and testing/quick are now fully interpreted rather than
    bridged.

Fixed

  • The zero value of a map/slice variable is now nil, matching Go; composite
    literals and make stay 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.

Don't miss a new mvm release

NewReleases is sending notifications on new releases.