Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

🎮 Playground

Write and run BoxLang in your browser. MatchBox is compiled to WebAssembly, and your code never leaves your device.

🎓 Online Course

Ten lessons, from your first script to building and shipping a standalone binary.

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

Target
Use it for

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

How MatchBox Relates to BoxLang on the JVM

MatchBox complements the JVM runtime and does not replace it.

BoxLang on the JVM
MatchBox

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?