rylev / wasmtime-component-demo

A demo of how to work with WebAssembly components in wasmtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebAssembly Components Demo

Prerequisites

You will need the following tooling installed:

  • rustup which call gives you cargo/rustc
  • The wasm32-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

Running

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

Thanks

Thank you to everyone who is working on WebAssembly tooling.

Additionally, this is based on the following work:

About

A demo of how to work with WebAssembly components in wasmtime


Languages

Language:Rust 100.0%