| ▲ | Zig 0.16.0 Release Notes(ziglang.org) |
| 160 points by ska80 2 days ago | 38 comments |
| |
|
| ▲ | mihaelm 2 days ago | parent | next [-] |
| 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. |
|
| ▲ | anttiharju 2 days ago | parent | prev | next [-] |
| Really happy to see 0.16 come out. 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. Absolutely in awe of Zig as a project. |
|
| ▲ | xeubie 2 days ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | mihaelm 2 days ago | parent [-] | | 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. |
|
|
| ▲ | sionisrecur 2 days ago | parent | prev | next [-] |
| The "Juicy Main" looks like a very nice QoL feature. Gets rid of all the boilerplate for allocators and argv. |
| |
| ▲ | mihaelm 2 days ago | parent | next [-] | | 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). | | |
| ▲ | fredyr 2 days ago | parent [-] | | This sounds interesting to me - could you elaborate a little on what things are in those proposals? | | |
| |
| ▲ | portly 2 days ago | parent | prev [-] | | Do I get it right that this is everything you need for a typical CLI tool? | | |
|
|
| ▲ | slopinthebag 2 days ago | parent | prev | next [-] |
| 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? |
| |
| ▲ | badtuple 2 days ago | parent | next [-] | | 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. | | |
| ▲ | redrobein 2 days ago | parent [-] | | Are there any plans to add syntax sugar for interacting with vtables? | | |
| ▲ | lenkite 2 days ago | parent | next [-] | | 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. | | |
| ▲ | sali0 a day ago | parent [-] | | I feel like a std lib module would be sufficient. |
| |
| ▲ | metaltyphoon 2 days ago | parent | prev [-] | | 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. | | |
| ▲ | slopinthebag 2 days ago | parent [-] | | 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 :/ |
|
|
| |
| ▲ | pjmlp 2 days ago | parent | prev | next [-] | | 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. | | |
| ▲ | metaltyphoon 2 days ago | parent | next [-] | | We all know that OP wasn't asking about THAT kind of interface and more "please create vtables for me" style of interface | | |
| ▲ | pjmlp 2 days ago | parent [-] | | That is too much compiler magic for Zig folks. | | |
| ▲ | AndyKelley 2 days ago | parent | next [-] | | 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. | | |
| ▲ | pjmlp 2 days ago | parent [-] | | 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. |
| |
| ▲ | baranul a day ago | parent | prev [-] | | 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) |
|
| |
| ▲ | slopinthebag 2 days ago | parent | prev [-] | | That's a hack, not an interface lol | | |
| ▲ | lukaslalinsky 11 hours ago | parent | next [-] | | You would be terrified if you realized how the whole C-based GNOME/GTK ecosystem works :) | |
| ▲ | spiffyk 2 days ago | parent | prev | next [-] | | 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? | |
| ▲ | pjmlp 2 days ago | parent | prev [-] | | 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. |
|
| |
| ▲ | zamadatix 2 days ago | parent | prev [-] | | 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! |
|
|
| ▲ | nesarkvechnep 2 days ago | parent | prev | next [-] |
| Nice! I'm sad to see SegmentedList go. Also, I'm wondering if it's possible to use `recvmsg` and `sendmsg` backed by the new `Io` interface. |
|
| ▲ | gwenzek 2 days ago | parent | prev | next [-] |
| https://ziglang.org/download/0.16.0/release-notes.html#Loop-... Seems like a big one! I wonder how it will impact real code performance |
|
| ▲ | _bohm 2 days ago | parent | prev | next [-] |
| 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. |
|
| ▲ | jr-14 a day ago | parent | prev | next [-] |
| Seeing forbid runtime vector indexes seem unintuitive and hurt dev ergonomics... |
|
| ▲ | ksec 2 days ago | parent | prev [-] |
| I/O, Linked, Incremental Compilation. Apart from 0.17 being a short release cycle. I wonder how many more releases before 1.0? Are we looking at 0.20, another one and half year of baking? |
| |
| ▲ | baranul a day ago | parent [-] | | 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. | | |
| ▲ | mk12 20 hours ago | parent [-] | | 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 |
|
|