Hacker News new | ask | show | jobs
by flohofwoe 524 days 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 and https://github.com/zig-gamedev/zpool/)

1 comments

A fix that was already available in languages like Modula-2 and Object Pascal, but apparently needs to be packaged in curly brackets.