Skip to content

Comment on Zig’s Io.Threaded is neatparent

Comments

Nobody's writing Zig because they think they can beat the Rust compiler.

Comparisons to Rust usually stop at memory safety and overlook what no-hidden-control-flow buys you when it's applied consistently across the whole language.

The same mechanism that lets you control allocation (passing an allocator) extends to I/O. For instance, writing Zig, I know exactly when I'm handing control to the kernel and when I'm not. In the vast majority of languages, it's something you'd observe at runtime, whereas in Zig, it's simply the source code you compiled.

So the point of writing Zig over any other language isn't beating the compiler, it's understanding and controlling what your program does at any given moment.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.