Use this skill when compiling BoxLang scripts to standalone native executables using MatchBox's --target native flag, cross-compiling for multiple platforms, optimizing binary size, and using Native Fusion to expose Rust functions as BoxLang built-in functions.
MatchBox can compile BoxLang source code to standalone native executables using --target native. The resulting binary embeds a small Rust runner stub (~500 KB) with the compiled BoxLang bytecode appended, requiring no JVM or MatchBox installation on the target machine.
# Compile script to a native executable (same OS/arch as build machine)
matchbox --target native app.bxs
# Output: ./app (or app.exe on Windows)
# Run it
./app --config=prod.json --debug
The binary accepts the same CLI argument format as the matchbox runner.
Build for multiple platforms using GitHub Actions (recommended) or the cross Rust tool:
# .github/workflows/release.yml