Work Done So Far • Why • Install • Contributing • Credits • License
Zorg is a fork of Zig 0.17. I made it because I needed a working AArch64 backend.
Zorg picks up Zig's experimental self-hosted AArch64 backend and takes it to the point where it can compile Zig itself.
- The self-hosted AArch64 backend can compile Zig itself (self-hosting).
- Many bug fixes in the AArch64 backend, each covered by a behavior test.
- Faster compiled binaries: from 32% of LLVM's speed to 51% (see below).
The speed numbers come from running a Zorg-compiled version of Beni against an LLVM-compiled one on the same workload.
Zig's self-hosted backend is built for development. It compiles extremely fast, which keeps iteration times low (great for agentic work! 🤖). The downside is that its output isn't optimized, so the binaries are slow, and slow binaries mean slow tests and slow CI/CD pipelines.
Zorg keeps the fast compile times and makes the output faster by adding several optimizations, such as automatic inlining of small functions, keeping locals in registers instead of on the stack, and inlining small memory copies.
brew install canassa/zorg/zorg # Homebrew
nix profile install github:canassa/zorg # NixOr grab a tarball from Releases. Builds exist for macOS on Apple silicon and Linux on x86_64 and aarch64.
Zorg installs as zorg and keeps its own standard library, cache and ZORG_* environment
variables, so it lives happily next to zig. Existing projects work as they are: zorg build.
Just open a pull request. AI contributions are welcome. Resistance is futile 🤖
One rule: every bug fix comes with a failing test first.
Zorg is a fork of Zig, created by Andrew Kelley and the Zig contributors. All the hard work upstream is theirs.
MIT. See LICENSE.
The original Zig code is Copyright (c) Zig contributors and is distributed under
the MIT License. Third-party code bundled in lib/ keeps its own license; see the
license files in each directory.
Zorg is an independent project. It is not affiliated with, endorsed by, or sponsored by the Zig Software Foundation. The name "Zig" is used here only to describe where this fork comes from.