A demo of how to work with WebAssembly components in wasmtime
You will need the following tooling installed:
rustup
which call gives you cargo/rustcwasm32-unknown-unknown
target which you can install with rustup target add wasm32-unknown-unknown
wasm-tools
which you can install with cargo install wasm-tools
First, build the wasm module:
cargo build --target wasm32-unknown-unknown --release -p markdown
The convert it into a component:
wasm-tools component new ./target/wasm32-unknown-unknown/release/markdown.wasm -o markdown-component.wasm
Then run the demo:
cargo run markdown-component.wasm
Thank you to everyone who is working on WebAssembly tooling.
Additionally, this is based on the following work: