Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

94,861 Commits

Repository files navigation

Sig

Sig

The Zig compiler that knows how much memory it has.

ReleaseUpstreamSync StatusRelease Status

sig is a drop-in replacement for zig. All your code works. Then you rename a file to .sig and the compiler starts caring about where your bytes come from.


0.3.2 — First-Class SB0 Target

Patch release adding the consolidated native aarch64-sb0 target.

$ sig version
sig 0.3.2 (zig 0.17.0-dev)

-target aarch64-sb0 now selects the SB0 OS and ABI directly, emits native raw bytes, reserves x18 automatically, and has no libc or dynamic-linker fallback. SB0K and SB0X remain artifact kinds under this one target rather than separate compiler destinations.

The packaged zig alias preserves the upstream machine-readable version-only output, while sig version identifies both the Sig and Zig versions.

PlatformBackendDownload
x86_64-linuxFull LLVM 22.1.8tar.xz
aarch64-linuxFull LLVM 22.1.8tar.xz
aarch64-macosFull LLVM 22.1.8tar.xz
x86_64-windowsFull LLVM 22.1.8zip
aarch64-sb0Native allocator-free SB0K runnersb0k

Every package contains the same full LLVM target set and the same Sig standard library. Linux and macOS execute on their build hosts, Windows executes on a Windows runner, and aarch64 Linux executes under QEMU user-mode before the release can be published.

The SB0K release asset boots as the compiler service itself: it accepts one bounded SB0C request, compiles through the SB0-only fixed-capacity pipeline, and returns an SB0X image. Its request encoder and response extractor are also strict .sig programs using fixed storage and raw syscalls—Python is not part of the runner or its release gate. See compiler/SB0_NATIVE_RUNNER.md for the wire contract and reproducible QEMU invocation.

The final release is produced by Sig itself. CMake and upstream Zig are absent from the release stage. The checked-in zig1.wasm chain is used only to create the native bootstrap set; those bootstraps then compile the four final Sig executables with immutable LLVM closures.


What makes it strict

The .sig extension activates strict mode. Same syntax. Same parser. Same compiler. But allocator usage becomes a compile error.

// foo.zig — business as usualvarlist=std.ArrayList(u8).init(allocator);
trylist.appendSlice(data);
// foo.sig — you bring the buffer, you know the costvarbuf: [4096]u8=undefined;
constresult=trysig.fmt.formatInto(&buf, "{s}: {d}", .{ name, count });

Four errors replace silent reallocation:

ErrorWhen
BufferTooSmallOutput exceeds the caller-provided buffer
CapacityExceededBounded container is full
DepthExceededRecursion hit its limit
QuotaExceededResource cap reached

Standard Zig error unions. try, catch, orelse. Nothing new to learn.


The Spoon

Sig is not a fork. It stays synchronized with upstream Zig within minutes of every commit.

When a new commit lands in ziglang/zig, it fires a GitHub dispatch. The sig-sync workflow cherry-picks the commit, resolves conflicts (keeping sig-owned files), validates the bootstrap, and pushes. If the standard library changed in a way that breaks the bootstrap, it triggers a rebuild chain automatically.

The result: sig never drifts. You get upstream bug fixes, optimizations, and new features without waiting.

Latest upstream commit613c0332
Last sync2026-08-13
Upstreamcodeberg.org/ziglang/zig
Base versionzig 0.17.0-dev · LLVM 22.1.8
Sync frequencyEvery commit (< 1 min latency)

Getting started

# Download the latest release
mkdir -p sig-toolchain
curl -sL https://github.com/SB0LTD/sig/releases/latest/download/sig-x86_64-linux.tar.xz \
| tar -xJ -C sig-toolchain --strip-components=1
export PATH="$PWD/sig-toolchain/bin:$PATH"# Or build from source (requires an existing Sig compiler)
git clone https://github.com/SB0LTD/sig.git &&cd sig
sig build -OReleaseFast

The executable and lib/ directory are a matched toolchain unit. Normally Sig finds the adjacent library automatically. If ZIG_LIB_DIR is set globally, unset it or point it at the extracted sig-toolchain/lib; mixing compiler and library versions can make the build runner fail before your build begins.

It's a drop-in replacement. Every .zig file compiles unchanged. Rename to .sig when you're ready to go strict.

How it's built

build-llvm → build-bootstrap → release
7 immutable LLVM closures 4 verified host bootstraps 4 LLVM-backed toolchains

Each stage publishes an exact manifest, SHA-256 set, source commit, producer, and workflow run. Drafts become visible only after every required artifact and target-specific execution probe succeeds. Bootstrap and final compilers also run the canonical 210-test native compiler graph with an explicit fixed stack budget, then cross-compile and validate an AArch64 object.

License

Same as upstream Zig — MIT. See LICENSE.

Releases

Contributors

Languages