Obviously, I/O as an interface is the headliner here, but there are lots of other goodies to pay attention to, such as the "juicy main".
Small integers auto coercing into floats is a nice gift to game devs. It's nice that game dev is acknowledged as one of the niches Zig can target as I believe it could really thrive there due to how easily it can integrate with C & C++. Or, rather, more easily than the alternatives.
I did a really tiny contribution about zig cc supporting -exported_symbols_list, which together with the hack of filtering out -liconv makes for a very viable linux -> macOS Rust cross-compiler. There's a few caveats but those have been manageable so far.
What a banger of a release. The new `Io` interface was a huge breaking change for my project, but I made the transition. Zig seems to be pulling the same trick it pulled with allocators: just make it an explicit value that you pass around. Explicit allocators felt obviously right in retrospect, and so far this feels obviously right too.
The approach feels like a natural extension of Zig's philosophy about explicitness around low-level operations (no hidden control flow, no hidden memory allocations, etc.). Your function can be blocking? Communicate that through the function signature! Very in style for the language.
It's the dark horse of this release as CLI parsing can also be more easily built on top of it. There's a couple of proposals floating around now, so I hope we get something soon-ish (maybe in 0.18 since a short cyle is planned for 0.17).
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.
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.
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.
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.
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?
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!
I've been waiting eagerly for this release ever since the new Io interface was announced. Pumped to start working on some new projects with this!
Love this line from the release notes:
> Lo! Lest one learn a lone release lesson, let proclaim: "cancelation" should seriously only be spelt thusly (single "l"). Let not evil, godless liars lead afoul.
It's strange, because it has been over 10 years now. To get to 0.20, seems like it would be another 2 to 3 years. The weirdest thing is how Zig continuously gets a pass for being "almost there", for around 5 years now.
An argument could be made that why it's taking so long is about the language's BDFL wanting the freedom to continually make breaking changes. As it is, they got another bewildering pass for sweeping 3,000 plus issues under the rug, with the move from GitHub to Codeberg.
Programming languages take a long time to build. Zig is a more ambitious project than most. I see lots of progress in these release notes and I'm happy to "give a pass" for the fact that it's not finished.
No one's been giving passes bewildering or otherwise for sweeping issues under the rug, because that didn't happen. The 0.16 release notes are linking to plenty of GitHub issues. If you have additional information to post on an issue then you can copy it to Codeberg: https://codeberg.org/ziglang/zig/issues/30027
I think Andrew should seriously think about decoupling the toolchain from the language to put focus on reaching stability there. As it is, we have the compiler with surrounding toolchain, the standard library and the language. The two former can keep evolving even language is fixed.
Just being ambitious isn’t necessarily good. Look at Perl6.
I honestly dont see it as an issue. At least not for now. You could have languages or software released as 1.0 at any time but they are not finished or ready for it. Arguably Crystal is a bit like that.
Or you end up like NIM which they are on 3rd or 4th version already.
And frankly speaking, a lot of people took to Wiki and said it has been 10 years, in reality Andrew only started working on it full time in 2018, and had a year off due to other personal issues, and then COVID hit. Together It is more like 6 years than 10.
Odin started in 2017, had a fraction of the contributors and is soon 1.0, so that explanation isn’t cutting it.
If you instead look at the over 500 kloc of the Zig source compared to the 70 kloc of the Odin one, it’s a bit clearer why the delay happened: the goals of Zig kept expanding.
But not only that: ”juicy main” and Io is something that could have been in Zig from the early days and yet it isn’t. In the Io case it’s Zig pivoting from ”we have colorless async!” to no async, to Io.
In other words, Andrew is still experimenting with the language (and more is to come, like ranged integers). This is not the signs of a maturing language, it a language still very much in flux, trying to find its form.
The contrast to Odin is that for the last 2-3 years it has had minimal syntax tweaks, and is essentially in release candidate mode for the language.
Even if Zig didn’t need more changes, it would still need that stabilization period.
Small integers auto coercing into floats is a nice gift to game devs. It's nice that game dev is acknowledged as one of the niches Zig can target as I believe it could really thrive there due to how easily it can integrate with C & C++. Or, rather, more easily than the alternatives.