Zig Standard Library, the I/O Interface, and Concurrency: Tying It All Together

12 min read
This article is based on Zig 0.16. After five installments covering syntax, error handling, memory management, compile-time computation, and the build system — we’ve arrived at the finale. Time to tie it all together. Version 0.16 is a convergence point of two major changes: the Unmanaged migration of standard library containers, and the introduction of the revolutionary std.Io interface. These transformations deeply affect how Zig code is written. This article explores both, closes with three-language comparison cases, and provides a learning roadmap and resources.
Zig Standard Library Std.Io Concurrency Unmanaged Learning Notes
Continue reading →

eBPF Language Battle: Full-Stack Comparison of C, Rust, and Zig

6 min read
The previous articles on OOM tracing all used C for eBPF kernel-space programs. This is natural — C is eBPF’s “native language,” with the verifier, CO-RE, and libbpf toolchain all designed around C. But if you’ve followed the eBPF ecosystem, you’ll notice a clear trend: more and more people are writing eBPF in languages other than C. Rust’s Aya framework is already used in production by the Solana validator and Kubernetes Gateway API; meanwhile, Zig is trying to bring a new development experience with comptime, explicit allocation, and first-class C interop.
EBPF Zig Rust Aya Libbpf CO-RE BPF
Continue reading →

Structs and comptime: The Power of Compile-Time Computation

4 min read
This article is based on Zig 0.16. In the previous post, we covered Zig’s error handling and memory management — lightweight try/catch fault tolerance, and the explicit allocator-passing philosophy. Now we enter Zig’s most essential territory: structs and methods, and the soul of Zig — compile-time computation (comptime). If you come from Go, you’ll appreciate how Zig keeps things simple by defining methods directly inside the struct. If you come from Rust, you’ll see a different take on the impl block pattern. And comptime opens a path to “types as values” metaprogramming beyond Go generics and Rust traits.
Zig Comptime Structs Generics Metaprogramming
Continue reading →

Zig Memory Management: The Explicit Allocator Pattern

7 min read
This article is based on Zig 0.16. In the previous articles we covered Zig’s basic syntax and error handling. Now we arrive at the most distinctive part of Zig—memory management. If you come from Go or Rust, Zig’s memory philosophy will feel unfamiliar: it provides neither garbage collection nor an ownership system. Instead, it chooses a fundamentally different path—the Allocator Pattern. The core convention is remarkably simple, yet far-reaching: Any function that might allocate memory must accept a std.mem.Allocator parameter.
Zig Memory Management Allocator Go Rust Study Notes
Continue reading →

Error Handling: A Third Way Beyond Go and Rust

8 min read
This article is based on Zig 0.16. Three Error Handling Paradigms Error handling is one of the most debated topics in programming language design. Go’s multiple return values, Rust’s Result<T, E> enum, and Zig’s error union type represent three fundamentally different philosophies. This article assumes you have Go or Rust experience and uses that as a reference frame to understand Zig’s design. Go: Multi-return + if err != nil Go’s philosophy is “explicit over implicit” — functions can return multiple values, and the convention is that the last return value is error. Every call site must handle it:
Zig Error Handling Go Rust
Continue reading →

Basic Syntax: Ramp Up on Zig with Your Go/Rust Experience

9 min read
This article is based on Zig 0.16. In Part 1 we discussed why Zig is worth learning and how to run your first Hello World. Now it’s time to dive into the syntax—variables, types, control flow, functions, and generics. The single goal is to make you able to read and write Zig code. If you have Go or Rust experience, none of these concepts will feel entirely new. I’ll draw comparisons at key points to help you map your existing knowledge.
Zig Basic Syntax Go Rust
Continue reading →

Why Zig: A New Systems Language from a Go/Rust Perspective

7 min read
This article is based on Zig 0.16 (released 2026-04-13, the latest stable release). Zig is a rapidly evolving modern systems programming language. Its source repository has moved from GitHub to Codeberg, and the official download page is at ziglang.org/download/. Why Zig? If you already know Go and Rust, you might ask: why look at a third systems language? The answer is simple: Zig fills the gap between Go and Rust. Go conquered backend and cloud-native development with its low barrier to entry and high productivity. But its garbage collector (GC) and relatively large runtime become liabilities in low-level systems programming, embedded systems, and real-time scenarios. Rust delivers peak performance and safety through zero-cost abstractions and its ownership system, but its steep learning curve and slow compile times make it feel “heavy” for fast prototyping and small tools.
Zig Systems Programming Go Rust Learning Notes
Continue reading →

The Evolution of AI Engineering Paradigms: Four Shifts from Prompt Engineering to Loop Engineering

6 min read
Why Understanding These Four Stages Matters The development of AI engineering is happening at a breathtaking pace. If you only master Prompt Engineering, you’re already behind by an entire era. From 2022 to now, in just four short years, AI engineering has undergone four profound paradigm shifts, each one transcending and including the previous one. Imagine learning programming: if you only learn print statements but don’t know about functions, classes, and frameworks, can you really write meaningful programs? The same applies to AI engineering. These four stages form a complete capability ladder—skip any step, and you’ll struggle in practical applications.
AI Engineering Paradigm Evolution LLM Learning Path
Continue reading →

MiBeeNvr v0.7.0: Timelapse v2 + Dual-Lens Xiaomi + H.265 Muxing + Release Hardening

16 min read
After v0.6.0 put the timelapse pipeline in place, community feedback quickly pointed out several hard problems: the JPEG sequence consumed too much storage, H.265 cameras couldn’t generate playable timelapse segments, dual-lens Xiaomi devices could only capture the main lens, and H.265 HLS would occasionally panic outright. None of these are edge cases — the dual-lens CW500 and Outdoor Cam 4 ship in large volumes in China, and H.265 is the de facto standard for mid-to-high-end cameras. The v0.7.0 mainline was built around exactly this feedback.
NVR Go Timelapse Xiaomi Dual-Lens H.265 Muxing Release Hardening Open Source
Continue reading →

Zhi Theme v0.2.0: Language Switcher + Post Series + Mermaid Upgrade

3 min read
Zhi theme v0.2.0 is out — the most significant feature update since the initial release back in April. This release addresses real needs accumulated from personal usage and iterative development. In a nutshell: Language switcher: Globe icon button with CSS dropdown, auto-linking translated pages Post Series: Series overview page (card layout) + detail page (stepper/timeline layout) with sort toggle Mermaid v11+: Async render API with reliable dark mode adaptation Plus a slew of bug fixes and comprehensive documentation updates Let’s walk through each feature.
Hugo Theme Development Zhi Multilingual Mermaid
Continue reading →