Setup development environment for Zig
To write Golem components in Zig, a couple of common WebAssembly tools need to be installed, as well as the latest Zig compiler.
Install WebAssembly tooling
First of all, to install wasm-tools via cargo, you need to install the latest stable version of Rust. The recommended way to do so is using https://rustup.rs (opens in a new tab):
Install Rust
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shInstall the latest stable version of Rust
rustup install stable && rustup default stableAdd the WASI target
rustup target add wasm32-wasip1Install wasm-tools
cargo install --force --locked wasm-tools@1.223.0Confirm the installation:
wasm-tools --version
wasm-tools 1.223.0Install wit-bindgen
cargo install --force --locked wit-bindgen-cli@0.37.0Confirm the installation:
wit-bindgen --version
wit-bindgen-cli 0.37.0⚠️
Golem requires a specific version of wasm-tools, and wit-bindgen. Please make sure the
correct version is installed with the commands described above.
Install Zig
Install the latest Zig compiler using the official instructions (opens in a new tab). The documentation and examples were created using Zig 0.13.