Earlier quoted context omitted.
The original Zig code is metaphorically one big unsafe block. Even if the Rust port is made up of 3% unsafe blocks, that still means 97% of the original Zig code has been made safe (in the Rust sense).
Not every line of zig is "unsafe".
Buz – A fork of Bun using modern Zig, with sub-1s incremental builds
201–202 of 202 posts
Re: Buz – A fork of Bun using modern Zig, with sub-1s incremental builds
#202Earlier quoted context omitted.
Not every line of zig is "unsafe".
No, but when the compiler isn't enforcing anything, how do you know which ones are safe and which ones are not? If we ignore declarations etc. and only consider statement lines that read or write memory, then any such line of Zig (or C, or C++, or any other unsafe language) can be classified as a potentially unsafe — not just today, but in the future, since safety bugs can be generated upstream by giving out pointers…
Surely it's obvious that's trivially untrue?
Also, literally no code is safe from potential future upstream changes.
Anyway, I'm not arguing zig has the same safety guarantees as rust. That would be silly. But the weird binary thinking around memory safety is equally silly. People want things to be simple, but you really can't come to good conclusions by trying to pretend things are simpler than they are and through a lack of analysis and thinking.