mvm – a fast virtual machine for Go

erdaniels1 pts0 comments

mvm - a fast virtual machine for Go

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.

Try it in the browser →<br>View on GitHub

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] {<br>return func(yield func(int) bool) {<br>for i := 1; i<br>Open in playground →

Run it

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

Learn more

Documentation — entry point

Architecture — pipeline, memory model, key design decisions

Contributing

fast virtual machine source repl func

Related Articles