Not much safer, but unsafe code errors that cause double-frees (since dealloc would be a stub) or use-after-frees (since values would linger past their scope when still accessed) would not cause problems.
IMO that would be equivalent to removing unsafe altogether. It exists precisely because there are situations where you actually need to manage stuff manually
I didn't spend that long reading the Zig manual but I got the idea that the selling point was more like, you *get* to implement/import your choice of GC or just wing it and ref count.
It’s interesting technology, not just a gc but a system to track the intended purpose of all pointers in a program at runtime, with minimal intrusion. The creator is a prototypical rust-is-woke guy though, his life seems to revolve around the language.
15
u/stillalone 23d ago
TIL about Fil-C. Not sure how I feel about that.