Zig 0.6.0 Release Notes
ziglang.org
Zig 0.6.0 Release Notes
1–10 of 33 posts
Re: Zig 0.6.0 Release Notes
#2Re: Zig 0.6.0 Release Notes
#3Re: Zig 0.6.0 Release Notes
#4Re: Zig 0.6.0 Release Notes
#5One very cool feature of Zig is that it supports calling async/await from any function [1], not just async functions, which avoids the famous function coloring problem altogether. [1] https://ziglang.org/#Concurrency-via-Async-Functions
Zig isn't avoiding it; it's impossible to avoid. Zig is just inferring the async-ness of the function automatically without you needing to write a keyword for it.
Re: Zig 0.6.0 Release Notes
#6Unfortunately it is still very much the 0.x the name implies. Taking the above example defining 2 u129 or larger and trying to multiply them results in an error while compiling about it not being supported yet. Packed struct items that cross word boundaries result in a broken struct that contains a size larger than the data (which breaks pretty much all code that tries to use it due to size/type checking). Also due to comptime being as big of an idea as it is not everything works quite yet like const example: f64 = std.math.sin(4) * std.math.sin(2) being a compile time error since sin isn't defined for comptime floats yet.
Like I said it's definitely fun to play with but it's still quite a few releases away from "is this a compiler bug or did the documentation skim over something I'm just supposed to know" no longer being a problem so if that's not your cup of tea best to just watch the release notes over the next year or two.
Re: Zig 0.6.0 Release Notes
#7My experience is mostly in Go and Java and I've dabbled in C a couple of times, but I found Zig the language quite easy to understand.
Things I like the most about Zig (for now, I haven't tried everything): * error handling * optionals * tagged unions * meta programming * zig fmt
The API documentation of the std lib is still sparse though, I find it's best to search directly in the code to understand how to use it.
Looking forward to try the async functionality.
Re: Zig 0.6.0 Release Notes
#8Re: Zig 0.6.0 Release Notes
#9One very cool feature of Zig is that it supports calling async/await from any function [1], not just async functions, which avoids the famous function coloring problem altogether. [1] https://ziglang.org/#Concurrency-via-Async-Functions
If you haven't heard of it: https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
Highlight:
> Wanna know one [programming language] that doesn’t [have this problem]? Java. I know right? How often do you get to say, “Yeah, Java is the one that really does this right.”? But there you go. In their defense, they are actively trying to correct this oversight by moving to futures and async IO. It’s like a race to the bottom.