brew install zig # unix
choco install zig # win
That should be it!
zig version
Building the entire toolchain from source is also very straightforward.
LLVM is the only main dependency so the toolchain should already exist on most systems.
the advantage of using LLVM directly is being able to compile to WASM and C directly
System Prereqs
# confirm
brew install llvm
brew install cmake
brew install zstd
brew install mysql
brew install openssl
Steps to build the compiler which is the only dependency required to build for any platform
git clone [email protected]:ziglang/zig.git
cd zig
mkdir build
cd build
# for windows and linux
cmake ..
# for macos
cmake .. -DZIG_STATIC_LLVM=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm);$(brew --prefix zstd)"
make install
# binary in stage3/bin/zig
cd stage3/bin
zig version # 0.12.0-dev.1856+94c63f31f (latest master)
Official Docs https://github.com/ziglang/zig