mvm

mvm - a fast virtual machine for Go and beyond.

Run programs directly from source. Embed a full Go interpreter. Dynamically extend your apps. Batteries included.

go install github.com/mvm-sh/mvm@latest

Fast bytecode VM

Portable, stack-based virtual machine designed for low overhead.

Go-compatible

Aims to be fully compatible with Go — the same source, no compiler.

Embeddable

Drop into Go, C, or other host applications. See the examples.

REPL & debugger

Integrated interactive REPL, debugger, and test engine.

Batteries included

One single static binary, with the full standard library bundled in.

A quick taste

package main

import "iter"

func squares(n int) iter.Seq[int] {
	return func(yield func(int) bool) {
		for i := 1; i <= n; i++ {
			if !yield(i * i) {
				return
			}
		}
	}
}

func main() {
	sum := 0
	for v := range squares(4) {
		sum += v
	}
	println(sum)
}

Open in playground →

Run it

mvm
Start the REPL
mvm _samples/fib.go
Run a Go source file
mvm run -e "fmt.Println(1+2)"
Evaluate an inline expression
mvm test ./pkg
Run TestX functions in a package
mvm help
List subcommands

Learn more