Languages
Exec mode does not compile source code and does not use compilation plugins. What it runs depends on how you invoke it.
WebAssembly Binaries
wasmrun exec runs pre-built .wasm files through the built-in interpreter with WASI support. Any language that compiles to WASI-targeting WebAssembly works:
| Language | Typical toolchain | Compile with |
|---|---|---|
| Rust | wasm32-wasip1 target | wasmrust plugin or cargo build |
| Go | TinyGo | wasmgo plugin or tinygo build |
| C/C++ | Emscripten / wasi-sdk | C/C++ guide or clang --target=wasm32-wasi |
| AssemblyScript | asc | wasmasc plugin |
The plugin-based compile step belongs to Server Mode; use wasmrun compile (or your own toolchain) to produce the .wasm, then run it:
wasmrun compile ./my-rust-project
wasmrun exec ./dist/output.wasm
Source Execution (Agent API)
The Agent API extends exec mode with direct source execution. Language runtimes are not compiled locally; they are WASM modules fetched from wasmhub and executed inside the same sandboxed interpreter:
| Language | Aliases | Runtime |
|---|---|---|
| JavaScript | js, nodejs | wasmhub nodejs runtime (CommonJS require(), Node built-ins, web globals) |
| TypeScript | ts, tsx | Transpiled in-sandbox by the wasmhub swc module, then run on the nodejs runtime |
See JavaScript runtime capabilities for the supported built-ins and limits. Unsupported languages (for example python) return HTTP 400; more runtimes will arrive as they land on wasmhub.
What Goes Where
- Compile a language to WASM: Server Mode languages, powered by plugins
- Run a
.wasmfile natively: exec mode, this section - Run JS/TS source in a sandbox: the Agent API
- Browser-based multi-language execution: OS Mode language selection, also powered by wasmhub runtimes