Live data from Hacker News

Zig 0.6.0 Release Notes

ziglang.org

1–10 of 33 posts

Re: Zig 0.6.0 Release Notes

#2
Disclosure: I'm not a seasoned c/c++ developer. Just started working with just 3 days ago using 0.0.5 release, it's a young language, but very nice to work with even now. Just starting to do more non-trivial things, but it's a nice alternative to doing stuff with c. Managed to do most of what I could with c after some trial and error and using the offical docs, including using C libraries without much issue. Great work Andrew and everyone else working on Zig!

Re: Zig 0.6.0 Release Notes

#3
I wrote a small thing with gtk and zig a while ago, it feels like magic to just import a C header and have it work, and the experience is generally very good, especially for such a young language, and any problems i had figuring things out, I found the community very friendly in helping me.

Re: Zig 0.6.0 Release Notes

#5
post #4

One 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

I believe function coloring has never been about syntax but about semantics. It's not possible to yield while waiting for an async function to resolve without being async yourself. And if you have a choice between an async and a sync function that you could call from your async function, you should prefer to call the async one to avoid stalling whatever executor is driving your function.

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

#6
I'm happy to see Zig moving along. I've been using my extra spare time the last couple of weeks to play with it and it's been fun. Documentation is still sparse but there is a whole lot more of it both in general and on the stdlib (zig test cases code is still the best place to figure out the stdlib IMO). Some things just feel "right" without having to give up access to the memory; a good example being arbitrary width integers being used in packed structs to create file/network headers without having to manually bit-twiddle every 4 bit field. Cross compiling is really as easy as it says on the tin and the standard library isn't afraid to include things like net and unicode but at the same time doesn't feel like it tries to throw the kitchen sink in too.

Unfortunately 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

#7
Congrats to the team. I've been using Zig for about a month now for personal projects and it's been fun.

My 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

#8
Thank you for working so tirelessly on this, Andy! I’ve seen first hand the blood, sweat and tears you’ve put into Zig. I’m so happy to be able to support your dream, a dream that is really meant for making other people’s lives better! Keep on keeping on!

Re: Zig 0.6.0 Release Notes

#9
post #4

One 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

> function coloring problem

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.

Re: Zig 0.6.0 Release Notes

#10
There are hundreds of changes listed here and still no mention of fixing the fact that zig purposely errors out on tabs and carriage returns. This might sound too ridiculous to believe, but if you use tabs or save a file out of windows text editor with normal settings, zig just won't compile. It would be trivial to do what every other compiler in history does, but they want to screw with windows users or anyone you uses tabs for some philosophical reason.
Post reply on HN