mruby-compatible · Pure Rust · Wasm-first

Ruby for the edges.

mruby/edge is a virtual machine built from scratch in Rust for WebAssembly. It runs mruby bytecode in small, portable modules and embeds cleanly in Rust applications.

$ cargo install mrubyedge-cli

$ mrbedge -e 'puts RUBY_ENGINE'
mruby/edge

$ mrbedge app.rb
$ mrbedge app.mrb

Current runtime

Small core.
Useful boundaries.

The VM focuses on the Ruby features needed to run real programs at the edge, while keeping WebAssembly host integration explicit.

01 / VM

mruby bytecode, rebuilt in Rust

The core VM loads .mrb bytecode. Its Ruby subset includes classes and modules, exceptions, blocks and closures, control flow, and keyword arguments.

02 / WASM

WASI or host-defined WebAssembly

Build for wasm32-wasip1, or target wasm32-unknown-unknown with --no-wasi. Minimal builds can stay under 400 KiB.

03 / ABI

Typed imports and exports with RBS

Sidecar .import.rbs and .export.rbs files connect Ruby methods to WebAssembly functions across the host boundary.

04 / PROFILES

Only the features you need

Cargo flags add Regexp, Random, instruction limits, or FNV-backed hashes. SharedMemory provides direct access to Wasm linear memory.

CLI workflow

From Ruby to Wasm.

mrbedge compiles Ruby source, runs source or precompiled bytecode, starts a REPL, and generates WebAssembly modules.

The core VM executes bytecode; source compilation is provided by the CLI. For the exact supported Ruby surface, see the compatibility coverage.

# app.rb
def add(a, b)
  a + b
end

# app.export.rbs
def add: (Integer, Integer) -> Integer

$ mrbedge wasm app.rb -o app.wasm
[ok] wasm file is generated: app.wasm

On stage

Two chapters
of mruby/edge.

From building a new mruby-family VM for Wasm to deploying Ruby applications across edge platforms with Uzumibi.

RubyKaigi 2024

An mruby for WebAssembly

Why mruby/edge began, how its bytecode VM works, and how Ruby methods become WebAssembly exports—plus the project’s early Component Model ambitions.

RubyKaigi 2026

Uzumibi: Reinventing mruby for the Edges

The evolved VM—OOP, exceptions, closures, keyword arguments, and feature flags— meets Uzumibi, a lightweight framework for portable Ruby edge applications.

Built with mruby/edge

Ruby, where
it matters.

mruby/edge runs beneath products that bring Ruby to different WebAssembly hosts—from spreadsheet formulas to Cloudflare Workers.

Google Sheets

sheetruby

Write Ruby as a Google Sheets custom function. sheetruby embeds the VM in Google Apps Script and evaluates formulas through WebAssembly.

Explore sheetruby ↗
Edges (Cloudflare Workers)

Uzumibi

Build and deploy Ruby applications for Cloudflare Workers with an mruby/edge-powered WebAssembly runtime.

Explore Uzumibi ↗

Dive deeper

Project resources.

Source, API references, published crates, and a browser playground.