boxlang-runtime-wasm-containerlisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang WASM Containers (Server-Side)
## Overview
MatchBox can compile BoxLang source to **WebAssembly (WASM)** for server-side execution. WASM containers run without a JVM and are sandboxed by design, making them ideal for edge deployments, FaaS, and microservices in minimal OCI containers.
> This skill covers **server-side WASM** (Wasmtime, WasmEdge, OCI containers). For browser/Node.js WASM, see the [`wasm-in-the-browser`](../wasm-in-the-browser/SKILL.md) skill.
---
## Compiling to WASM
```bash
# Compile to .wasm
matchbox --target wasm my_service.bxs
# Output: my_service.wasm
```
---
## Running with Wasmtime
```bash
# Install Wasmtime
curl https://wasmtime.dev/install.sh -sSf | bash
# Run the WASM module
wasmtime my_service.wasm
# With filesystem access (needed for file I/O)
wasmtime --dir=. my_service.wasm
# With network access (experimental WASI sockets)
wasmtime --wasi-modules=experimental-wasi-sockets my_service.wasm
# Pass CLI arguments
wasmtime my_service.wasm -- --input=data.json --debug
```
---
## Running with WasmEdge
```bash
# Install WasmEdge
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
# Run
wasmedge my_service.wasm
# With WASI filesystem
wasmedge --dir=. my_service.wasm
```
---
## OCI Container (Minimal Docker Image)
Build a Docker image containing only the WASM binary — results in an extremely small image:
```dockerfile
# Multi-stage: compile with MatchBox, package as WASM container
FROM