Zag is a fork of Zig 0.15.2 focused on a different concurrency model.
The short version: Zag is exploring zero-infection structured concurrency.
That means concurrency should live at the call site, not in function
signatures. We do not want async fn coloring, and we do not want an Io
parameter threaded through every layer of a program just because some leaf
needs to block.
The current design direction is tracked in issue #1: ZEP-0002 Structured Async.
Zag exists to test a language and runtime thesis:
The motivating argument is laid out in the early design issues:
The design position is straightforward:
Zag is currently a forked compiler/toolchain based on Zig 0.15.2.
The repo is in a transition state:
So this is not a finished language release. It is an active fork being shaped around a specific concurrency agenda.
Two user-visible changes are already in the tree:
.zag source files are accepted alongside .zig.zagThat means the compiler currently accepts both:
.zig.zagThe goal of .zag support right now is transitional compatibility while the
language and runtime direction are being worked out.
The current proposal in issue #1 is centered on:
In other words, Zag is trying to preserve Zig-style direct code while gaining modern structured concurrency semantics.
What works today:
.zag root files compileWhat is still incomplete:
#4The main tracked backend blocker right now is:
Zag currently builds from source. There is not yet a polished binary release channel specific to Zag.
The current tree identifies itself against Zig 0.15.2 in build.zig.
A typical development build is:
zig build -Dno-lib -Dno-langref
If you want the LLVM-enabled path on macOS with Homebrew LLVM/LLD, the tree now supports an explicit Polly flag:
zig build \
-Denable-llvm=true \
-Dllvm-has-polly=true \
--search-prefix /opt/homebrew/opt/llvm@20 \
--search-prefix /opt/homebrew/opt/lld@20
That -Dllvm-has-polly=true option exists because Homebrew’s LLVM packaging on
macOS needs extra help when linking the system LLVM stack.
.zagThe compiler currently treats .zag as Zag source code and routes it through
the same source pipeline as .zig.
Examples:
zig build-exe hello.zag
zig test math.zag
zig fmt src/
The formatter, import handling, and file classification have already been wired
so .zag and .zig can coexist during the transition.
This repository is still mostly upstream Zig compiler source plus targeted Zag changes.
That is intentional for now. The goal is to keep rebasing possible while the fork proves out the runtime and language direction.
You should read the repo as:
If you want to work on Zag, the most important thing is to understand the design intent before changing compiler code.
Start here:
Contributions are most useful when they align with that agenda rather than pushing Zag back toward upstream Zig’s concurrency model.
Zag is not trying to be “Zig with a different file extension”.
Zag is a fork of Zig pursuing a different answer to async and concurrency:
plain functions, structured scopes, fiber-based scheduling, and a toolchain that
accepts .zag while that model is being built out.