Welcome to the new Golem Cloud Docs! 👋
Documentation
Experimental Languages
Zig
Setup

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 | sh

Install the latest stable version of Rust

rustup install stable && rustup default stable

Add the WASI target

rustup target add wasm32-wasi

Install wasm-tools

cargo install --force --locked  wasm-tools@1.210.0

Confirm the installation:

wasm-tools --version
wasm-tools 1.210.0

Install wit-bindgen

cargo install --force --locked wit-bindgen-cli@0.26.0

Confirm the installation:

wit-bindgen --version
wit-bindgen-cli 0.26.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.