Skip to content

Zero FrameworkBuild microservices
in Zig
One binary, no GC, config-driven, batteries included

zero frameworkzero framework

Hello Json in ~15 lines

zig
const std = @import("std");
const zero = @import("zero");
const utils = zero.utils;

pub const std_options: std.Options = .{ .logFn = zero.logger.custom };

pub fn main(init: std.process.Init) !void {
    var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
    defer arena.deinit();

    const app = try zero.App.new(arena.allocator(), init.io, init.environ_map);
    try app.get("/json", jsonResponse);
    try app.run();
}

fn jsonResponse(ctx: *zero.Context) !void {
    try ctx.json(.{ .msg = "hello zero!" });
}

Drop that in src/main.zig, add a configs/.env, and zig build run serves a JSON endpoint with structured logs and /metrics already live.

The full walkthrough is in Hello world.

Fast, and small

A single binary serves tens of thousands of requests/sec while holding ~50 MiB RSS

No GC pauses, no JIT warm-up.

See the numbers and how to reproduce them in Benchmark.

Why zero?

If you want Go's ergonomics without its runtime, or Node's speed without its footprint, zero gives you a strongly-opinionated

Zig framework: explicit memory, a single binary, and microservice building blocks you'd otherwise wire together by hand.

Start with Getting Started or browse the Examples.