Live data from Hacker News

Zig 0.5.0 Release Notes

ziglang.org

31–40 of 80 posts

Re: Zig 0.5.0 Release Notes

#31

Earlier quoted context omitted.

It's actually become simpler and slimmer, with fewer peculiarities!

Could you follow up with some examples? Seems to contradict the parent but neither comment provides examples.

They got rid of the % operator for error propagation for one.

Re: Zig 0.5.0 Release Notes

#32
The new async/result location stuff reminds me of the Pin concept that Rust fairly recently adopted. It seems like a pretty huge step forward for the language. Especially since it's casually mentioned that it also solved "safe recursion".

I'm curious about the tools zig offers around doing asyc work while guaranteeing certain invariants, and how the @Frame builtins work with that, but I'm guessing that's going to be elaborated on in a future post.

Re: Zig 0.5.0 Release Notes

#34
post #29
post #2

It's an exciting week for programming languages. First Nim, then Zig. Keep up the great work!

Does anyone here have a good understanding of the relative merits of Zig, Crystal, and Nim? Especially compared to higher profile languages like Rust and Go? All of these languages seem to be statically compiled, and they all seem to promise both performance and safety. Rust and Go are discussed all the time on HN, so I expect most of us here have a reasonable notion of their relative benefits, for example, performan…

One significant difference is that Zig has no GC, whereas Crystal and Nim both do.

Re: Zig 0.5.0 Release Notes

#35

https://ziglang.org/documentation/master/#Zen >> Minimize energy spent on coding style. For me this is sort of important because languages not having standard coding style end up 10000 coding styles. Rust fmt is an excellent example for avoiding that. Does anybody use Zig + fmt? I know they have something. https://github.com/ziglang/zig/issues/1523

There's a section in this notes about it https://ziglang.org/download/0.5.0/release-notes.html#zig-fm... The end even has a link to a web-based version of it.

Thanks, I totally missed it.

Re: Zig 0.5.0 Release Notes

#36

Earlier quoted context omitted.

Can you give examples of the peculiarities? I write cpp all day and zig is a nice change for me because of how simple it is to me

> Zig both signed and unsigned integers have undefined behavior on overflow, contrasted to only signed integers in C make a feature unwanted in C, worse. nice.

debug and safe modes in zig disallow overflows entirely unless you specifically use the wrapping operator to clearly specify your intent. These checks are removed in speed-optimized builds.

In other words, the compiler will enforce that `a + b` does not overflow through all your testing and wherever you explicitly say such checks are required, but turns them into nops for you when you desire speed. You can let the compiler know that you explicitly want wrapping overflow (and not some undefined kind) using the wrapping operator `a +% b`.

Re: Zig 0.5.0 Release Notes

#37

Earlier quoted context omitted.

Can you give examples of the peculiarities? I write cpp all day and zig is a nice change for me because of how simple it is to me

> Zig both signed and unsigned integers have undefined behavior on overflow, contrasted to only signed integers in C make a feature unwanted in C, worse. nice.

Please check your facts: https://ziglang.org/documentation/master/#Integer-Overflow

Re: Zig 0.5.0 Release Notes

#38
post #22

Earlier quoted context omitted.

It's an unwillingness to implement documentation generation twice. Why do it in the c++ compiler when the goal is to become self-hosted? I think there's a good answer to this which is, "because people really, really need documentation." So I am kicking around ideas of how this can be done without too much duplicate effort.

I see. Do you think there would be value in having someone just manually writing some interim docs (perhaps as a wiki) until the time when it can be properly generated? This may seem like a weird place to draw experience from, but in my early days of programming, I've found the PHP docs extremely helpful largely thanks to community comments sections giving examples of how to do various things. Just some food for thou…

I think that would be problematic because the standard library is still very unstable. You can see from the release notes just how much changed from 0.4.0. A wiki page would be outdated right away.

One of the tenets of my development process with Zig is "avoid local maximums". A wiki for std lib documentation is not the long term solution to the problem, and so I won't be investing any time into it. All my time is invested in the long term solution.

Re: Zig 0.5.0 Release Notes

#39

Earlier quoted context omitted.

You can use any c libraries networking or socket implementations in zig but I think thats as far as it goes at the moment.

zig's C-interoperability is second to none and using libcurl works great for networking. example: https://github.com/donpdonp/zootdeck/blob/master/src/net.zig

Nim and d both have comparable interop, and nim even works with c++.

Re: Zig 0.5.0 Release Notes

#40

Earlier quoted context omitted.

You can use any c libraries networking or socket implementations in zig but I think thats as far as it goes at the moment.

zig's C-interoperability is second to none and using libcurl works great for networking. example: https://github.com/donpdonp/zootdeck/blob/master/src/net.zig

To be fair, Zig's C interoperability appears to be inspired or borrowed from Swift's little known secret called the ClangImporter.
Post reply on HN