Skip to content

Install Zap

Install the latest Zap toolchain with zapup:

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://zaplang.xyz/install.sh | sh

Check the compiler installation:

Terminal window
zapc --version
zapc --print-stdlib-path

The second command is useful when configuring an editor or diagnosing a custom installation.

Use Thor to create, build, and run Zap applications. Install it after zapc:

Terminal window
git clone https://github.com/thezaplang/thor
cd thor
./build.sh
sudo cp build/thor /usr/local/bin/thor
thor --version

Thor invokes the installed zapc; it does not keep a second copy of the Zap standard library. See Thor build tool for project configuration and dependencies.

A source build requires:

  • a C++20 compiler
  • LLVM development libraries
  • CMake 3.20 or newer
  • Git

Clone and build the repository:

Terminal window
git clone https://github.com/thezaplang/zap.git
cd zap
./build.sh

The compiler is written to build/zapc. Build Thor from the repository’s pinned submodule and use it for programs:

Terminal window
git submodule update --init tools/thor
cd tools/thor
PATH="../../build:$PATH" ./build.sh
./build/thor new hello
cd hello
../../build/thor run

For daily use, place both build/zapc and tools/thor/build/thor on your PATH. zapc remains useful for editor configuration and low-level compiler diagnostics; Thor is the normal application workflow.

Run both test suites before changing the compiler:

Terminal window
ctest --test-dir build --output-on-failure
./run_tests.py --zapc ./build/zapc

Continue with Your first program.