78db15fc04b4bc9f13b670f29c6304cfcb702ff2
This repository demonstrates how to use quickjs-wasm-rs with wasmtime to easily build a safe and isolated plugin system for Rust.
Code to accompany blog post: https://reorchestrate.com/posts/plugins-for-rust
First build-wasm.sh script which will download and build the quickjs.wasm module.
Examples
Run a sequential executor:
cargo run --example iter --release
Run a parallel executor:
cargo run --example par_iter --release
Both accept additional arguments like:
cargo run --release --example iter -- \
--module ./quickjs.wasm \
--script ./track_points.js \
--data ./track_points.json \
--iterations 1000 \
--inherit-stdout \
--inherit-stderr
Build
cargo build --package quickjs --release
Test
cargo test --package quickjs --release
Bench
cargo bench --package quickjs
Credits
- Peter Malmgren https://github.com/pmalmgren/wasi-data-sharing
- Shopify https://github.com/Shopify/javy
- Bytecode Alliance https://github.com/bytecodealliance/wasmtime
- Bytecode Alliance https://github.com/bytecodealliance/wizer
Description
Languages
Rust
86.5%
JavaScript
8.7%
Shell
4.8%