News for hackers. Stuff that matters.
Re:Zig 0.16.0 Release Notes by slopinthebag on Tuesday April 14, 2026 @03:06PM (#47769937)
Have they said how many breaking changes requiring a rewrite Zig will be going through before it stabilises?

Also I thought Zig doesn't have interfaces....how does the IO one work?

Re:Zig 0.16.0 Release Notes by badtuple on Tuesday April 14, 2026 @04:04PM (#47770727)
Interfaces can still be expressed using vtables. You just have to write the vtable yourself rather than have the language do it for you.

Also, Zig's tagged unions (enums with payloads in Rust) are really ergonomic and often what you want instead of interfaces. Alot of languages that use interfaces simply don't expose a good way of doing it so everyone reaches for interfaces by default. But if you don't need an actual interface then this way you don't even have to pay the cost of runtime dynamic dispatch.

Re:Zig 0.16.0 Release Notes by redrobein on Tuesday April 14, 2026 @08:03PM (#47773058)
Are there any plans to add syntax sugar for interacting with vtables?
Re:Zig 0.16.0 Release Notes by metaltyphoon on Tuesday April 14, 2026 @09:21PM (#47773530)
Sadly no, as fas as I'm aware. I can't think of creating vtables manually every time I need to create interfaces, I guess Zig is not for me.
Re:Zig 0.16.0 Release Notes by slopinthebag on Tuesday April 14, 2026 @11:53PM (#47774517)
Yeah I don't understand why a language cannot automate something that routine and boilerplate-y.

Oh well, people like it so I won't judge, I'm happy we have choices for what languages we use. Just wish people would choose safe ones :/

Re:Zig 0.16.0 Release Notes by lenkite on Wednesday April 15, 2026 @02:32AM (#47775445)
Wish we could bribe Andrew Kelley to add a built-in for this. There are only a couple of regular ways that everyone creates these vtables. Might as well just standardize it.
Re:Zig 0.16.0 Release Notes by sali0 on Wednesday April 15, 2026 @11:30AM (#47780503)
I feel like a std lib module would be sufficient.
Re:Zig 0.16.0 Release Notes by pjmlp on Tuesday April 14, 2026 @03:24PM (#47770227)
It has C style interfaces, meaning structs with function pointers.

Which is basically how most device drivers in OSes that happen to be written in C, including UNIX flavours, work.

Re:Zig 0.16.0 Release Notes by metaltyphoon on Tuesday April 14, 2026 @09:21PM (#47773535)
We all know that OP wasn't asking about THAT kind of interface and more "please create vtables for me" style of interface
Re:Zig 0.16.0 Release Notes by pjmlp on Wednesday April 15, 2026 @01:06AM (#47774891)
That is too much compiler magic for Zig folks.
Re:Zig 0.16.0 Release Notes by AndyKelley on Wednesday April 15, 2026 @01:31AM (#47775037)
You know, I used to be annoyed by all your consistently shitty remarks in any zig related HN thread, but these days, it's refreshing to have an unpleasant interaction with a human.

Sincerely, thanks for all your hand-written hatred.

Re:Zig 0.16.0 Release Notes by pjmlp on Wednesday April 15, 2026 @01:41AM (#47775107)
It goes both ways, when I see remarks regarding other languages from Zig community folks, not from you directly.

Modula-2 like safety is still better than C will ever be, though.

Yeah, it will be human as far as I can take it, cheers.

Re:Zig 0.16.0 Release Notes by lmaoatyou on Friday April 17, 2026 @02:25PM (#47809002)
You think what he wrote is "hatred"? Grow up dude, you need to be able to take stuff like that on the chin.
Re:Zig 0.16.0 Release Notes by baranul on Wednesday April 15, 2026 @12:05PM (#47781085)
Perhaps it can be a relief to make assessments about a couple of newer C alternative languages[1][2]. Zen C appears to be moving up very quickly, and even has autofree.

[1]: https://github.com/c3lang/c3c (C3)

[2]: https://github.com/zenc-lang/zenc (Zen C)

Re:Zig 0.16.0 Release Notes by slopinthebag on Tuesday April 14, 2026 @11:54PM (#47774526)
That's a hack, not an interface lol
Re:Zig 0.16.0 Release Notes by pjmlp on Wednesday April 15, 2026 @01:08AM (#47774902)
As plenty of other things in an "everything is explicit" language, whose goal is to be a safer C and nothing else.

The "module" system is another hack.

Re:Zig 0.16.0 Release Notes by spiffyk on Wednesday April 15, 2026 @05:20AM (#47776632)
How is it a hack? I mean, you may not like the fact that Zig does not provide syntax sugar for interfaces, but how exactly do you think they are implemented in languages that do?
Re:Zig 0.16.0 Release Notes by lukaslalinsky on Thursday April 16, 2026 @08:06AM (#47791827)
You would be terrified if you realized how the whole C-based GNOME/GTK ecosystem works :)
Re:Zig 0.16.0 Release Notes by zamadatix on Tuesday April 14, 2026 @09:11PM (#47773472)
If they knew what all of the 0.x breaking changes were going to be ahead of time they wouldn't need to be trying out different choices to see how well they really pan out!
Re:Zig 0.16.0 Release Notes by geon on Saturday April 18, 2026 @05:12AM (#47814417)
Breaking changes don't require a rewrite.