Notes on "Zig"

2 notes in total
Jan 18, 2026

Zig’s new juicy main is here. Not quite following Zig’s new features recently, and a quick check yesterday made me find that the juicy main has landed!

Andrew Kelley proposed it directly (see #24510) to enhance the main function by providing useful variables like memory allocators, I/O instance, environment variables, and command line arguments as parameters. It reduces the boilerplate we previously needed to set up these variables.

Now there are three allowed argument signatures for the main function:

  1. pub fn main() !void
  2. pub fn main(init: std.process.Init.Minimal) !void
  3. pub fn main(init: std.process.Init) !void

The definition of std.process.Init is as follows:

pub const Init = struct {
    /// `Init` is a superset of `Minimal`; the latter is included here.
    minimal: Minimal,
    /// Permanent storage for the entire process, cleaned automatically on
    /// exit. Not threadsafe.
    arena: *std.heap.ArenaAllocator,
    /// A default-selected general purpose allocator for temporary heap
    /// allocations. Debug mode will set up leak checking if possible.
    /// Threadsafe.
    gpa: std.mem.Allocator,
    /// An appropriate default Io implementation based on the target
    /// configuration. Debug mode will set up leak checking if possible.
    io: std.Io,
    /// Environment variables, initialized with `gpa`. Not threadsafe.
    environ_map: *std.process.Environ.Map,
    /// Named files that have been provided by the parent process. This is
    /// mainly useful on WASI, but can be used on other systems to mimic the
    /// behavior with respect to stdio.
    preopens: std.process.Preopens,

    /// Alternative to `Init` as the first parameter of the main function.
    pub const Minimal = struct {
        /// Environment variables.
        environ: std.process.Environ,
        /// Command line arguments.
        args: std.process.Args,
    };
};

The changeset is in #30644 and there’s a follow-up issue #30677 for a minimal CLI parsing mechanism.

#tech25 Jan 18, 2026
Dec 22, 2025

Since Zig hasn’t hit 1.0 and is still evolving rapidly, following the master branch is common practice for trying out new features and tracking where the language is heading. Even its release notes say “working on a non-trivial project using Zig may require participating in the development process.”

However, nightly master builds quietly stopped on November 26, 2025, when the Zig team announced the migration from GitHub to Codeberg. I assumed the builds were provided by some automation tied to GitHub.

Today, I found that nightly master builds have resumed! The download index JSON used by version managers like ZVM is now being updated again, though the download page hasn’t caught up yet.

Nevertheless, good news! I’m looking forward to trying out exciting follow-ups on the new async I/O.

Zig download pageZig download page

Update Dec 23, 2025: The download page is now updating again!

#tech6 Dec 22, 2025
Page 1 / 1