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-unknownGravity currently needs a "Core Wasm" file with an embedded WIT custom section.
This can be built using cargo build using the
--target wasm32-unknown-unknown flag.
cargo build -p example-basic --target wasm32-unknown-unknown --releaseGravity can be run against the Wasm file produced in Rust's target/ directory.
cargo run --bin gravity -- --world basic --output examples/basic/basic.go target/wasm32-unknown-unknown/release/example_basic.wasmThe above command will produce a basic.go and basic.wasm file inside the
examples/basic directory. These could be used within a Go project.