News for hackers. Stuff that matters.
Re:Modern C by johnnycerberus on Friday September 04, 2020 @10:45AM (#24375355)
I would have said that Zig is for Rust like C is for C++. But I would be wrong. Zig has all the power of C++, but it doesn't hide anything from you, it is not as complex as C++ and it is unsafe. In the future, probably Zig will be the choice for things that require lots of unsafe components and Rust otherwise. There was also an article about this in which the author said that "unsafe zig is safer than unsafe rust".[1] Moreover, I am also interested in F*, the ability to generate efficient C, ASM and WASM code from it looks promising.

[1] https://andrewkelley.me/post/unsafe-zig-safer-than-unsafe-ru...

Re:Modern C by saagarjha on Friday September 04, 2020 @12:31PM (#24376447)
> There was also an article about this in which the author said that "unsafe zig is safer than unsafe rust".

This is the wrong conclusion to derive from one example where Zig checks alignment and Rust chooses not to. (Nor is the conclusion particularly profound or useful: comparing languages by an attribute in cases where they have said they explicitly do not guarantee semantics of that attribute-safety in this case-is not useful.)