Live data from Hacker News

Zig 0.11

ziglang.org

171–180 of 193 posts

Re: Zig 0.11

#171

Zig is not memory safe and therefore at risk, just like C/C++, of future government legislation that outlaws the use of memory unsafe languages for some or all projects. The risk of such legislation is not insignificant: https://www.itpro.com/development/programming-languages/3694... Personally I do not see the point of building an entirely new language and ecosystem that does not fully address this issue.

I ditched Rust a year ago in favor of Zig and have not regretted since

Number of memory bugs in several fairly huge projects: 0

Zig is way more maintainable, leads to less code which translates to fewer bugs

How about that?

Re: Zig 0.11

#172
post #142

Earlier quoted context omitted.

It shouldn't be hard to make Zig go to top place then, which is great opportunity to shine, given that they are still missing Zig entries, https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://www.techempower.com/benchmarks/

Zig can and does win plenty of those benchmarks, but ultimately it boils down to who is it that gets nerdsniped into working on a specific challenge. For example in this case Zig won big time over what C/C++/Rust people submitted: https://youtu.be/pSvSXBorw4A?t=1075 Zig is in the same ballpark as the ones mentioned above, so flohofwoe is right. But nevertheless I do think that cztomsik's point also still stands: how…

> basically what happened here

Pico benchmarks!

https://github.com/zackradisic/rust-vs-zig/blob/master/bench...

https://github.com/zackradisic/rust-vs-zig/blob/master/bench...

https://github.com/zackradisic/rust-vs-zig/blob/master/bench...

https://github.com/zackradisic/rust-vs-zig/blob/master/bench...

Re: Zig 0.11

#173
post #132

Earlier quoted context omitted.

> People choosing Zig to anything choose their users to throw away their devices. Apple is asking you to throw away your devices, not Zig. Getting proper CI coverage for supported versions of the OS is already pretty expensive and doing the same for unsupported systems is entirely unfeasible at this moment. Don't buy Apple if you don't want to throw away functioning hardware.

Yeah, sure. It is still a bummer when people that try actively to underpin the whole world tell you 'fuck you'. Having 'we support proprietary systems until their makers support it' as a hard rule is unnecessary and harsh. It is a simple rule, but I don't think it is good. Why not choose the supported systems on individual merits, e.g. on usage statistics? I think for example the Linux kernel does that. edit: I just…

> I just continued the previous thought. If your reply means that you are open or likely to target deprecated systems in the future, that's much better!

It would be nice to eventually provide support older systems but first we need to get to a point where doing so doesn't mean taking away resources from more worthy endeavors.

Re: Zig 0.11

#174
post #142

Earlier quoted context omitted.

It shouldn't be hard to make Zig go to top place then, which is great opportunity to shine, given that they are still missing Zig entries, https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://www.techempower.com/benchmarks/

Zig can and does win plenty of those benchmarks, but ultimately it boils down to who is it that gets nerdsniped into working on a specific challenge. For example in this case Zig won big time over what C/C++/Rust people submitted: https://youtu.be/pSvSXBorw4A?t=1075 Zig is in the same ballpark as the ones mentioned above, so flohofwoe is right. But nevertheless I do think that cztomsik's point also still stands: how…

[deleted]

Re: Zig 0.11

#175
post #142

Earlier quoted context omitted.

It shouldn't be hard to make Zig go to top place then, which is great opportunity to shine, given that they are still missing Zig entries, https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://www.techempower.com/benchmarks/

Zig can and does win plenty of those benchmarks, but ultimately it boils down to who is it that gets nerdsniped into working on a specific challenge. For example in this case Zig won big time over what C/C++/Rust people submitted: https://youtu.be/pSvSXBorw4A?t=1075 Zig is in the same ballpark as the ones mentioned above, so flohofwoe is right. But nevertheless I do think that cztomsik's point also still stands: how…

> Zig can and does win plenty of those benchmarks, but ultimately it boils down to who is it that gets nerdsniped into working on a specific challenge.

> For example in this case Zig won big time over what C/C++/Rust people submitted: https://youtu.be/pSvSXBorw4A?t=1075

That was a faulty benchmark with a simple unnatural footgun that the Rust people overlooked. I don't think it supports your claim that benchmarks typically boil down to who is it that gets nerdsniped into them. Sure, it can happen, it happened at least once, but in general?

Re: Zig 0.11

#176

Earlier quoted context omitted.

I don't need any data to say that Zig is typically faster than Rust because I know that Vec will do a shitload of useless work when it leaves the scope, even if the T does not implement Drop. You can do vec.set_len() but that's unsafe, so... Typical Rust is slower than typical Zig. Zig does not do any work because it does not have smart pointers and it does not try to be safe. It tries to be explicit and predictable,…

You are comparing different memory management strategies, not languages features. All of those languages (C, Zig, C++ and Rust) give you enough choices when it comes to memory management. You can decide to not use frequent heap allocations in Rust or C++ just as you can in Zig (it means not using large areas of the C++ or Rust standard libraries, while Zig definitely has the better approach when it comes to allocatio…

That "just" seems to mean "you'll need to take 10x the time to write the equivalent Rust/C++ program". What a language makes easy to accompish matters.

Re: Zig 0.11

#177

Earlier quoted context omitted.

What advantages does Zig have over C?

Namespaces. Real enums, modules, etc. A compile-time execution system (effectively replaces the preprocessor/macro system). Syntax that is easier to `grep -r` for without complex regex. Tests are a first-class citizen. Safer type system. Really, just a bunch of things that should've been added to C 20 years ago.

It’s difficult and even probably impossible to just “add” those things to C, while keeping everything else as it is.

Re: Zig 0.11

#178

Earlier quoted context omitted.

Namespaces. Real enums, modules, etc. A compile-time execution system (effectively replaces the preprocessor/macro system). Syntax that is easier to `grep -r` for without complex regex. Tests are a first-class citizen. Safer type system. Really, just a bunch of things that should've been added to C 20 years ago.

It’s difficult and even probably impossible to just “add” those things to C, while keeping everything else as it is.

Yeah, I know...

Re: Zig 0.11

#179
post #134

Zig is not memory safe and therefore at risk, just like C/C++, of future government legislation that outlaws the use of memory unsafe languages for some or all projects. The risk of such legislation is not insignificant: https://www.itpro.com/development/programming-languages/3694... Personally I do not see the point of building an entirely new language and ecosystem that does not fully address this issue.

Well, technically, Rust is unsafe, unless they remove “unsafe”. We’re really talking about safety on a continuum, not as a binary switch. Zig has some strong safety features, and some gaps. Well, one notable big gap, UAF. (Perhaps they’ll figure out a way to plug thisin the future? Perhaps by 1.0?) Actually, safety has multiple axes as well. > Personally I do not see the point of building an entirely new language and…

>Well, technically, Rust is unsafe, unless they remove “unsafe”.

I am somewhat surprised this is being mentioned. And the whole thread is without the usual people complaining it about unsafe.

Interesting changes happening on HN.

Re: Zig 0.11

#180
@WalterBright In case any of the sh*t got into you. Ignore all the trolls about you appearing in Zig thread. ( Although I think some of them are just joking )
Post reply on HN