Skip to content

Zig in the Real World

Zig isn’t 1.0 yet, and the language still changes between releases. So it’s fair to ask: does anyone actually ship software with it? Yes. This page looks at some well-known projects, what each one uses Zig for, and why, in their own words where they’ve written it down. Every claim links to the project’s own site, docs or repository, and we’ve left out numbers we couldn’t check. One story here doesn’t end with “and they’re still using Zig”, and we think it’s worth telling too.

Ghostty is a terminal emulator that aims to be fast, full of features, and native on each platform. Its README says there’s “a large, shared core written in Zig”, with platform-native parts around it: the macOS app is a SwiftUI application, and the Linux app uses GTK. The About page adds that the Linux GUI itself is written in Zig and uses the GTK4 C API.

What that tells you about Zig:

  • Calling C directly is a big deal here. GTK is a C library, and Zig calls it without a separate bindings layer, as in Zig Calling C.
  • Being a library for other languages works too: the shared core, libghostty, is offered as a “C and Zig library” that other programs can embed, which is the Zig Exporting to C story at full size.

TigerBeetle: a financial transactions database

Section titled “TigerBeetle: a financial transactions database”

TigerBeetle is a database built for one job: recording money moving between accounts, safely and quickly. Its architecture document explains why they chose Zig, and it’s one of the most thoughtful pieces written about the language. A few points from it:

  • TigerBeetle allocates all its memory at start-up and never again. Their coding guide, TIGER_STYLE.md, puts it bluntly: “All memory must be statically allocated at startup.” That rules out languages that allocate behind your back, and “of the languages that remain, Zig makes the most sense, although Rust is a close contender.”
  • They like that idiomatic Zig collections take the allocator per call, not in a constructor, which “is a perfect fit” for their memory strategy. That’s the “pass the allocator” habit from Zig Design Patterns.
  • They value Zig’s control over layout, alignment and padding, its working cross-compilation, and that it does all this “using very frugal language machinery”.

The document is also honest about the trade-off: Rust has stronger temporal and thread safety, and they explain why those matter less in their design (static allocation, single-threaded execution) and why they lean on heavy testing instead.

Bun: a JavaScript runtime that started in Zig

Section titled “Bun: a JavaScript runtime that started in Zig”

For years, Bun, the JavaScript runtime, bundler and package manager, was the best-known Zig project. That changed in 2026, and the details are worth knowing.

In his post Rewriting Bun in Rust (July 2026), Bun’s creator Jarred Sumner explains that Bun started as a port of esbuild’s transpiler from Go to Zig, and that he wrote its first version alone, in about a year. His verdict on that part: “Zig made Bun possible.” The same post explains why they moved anyway. Bun mixes JavaScript’s garbage-collected memory with manually managed memory, and keeping those lifetimes straight was the main source of their crashes and leaks. He’s careful about where he puts the blame: “I don’t blame Zig for that - other users of Zig don’t have the bugs we had”, and he notes that this mix is uncommon enough that no language really designs for it.

Bun’s own repository confirms the switch: a June 2026 pull request updated the README to say Bun is written in Rust, after the Zig sources had been removed.

What to take from this, as a Zig learner:

  • Zig carried a very large, very ambitious project from one person’s first version to, as the post says, over 22 million monthly downloads. That part of the story is a success.
  • Manual memory management is a real cost, and it grows with how tangled your lifetimes are. Zig gives you tools (defer, errdefer, allocators that report leaks), but it doesn’t check lifetimes for you. Zig Lifetimes & Ownership is about exactly this.
  • Picking a language is a trade-off for a particular project, not a contest. Other projects on this page made the opposite call for their own reasons.

Lightpanda is a web browser with no screen at all, made for automation and AI agents: programs that load pages, run their JavaScript and read the result. Its README describes it as “Not a Chromium fork. Not a WebKit patch. A new browser, written in Zig”, and lists “written in Zig, a low-level language with explicit memory control” as part of why they built it from scratch for speed. It works with existing automation tools like Puppeteer through the Chrome DevTools Protocol. The same README says it’s built with Zig 0.17.0.

Roc is a young functional programming language. Its compiler is being built in Zig: the repository’s build instructions start with “Download Zig 0.17.1” and build the compiler with zig build roc. The project’s FAQ explains the reasoning in one line: compiler performance depends heavily on how memory is used, and a systems language like Zig gives more direct control over memory than Roc itself ever should. The README is upfront that Roc isn’t ready for a 0.1 release yet.

  • The Zig compiler itself is written in Zig, along with its standard library. The source on Codeberg is the biggest Zig codebase you can read, and you’ve been reading parts of it in these lessons.
  • ZLS, the Zig Language Server that gives editors completion and go-to-definition, is written in Zig (see Zig Tools & Setup).
  • River is a Wayland compositor for Linux desktops. Its README lists Zig 0.17.1 as a build requirement.
  • Mach is a game engine and graphics toolkit for Zig, mentioned in Zig Game Development.

