4 ms·
> no pass-by-value/pass-by-reference ambiguity There's a known design issue [1] with one feature in zig that can cause issues with value/pointer passing and ca
by laserbeam 3y ago
> no pass-by-value/pass-by-reference ambiguity
There's a known design issue [1] with one feature in zig that can cause issues with value/pointer passing and can cause aliasing errors. The goal for the language is to resolve the problem before 1.0, even though the fix will likely cause code to feel a bit closer to C. There's a talk [2] that goes into details on why this is an issue.
Regardless, I still love zig.
[1] https://github.com/ziglang/zig/issues/12064 https://github.com/ziglang/zig/issues/12064
[2] https://youtu.be/dEIsJPpCZYg https://youtu.be/dEIsJPpCZYg
- kibibu 3y agoHmm, there's a distinct change of opinion by andrewrk from the linked issue (2022) to now https://github.com/ziglang/zig/issues/12064 https://github.com/ziglang/zig/issues/12064 (July 2022): > Hope you don't mind I'm going to reopen this issue because it concisely demonstrates a design flaw with result location semantics and I'm not ready to accept status quo as permanent due to aliasing issues like this. Compare to a very closely related issue regarding destructing, which exhibits the same problem https://github.com/ziglang/zig/issues/17283 https://github.com/ziglang/zig/issues/17283 September 2023): > This is working as designed. Everybody was aware this behavior would be a consequence of destructuring and there is no plan to change it.