Zig
lastmod 2026-05-13created 2022-05-267 edits
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Categories
- zero-native - Build desktop + mobile apps with Zig and a web UI
How Uber uses Zig
Uber compiles C/C++ code with zig cc (bazel-zig-cc)
-
- Currently only in the Go Monorepo. Plans to expand to other languages that use the C/C++ toolchain
- Because it allows choosing the glibc version and cross-compiling for macOS
- However, no plans to use the Zig language itself. That is, only Zig's C toolchain is used
- Uber donates to the Zig Software Foundation (ZSF) and signed a bug-fix priority contract ($52800)
- Strengths of zig cc
- A fully hermetic C/C++ compiler only 40MB in size. Just 1/10 of standard CLang
- Can link against the glibc version given as a command-line argument
- Host and Target are decoupled. Configuration for linux-aarch64 and darwin-x86_64 is identical regardless of host
- Linking with musl is just like choosing another libc version -target x86_64-linux-musl