MatchBox
MatchBox is the Rust runtime for BoxLang, shipping to native binaries, the browser, WASI, AWS Lambda and ESP32
What is MatchBox?
MatchBox is a Rust implementation of the BoxLang runtime. It sits alongside the JVM runtime as its Rust counterpart. BoxLang compiles to bytecode, and a Rust VM runs it. Core and native builds need no JVM.
Documentation
CLI reference
Examples
Source code
Docs source
Why MatchBox?
The JVM runtime brings the full Java ecosystem and broad module coverage. MatchBox targets the places a JVM does not fit.
Single binaries: ship a CLI tool or service as one file, with a VM core of about 4.7 MB.
Browsers: run BoxLang through WebAssembly and JavaScript, including Cloudflare Workers.
WASI containers: run WebAssembly workloads outside the browser.
Serverless: AWS Lambda support is in preview.
Microcontrollers: run on ESP32 devices.
Install
MatchBox Version Manager (MVM) installs and switches MatchBox versions.
Use the install.ps1 script from the matchbox-quick-installer repository in PowerShell.
Then install and activate MatchBox:
If matchbox is not found, run mvm doctor.
Use
Run a script:
Build a standalone native executable:
The executable contains your bytecode appended to a runner stub. Use --strip-source to remove the source text.
Targets
Native
CLI tools and local applications
Browser and JavaScript
Client-side apps, libraries and Cloudflare Workers
WASI
Experimental WebAssembly workloads in WASI hosts
AWS Lambda (preview)
Serverless functions with small cold starts
ESP32
Embedded devices
See the dedicated pages for compiled native binaries, WASM in the browser, WASM containers, and ESP32.
How MatchBox Relates to BoxLang on the JVM
MatchBox complements the JVM runtime and does not replace it.
Runtime
JVM
Rust bytecode VM with a tiered Cranelift JIT
Java ecosystem and interop
Full
Experimental in native builds, needs a JDK
Module coverage
Broad
Differs, check your target
Single-file executable
No
Yes
Browser and ESP32
No
Yes
Runtime APIs and module support differ between the two. Check compatibility for your target before you commit, and read Differences from BoxLang.
Native Fusion
Native Fusion lets you call Rust from BoxLang, call BoxLang from Rust, and reach Java classes from native builds. Learn more in the Native Fusion guide.
Last updated
Was this helpful?
