News for hackers. Stuff that matters.
Re:The end of the kernel Rust experiment by lmm on Wednesday December 10, 2025 @12:35AM (#46214440)
Zig at least claims some level of memory safety in their marketing. How real that is I don't know.
Re:The end of the kernel Rust experiment by vlovich123 on Wednesday December 10, 2025 @02:05AM (#46214944)
About as real as claiming that C/C++ is memory safe because of sanitizers IMHO.
Re:The end of the kernel Rust experiment by Ygg2 on Wednesday December 10, 2025 @05:35AM (#46216208)
I mean, Zig does have non-null pointers. It prevents some UB. Just not all.
Re:The end of the kernel Rust experiment by pjmlp on Wednesday December 10, 2025 @08:18AM (#46217354)
Which you can achieve in C and C++ with static analysis rules, breaking compilation if pointers aren't checked for nullptr/NULL before use.

Zig would have been a nice proposition in the 20th century, alongside languages like Modula-2 and Object Pascal.

Re:The end of the kernel Rust experiment by gjajric on Wednesday December 10, 2025 @03:56AM (#46215577)
I have heard different arguments, such as https://zackoverflow.dev/writing/unsafe-rust-vs-zig/ .
Re:The end of the kernel Rust experiment by tomnipotent on Wednesday December 10, 2025 @02:44AM (#46215173)
I'm unaware of any such marketing.
Re:The end of the kernel Rust experiment by dwattttt on Wednesday December 10, 2025 @03:03AM (#46215279)
Zig does claim that it

> ... has a debug allocator that maintains memory safety in the face of use-after-free and double-free

which is probably true (in that it's not possible to violate memory safety on the debug allocator, although it's still a strong claim). But beyond that there isn't really any current marketing for Zig claiming safety, beyond a heading in an overview of "Performance and Safety: Choose Two".

Re:The end of the kernel Rust experiment by tomnipotent on Wednesday December 10, 2025 @03:50AM (#46215537)
That's a library feature (not intended for release builds), not a language feature.
Re:The end of the kernel Rust experiment by weebull on Wednesday December 10, 2025 @08:22AM (#46217393)
It is intended for release builds. The ReleaseSafe target will keep the checks. ReleaseFast and ReleaseSmall will remove the checks, but those aren't the recommended release modes for general software. Only for when performance or size are critical.
Re:The end of the kernel Rust experiment by tomnipotent on Wednesday December 10, 2025 @12:51PM (#46220936)
DebugAllocator essentially becomes a no-op wrapper when you use those targets.
Re:The end of the kernel Rust experiment by gf000 on Wednesday December 10, 2025 @06:33AM (#46216587)
Runtime checks can only validate code paths taken, though. Also, C sanitizers are quite good as well nowadays.