← blog

On learning Zig from Python

2026-03-10 8 min read
zigsystems

Coming from Python, Zig feels like moving into a house where every wall is load-bearing. You can't just knock things down to see what happens.

The first thing that strikes you is manual memory management. Not in the C way — Zig gives you allocators, which are explicit but surprisingly ergonomic. You always know who owns what.

Comptime is the real mind-bender. Imagine if Python's decorators could rewrite the function at compile time, not just wrap it. Generic programming without generics. It's elegant once it clicks.

Error handling via error unions felt strange at first. No exceptions, no try/catch. Just a pipe of "this worked or here's why it didn't." After a week, I stopped missing exceptions entirely.

The build system is the language itself. No makefiles, no cmake, no cargo.toml. Your build script is Zig code. This sounds like it would be chaotic, but it's the opposite — total transparency.

Would I rewrite my Python projects in Zig? No. Would I reach for Zig when I need something fast and correct? Absolutely. They solve different problems, and knowing both makes me better at each.