WASM in the Browser
Learn to deploy BoxLang in the browser using WASM and MatchBox
JavaScript + WebAssembly
Mode
Command
Use case
Mode 1: JavaScript ES Module (AOT)
Compile
matchbox --target js my_lib.bxs
# Produces: my_lib.js + my_lib.wasmUse in HTML
<!DOCTYPE html>
<html>
<head><title>BoxLang App</title></head>
<body>
<script type="module">
import { greet, calculate } from './my_lib.js';
const result = await greet("Developer");
document.body.textContent = result;
</script>
</body>
</html>Use in Node.js
Exporting Functions
Mode 2: Raw WASM Binary (AOT)
Mode 3: Runtime Mode (Dynamic Execution)
HTML Integration
Persistent VM (calling functions by name)
JavaScript Interop from BoxLang
Serving Locally for Development
Production Deployment
Last updated
Was this helpful?
