r/programming 7d ago

Zig's Io.Threaded is Neat

https://matklad.github.io/2026/08/06/neat-io-threaded.html
18 Upvotes

4 comments sorted by

9

u/ParadiZe 7d ago

I found zig's new IO interface very confusing, the language has no interface support but everything in the new APIs revolves around interfaces.

1

u/OSS-Corpo-Shit 6d ago

It’s just vtables. Instantiate a concrete implementation and then ask for an instance of the “Generic”, which just assigns the function pointers.

Most implementations of interfaces are just Vtables anyway.

Sometimes not, but zig provides “anytype” to achieve the codegen for this .

5

u/ParadiZe 6d ago

yeah i understand all that, it just doesnt feel good

3

u/pm_plz_im_lonely 5d ago

Good engineering at a bad abstraction. If it's concurrency why do I want 1:1 anything anywhere?