r/programming • • Sep 03 '26

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 Sep 03 '26

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 Sep 04 '26

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 Sep 05 '26

yeah i understand all that, it just doesnt feel good

3

u/pm_plz_im_lonely Sep 05 '26

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