This example is provided as a guide for using a wit-bindgen
guest written in
Rust with Gravity.
Gravity doesn't use WebAssembly itself, so you'll want to add the
wasm32-unknown-unknown
target to your toolchain.
rustup target add wasm32-unknown-unknown
Gravity currently needs a "Core Wasm" file with an embedded WIT custom section. This can be built via Cargo Examples
cargo build --example examples --target wasm32-unknown-unknown
Gravity can be run against the Wasm file produced in Rust's target/
directory.
cargo run target/wasm32-unknown-unknown/debug/examples/examples.wasm -o examples/examples.go --world examples
The above command will produce a examples.go
and examples.wasm
file inside
the examples/
directory. These could be used within a Go project.