| Crates.io | moonbit-wasm-runner |
| lib.rs | moonbit-wasm-runner |
| version | 1.2.0 |
| created_at | 2025-11-26 10:40:35.580372+00 |
| updated_at | 2025-11-26 10:40:35.580372+00 |
| description | Flexible CLI tool to run MoonBit‑generated WebAssembly modules using Wasmtime |
| homepage | https://github.com/isurfer21/moonbit-wasm-runner |
| repository | https://github.com/isurfer21/moonbit-wasm-runner.git |
| max_upload_size | |
| id | 1951231 |
| size | 62,868 |
A flexible CLI tool to run MoonBit‑generated WebAssembly modules using Wasmtime.
It supports interactive prompts, custom function invocation, argument passing with type annotations or autodetection, and verbose logging for debugging.
.wasm files compiled from MoonBit or other sources.--func (default: _start).--args:
i32:5,f64:3.14,string:hello,bool:true5,3.14,hello,true,false"true" / "false" → booleans; "1" / "0" → integersbool:true, bool:false, bool:1, bool:0--verbose for detailed execution info.Clone the repository and build:
git clone https://github.com/isurfer21/moonbit-wasm-runner.git
cd moonbit-wasm-runner
cargo build --release
The binary will be available at:
target/release/moonbit-wasm-runner
moonbit-wasm-runner <wasm_file_path> [OPTIONS]
| Flag / Option | Description |
|---|---|
<wasm_file_path> |
Path to the .wasm file to execute. If omitted, prompts interactively. |
-f, --func <name> |
Name of the exported function to run (default: _start). |
-a, --args <list> |
Comma‑separated list of arguments. Supports explicit type annotations or autodetection. |
-v, --verbose |
Enable verbose logging. |
-h, --help |
Show help menu. |
-V, --version |
Show version. |
_start functionmoonbit-wasm-runner ./main.wasm
moonbit-wasm-runner ./main.wasm --func add
moonbit-wasm-runner ./main.wasm --func add --args 5,10
moonbit-wasm-runner ./main.wasm --func add --args i32:5,i32:10
moonbit-wasm-runner ./main.wasm --func scale --args 3.14,2.71
moonbit-wasm-runner ./main.wasm --func scale --args f64:3.14,f64:2.71
moonbit-wasm-runner ./main.wasm --func concat --args hello,world
moonbit-wasm-runner ./main.wasm --func concat --args string:hello,string:world
moonbit-wasm-runner ./main.wasm --func toggle --args true,false
moonbit-wasm-runner ./main.wasm --func toggle --args bool:true,bool:false
moonbit-wasm-runner ./main.wasm --func add --args 42,7 --verbose
| Annotation | Example | Autodetection |
|---|---|---|
i32 |
i32:5 |
5 |
i64 |
i64:42 |
— |
f32 |
f32:3.14 |
— |
f64 |
f64:2.71 |
3.14 |
string |
string:hello |
hello |
bool |
bool:true, bool:false, bool:1, bool:0 |
true, false |
moonbit-wasm-runner/
├── src/
│ └── main.rs # CLI + Wasmtime runner
├── Cargo.toml # Dependencies (clap, wasmtime)
└── README.md # Documentation
--bench) to measure execution time.MIT License. See LICENSE for details.