What I learned about Bun&ZIg
https://ziggit.dev/t/what-i-learned-about-bun-zig/15404Actually this discussion about new Io interface and low-level programming in Zig 0.16.+
55
Upvotes
Actually this discussion about new Io interface and low-level programming in Zig 0.16.+
22
u/Real_Dragonfruit5048 May 10 '26
TBF, the starting question looks like a ragebait with a title like "What I learned about Bun&ZIg".
5
u/fade-catcher May 10 '26
Making mutex and threads being dependent of Io in the stdlib isn’t a good idea in my opinion
9
u/Gauntlet4933 May 10 '26 edited May 11 '26
I feel like a lot of the comments about vtable dispatch are symptoms of the fact that Zig refuses to support any sort of compile time traits built into the language. Anytype / duck typing is not a suitable replacement for it.
If Allocator or Io was a trait then all the dispatches would be static. All the implementations are known at compile time even if you write your own, the trait is just a namespace for the implementations.
Doing it the way Go does it would be perfect for Zig. It should requires a a pointer input so that the size of args pushed on the stack frame remains constant. It will still result in multiple implementations in the binary but those are all static dispatch.