Open-Source Wikis

/

Zig

/

By the numbers

ziglang/zig

By the numbers

Data collected on 2026-04-30 from commit 738d2be9d6b6ef3ff3559130c05159ef53336224 of the master branch.

Size

Language Source files
Zig (*.zig) 36,058 (counts every .zig under tracking, including tests, generated tables, libc/libcxx mirrors)
C headers (*.h) 11,492 (mostly bundled libc/libcxx/clang headers)
C sources (*.c) 2,322 (mostly bundled libc/libcxx)
C++ (*.cpp) 209 (LLVM glue, e.g. src/zig_clang_*.cpp, src/zig_llvm.cpp, src/zig_llvm-ar.cpp)

The bulk of *.h, *.c, and *.zig files come from bundled libraries (lib/libc/, lib/libcxx/, lib/libcxxabi/, lib/libunwind/, lib/libtsan/, lib/include/). The hand-written compiler in src/ is comparatively small in file count but very large per file — see "Largest files" below.

xychart-beta horizontal
    title "Tracked source files by language"
    x-axis ["Zig", "C headers", "C sources", "C++"]
    y-axis "Files" 0 --> 40000
    bar [36058, 11492, 2322, 209]

Largest hand-written files

File Approximate size
src/codegen/x86_64/CodeGen.zig 10.4 MB
src/Sema.zig 1.6 MB
lib/std/zig/AstGen.zig 576 KB
src/codegen/llvm.zig 580 KB
src/InternPool.zig 513 KB
src/main.zig 350 KB
src/Compilation.zig 344 KB
lib/libc/freebsd/include/... (the freebsd libc tree) thousands of headers
src/codegen/x86_64/encodings.zon 161 KB
lib/std/zig/Parse.zig 136 KB
lib/std/zig/Zir.zig 210 KB
lib/std/Target.zig 116 KB
lib/std/posix.zig 263 KB
lib/std/c.zig 371 KB
lib/std/Build.zig 101 KB
lib/std/Build/Step.zig 38 KB

Activity

  • Total commits on master: 36,058.
  • Commits in the trailing 365 days from the wiki commit's timestamp: 2,665.
  • Earliest commit on record: 2015-08-05 (Andrew Kelley).
  • Latest commit at the surveyed HEAD: 2025-11-26 17:42 -0800 (Andrew Kelley).
xychart-beta horizontal
    title "Recent monthly commit volume"
    x-axis ["2024-04", "2024-05", "2024-06", "2024-07", "2024-08", "2024-09", "2024-10", "2024-11", "2024-12", "2025-01", "2025-02", "2025-03", "2025-04", "2025-05", "2025-06", "2025-07", "2025-08", "2025-09", "2025-10", "2025-11"]
    y-axis "Commits" 0 --> 700
    bar [258, 249, 212, 639, 650, 251, 435, 262, 302, 368, 388, 249, 246, 235, 199, 480, 401, 399, 564, 267]

The release-month spikes are visible (June/July around 0.13.0, March around 0.14.0, August around 0.15.0).

Bot-attributed commits

Commits whose author or trailers contain explicit bot markers (co-authored-by: ...[bot], dependabot[bot], github-actions[bot], copilot[bot]): 226 out of 36,058, or about 0.6%. This is a lower bound on AI/automation involvement — inline AI tools that do not leave git trailers are not counted.

Releases (tags)

24 tagged releases as of this commit, from 0.4.0 (the oldest tag in the history) to 0.15.2. See lore for the timeline.

Test footprint

  • test/behavior/ — the largest behavior test tree.
  • test/standalone/ — 67 self-contained build.zig projects, each exercising a feature end-to-end.
  • test/cases/ — small input files paired with golden outputs (the compile_errors/, safety/, etc. subtrees).
  • test/link/ — linker-specific integration tests.
  • test/incremental/ — tests for incremental compilation.
  • test/cli/ — CLI behavior tests.
  • test/c_abi/ — C ABI conformance.

The driver in test/tests.zig (~85 KB) glues these together into the zig build test matrix.

Bundled toolchain footprint

The repository ships:

  • glibc sources (lib/libc/glibc/).
  • musl sources (lib/libc/musl/).
  • mingw-w64 sources (lib/libc/mingw/).
  • wasi-libc stubs (lib/libc/wasi/).
  • darwin / freebsd / netbsd libc headers and stubs (lib/libc/{darwin,freebsd,netbsd}/).
  • libc++, libc++abi, libunwind, libtsan sources (lib/libcxx/, lib/libcxxabi/, lib/libunwind/, lib/libtsan/).
  • Clang resource headers (lib/include/).
  • A self-hosted compiler-rt in pure Zig (lib/compiler_rt/).

Together these allow zig cc, zig c++, and zig build-exe -target ... to act as turnkey cross-compilers without external toolchains.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Zig wiki | Factory