Read their docs side by side and a few themes keep coming up:

  • Control over memory. TigerBeetle allocates once, Lightpanda and Roc mention memory control directly. Explicit allocators are the feature people choose Zig for, and, as Bun shows, also the thing you must take responsibility for.
  • C is a neighbour, not a foreign country. Ghostty calls GTK’s C API and exports a C library; Bun called into JavaScriptCore for years. Zig’s C interop removes a whole layer of glue.
  • They pin a Zig version. Lightpanda says 0.17.0; Roc and River say 0.17.1. Pre-1.0 Zig breaks code between releases, so serious projects pick one version, write it down (in docs and in minimum_zig_version in build.zig.zon), and upgrade on purpose. Do the same in your own projects. Zig Upgrading covers how.

Try TigerBeetle’s rule on a tiny scale. Give a std.heap.FixedBufferAllocator a buffer big enough for exactly four Account structs, allocate them, move 10 from account 1 to account 2, and then show that asking for a fifth account fails.

Hint: the buffer is var memory: [max_accounts * @sizeOf(Account)]u8 align(@alignOf(Account)) = undefined;. The align makes sure the bytes can hold Account values.

Show solution
const std = @import("std");
const max_accounts = 4;
const Account = struct {
id: u64,
balance: i64,
};
pub fn main() !void {
// All the memory this program will ever use, decided up front.
var memory: [max_accounts * @sizeOf(Account)]u8 align(@alignOf(Account)) = undefined;
var fba: std.heap.FixedBufferAllocator = .init(&memory);
const accounts = try fba.allocator().alloc(Account, max_accounts);
for (accounts, 1..) |*a, id| a.* = .{ .id = id, .balance = 0 };
accounts[0].balance -= 10;
accounts[1].balance += 10;
for (accounts) |a| std.debug.print("account {d}: {d}\n", .{ a.id, a.balance });
// After start-up, there is simply no more memory to hand out.
if (fba.allocator().create(Account)) |_| {
std.debug.print("got more memory?\n", .{});
} else |err| {
std.debug.print("one more account: {t}\n", .{err});
}
}

Output:

account 1: -10
account 2: 10
account 3: 0
account 4: 0
one more account: OutOfMemory

Nothing here touches the heap: the whole “database” lives in one stack array, and its size is known at compile time. The program can never use more memory than that, which is exactly the property TigerBeetle wants. Zig Choosing an Allocator covers FixedBufferAllocator in more detail.

Pick one project from this page and find out which Zig version it builds with. Then check the minimum_zig_version in your own project’s build.zig.zon.

Hint: look in the README or the build instructions first. In a Zig project, build.zig.zon often has a .minimum_zig_version line too.

Show solution

What we found in November 2026:

  • Lightpanda: its README says it’s written with Zig 0.17.0.
  • Roc: BUILDING_FROM_SOURCE.md says to download Zig 0.17.1, and its build.zig.zon has .minimum_zig_version = "0.17.1".
  • River: its README lists Zig 0.17.1 under requirements.

A project made with zig init on Zig 0.17.1 gets .minimum_zig_version = "0.17.1" automatically. These numbers will move as new Zig versions come out, which is the whole point: check, don’t assume.

  • Zig is pre-1.0 but in production: Ghostty, TigerBeetle, Lightpanda, Roc’s compiler, River, ZLS and the Zig compiler itself are written in it.
  • Ghostty shows Zig’s C interop both ways: calling GTK’s C API, and offering libghostty as a C library.
  • TigerBeetle chose Zig for static allocation, per-call allocators and control over memory layout, and documents the trade-off against Rust.
  • Bun grew up in Zig and moved to Rust in 2026, mainly because mixing garbage-collected and manual memory caused crashes and leaks. Its creator still credits Zig with making Bun possible.
  • Real projects pin a Zig version and upgrade deliberately. Do the same.

Next up: Project: Guessing Game, your first complete program, putting input, random numbers and loops together.

Quick check

1. What memory rule does TigerBeetle follow, according to its own docs?
2. What happened with Bun and Zig in 2026?
3. How does Ghostty use Zig on Linux?
4. Why do projects like Roc and River write down an exact Zig version?