Installing from Source
Requirements
Section titled “Requirements”Before building Zap, install:
clang21.1.8llvm21.1.8doxygencmake20+
Clone and build
Section titled “Clone and build”Clone the repository, enter the project directory, make the build script executable, and run it:
git clone https://github.com/thezaplang/zap.gitcd zapchmod +x build.sh./build.shCompiler location
Section titled “Compiler location”After a successful build, the compiler will be available at:
build/zapcYou can verify it with:
./build/zapc --version./build/zapc --helpAdd zapc to PATH
Section titled “Add zapc to PATH”Add this line to ~/.zshrc:
export PATH="$PATH:/absolute/path/to/zap/build"Then reload your shell:
source ~/.zshrcAdd this line to ~/.bashrc:
export PATH="$PATH:/absolute/path/to/zap/build"Then reload your shell:
source ~/.bashrcAdd the path with:
fish_add_path /absolute/path/to/zap/buildOr make it universal:
set -Ux fish_user_paths /absolute/path/to/zap/build $fish_user_pathsExample
Section titled “Example”If the repository is in ~/dev/zap, then the compiler path is:
~/dev/zap/build/zapcand the directory you add to PATH is:
~/dev/zap/build