2 ms·
Deallocating/RAII is not memory safety. Leaking all memory is, in fact, a tried-and-true way to get memory safety (GC'd languages are semantically doing this: G
by dbaupp 9y ago
Deallocating/RAII is not memory safety. Leaking all memory is, in fact, a tried-and-true way to get memory safety (GC'd languages are semantically doing this: GC is "just" an optimization), since it means problems like use-after-free are impossible. Memory leaks are great to eliminate, but they can't lead to the corruption that memory unsafety can cause. http://huonw.github.io/blog/2016/04/memory-leaks-are-memory-safe/ http://huonw.github.io/blog/2016/04/memory-leaks-are-memory-...
Rephrasing the parent's question: does Zig try to ensure memory safety (e.g. no use-after-free, dangling pointers, iterator invalidation, data races)?
- eradicatethots 9y agoZig + borrow checker is my ideal language
- fasquoika 9y agoMaybe look at the language that inspired Rust: Cyclone http://cyclone.thelanguage.org/ http://cyclone.thelanguage.org/ . It's just a research language (which the site claims is "done") but maybe worth a look.
- eradicatethots 9y agoSeems pretty cool, too bad it’s dead now though