Tag: Zig

  • Zig build system cuts help startup from 150ms to 14.3ms

    Zig build system cuts help startup from 150ms to 14.3ms

    The Zig build system has been split into two jobs: a small configuration step and a faster execution step. Andrew Kelley says the change cut zig build --help from 150ms to 14.3ms on the benchmark in Zig’s 2026 devlog, mostly by avoiding repeated work when the build graph has not changed.

    The short version

    • Zig now separates the configurer, which runs build.zig, from the maker, which executes the serialized build graph.
    • The benchmarked zig build --help path dropped from 150ms to 14.3ms, with CPU cycles down from 593M to 24.1M.
    • The Zig build system can reuse a cached binary configuration file when command-line changes do not alter the build graph.
    • Most build APIs remain compatible, but code that inspected b.args needs to move to addPassthruArgs().
    • The practical payoff is less waiting in watch mode, editor integrations, help output, and other small commands that developers run over and over.

    What happened

    Before this rework, a project’s build.zig file and Zig’s build runner implementation were compiled into one large Debug-mode process. The build script created a graph in memory, and the same combined process ran it.

    The new Zig build system splits that path. The configurer compiles and runs the user’s build.zig logic, then writes the resulting build graph as a binary configuration file. The parent zig build process can cache that file for later runs.

    Execution moves to the maker. Zig compiles the maker in Release mode, does that compilation asynchronously, and stores it in a global cache per Zig version. Once the cached config file and maker are ready, the maker executes the graph.

    That is a small architectural change with a very concrete point: editing a tiny build script should not force Zig to rebuild the whole build system machinery every time.

    Why this is worth watching

    The headline number is narrow but useful. Zig’s devlog says zig build --help fell from 150ms to 14.3ms in average wall time, a 90.4% reduction. CPU cycles fell 95.9%, instructions fell 95.6%, and cache references fell 94.3%.

    A help command is not the same thing as a full project build. Still, build tools spend a lot of time on short-lived commands: printing help, checking options, restarting watch mode, serving a web UI, or feeding data to an editor. Those are exactly the places where 100ms delays become noticeable.

    The cached configuration also means some command-line changes no longer force build.zig to run again. The devlog gives -freference-trace as an example: if the build graph does not change, Zig can reuse the previous configuration.

    For more developer tooling coverage, see the IT & AI archive.

    What changes for Zig build system users

    The rework is not meant to break most build scripts. The visible compatibility issue is passthrough arguments. Code that directly observed b.args and forwarded it with run_cmd.addArgs(args) now needs to use run_cmd.addPassthruArgs().

    That does remove one bit of observability from the build script. In return, changing those passthrough arguments no longer has to invalidate and rebuild the configuration step from source. It is the kind of trade that makes sense for a build tool: give up a rarely needed hook to make the common path cheaper.

    Zig 0.17.0 is expected within weeks, according to the devlog. Teams already using development builds should search for b.args patterns before upgrading. Everyone else can treat this as an early warning rather than a fire drill.

    What Hacker News readers are arguing about

    The Hacker News thread is less about the specific 150ms benchmark and more about whether Zig is becoming practical enough to use before 1.0.

    One camp is clearly encouraged. Several commenters said recent Zig releases have been disruptive but worth it, especially around I/O design and the feeling that Zig works well as a small tooling language. The recurring praise is not that Zig is magically faster everywhere. It is that the language feels good for low-level experiments without forcing as much ceremony as C++ or Rust.

    The skeptical side is also useful. Some readers pushed back on claims that the new I/O system is already highly efficient, pointing to dynamic dispatch, vtable indirection, and unresolved questions around async behavior. Others said they like Zig but are tired of release-to-release API churn and may wait for 1.0 before using it in serious projects.

    The build system change fits that split. It is a strong piece of engineering, but it lands in a language that is still moving quickly. If your project values stable tooling above all else, the number to watch is not 14.3ms. It is how much your build script changes between Zig releases.

    The practical read

    The Zig build system rework is worth watching because it attacks a boring part of developer experience that compounds all day. Fast compilers help, but fast tool startup matters too. If a build tool is called by editors, shells, watch processes, and documentation commands, every avoidable rebuild is a tax.

    For Zig users, the immediate task is simple: test development builds if you can, check for b.args, and read the 0.17.0 release notes when they land. For people building other developer tools, the design lesson is broader. Separate user configuration from execution, cache the serialized result, and make the hot path cheap enough that users stop noticing it.

    Sources

  • Zig interview: Andrew Kelley on the long road to 1.0

    Zig interview: Andrew Kelley on the long road to 1.0

    The Zig interview with Andrew Kelley is useful because it treats a programming language as more than syntax. Kelley talks through why Zig is still pre-1.0, why the project bans AI-generated issues and pull requests, and why build tooling may matter as much as language design for systems programmers.

    The short version

    • Kelley frames Zig as a systems language for programmers who still want direct control over memory, allocators, and hardware costs.
    • The project is taking its time before 1.0 because Kelley sees that label as a backward-compatibility promise, not a marketing milestone.
    • Zig’s no-AI contribution policy is mostly about maintainer time. If a contributor cannot explain the patch, review becomes unpaid cleanup.
    • The move from GitHub to Codeberg came down to working project infrastructure, especially CI reliability.
    • For more developer-tool coverage, see the IT & AI archive.

    What happened in the Zig interview

    JetBrains published a long video interview with Andrew Kelley, the creator of Zig. The conversation covers the language’s origin, its relationship to C, C++, Rust, and Go, the Zig Software Foundation, the move from GitHub to Codeberg, and the project’s policy against AI-generated issues and pull requests.

    The most concrete thread is the build story. Kelley argues that a good project should not require every new contributor to install a different stack of platform tools or recreate a Docker setup before the first compile. Zig’s pitch is that zig build should make cross-compilation and dependency handling feel boring, even when the target operating system or architecture is different from the developer’s machine.

    The interview also gives a clearer reason for the slow march toward Zig 1.0. Kelley treats 1.0 as a compatibility contract. Once the project makes that promise, bad language and standard-library decisions become much harder to undo.

    Why this is worth watching

    The Zig interview lands at an awkward moment for systems programming. C is still everywhere because it is stable, portable, and close to the machine. Rust has pushed safety and ownership into the mainstream, but it asks developers to buy into a stronger type system and a more opinionated model of correctness. Zig is trying to live in the middle: less hand-holding than Rust, more explicit guardrails and tooling than C.

    That bet only works if the toolchain feels excellent. A language can be elegant and still lose developers at the first broken build. This is why the build system, cross-compilation, and package story matter so much. Zig is competing on the whole workflow, not only on what individual functions look like.

    The governance piece is just as interesting. Kelley describes the Zig Software Foundation as a 501(c)(3) nonprofit with roughly $670,000 in 2024 income. That structure does not make the project immune to money pressure, but it changes the incentives. There is no obvious acquisition path to serve, and no single corporate owner gets to decide the language’s direction by default.

    What Hacker News readers are arguing about

    The Hacker News thread is small, but the split is clear. Supporters like the patience. They read Kelley’s approach as a rare case of a language project trying to get the foundation right before locking compatibility for years.

    The sharper objection is about time. One commenter argues that Zig has already spent about a decade changing the design and still has no obvious path to the stability that made C so durable. That is a fair worry. If a language wants to become a C alternative, stability is not a nice extra. It is part of the product.

    Other replies push back by saying Zig needs to break things now if it wants to barely change later. That is the strongest defense of the project, and also the biggest risk. The strategy only looks wise if Zig reaches a stable version with enough momentum left for serious adoption.

    The AI angle gets less debate in the thread than the title might suggest. The practical point is still clear: small open-source teams are not only reviewing code. They are reviewing the contributor’s understanding. AI-generated patches can make that job slower when the author cannot defend the change.

    The practical read

    For developers choosing tools today, Zig is worth testing where build friction hurts: command-line tools, cross-platform libraries, embedded targets, WebAssembly, or C interop. The language is not a safe default for every production team yet, especially if long-term API stability matters more than toolchain experiments.

    For maintainers, the no-AI rule is the more portable lesson. A blanket ban may be too strict for many projects, but the underlying standard is reasonable: contributors should understand what they submit. If review turns into explaining machine-written code back to its own author, the project is paying for someone else’s shortcut.

    For app and developer-tool builders, Zig is also a reminder that discovery is not only about the language homepage. Build commands, package defaults, editor support, CI behavior, and repository hosting all shape whether a tool gets adopted. That is the part of the Zig interview I would watch most closely.

    Sources