3 ms·
> - In a world where "memory unsafe" languages are under attack... yeah, we don't care about that. FWIW Zig does offer spatial memory safety, but does not prov
by flohofwoe 2y ago
> - In a world where "memory unsafe" languages are under attack... yeah, we don't care about that.
FWIW Zig does offer spatial memory safety, but does not provide temporal memory safety in the language (e.g. "dangling references"). It also fixes most of the 'sloppyness', UB and general footguns in C and C++ (and most memory corruption issues are a side effect of those).
Temporal memory safety can for instance be achieved via generation-counted handles (e.g. see: https://floooh.github.io/2018/06/17/handles-vs-pointers.html https://floooh.github.io/2018/06/17/handles-vs-pointers.html and https://github.com/zig-gamedev/zpool/ https://github.com/zig-gamedev/zpool/)
- pjmlp 2y agoA fix that was already available in languages like Modula-2 and Object Pascal, but apparently needs to be packaged in curly brackets.