Re:Zig: programming language designed for robustness optimal...
by CyberDildonics on Tuesday May 29, 2018 @11:18PM
(#17184792)
I don't understand. Rust has memory safety as a core design principle. Zig has manual memory allocation like C.
[ Parent
| on HN ]
Re:Zig: programming language designed for robustness optimal...
by tiehuis on Tuesday May 29, 2018 @11:54PM
(#17184929)
Zig is memory-safe if you keep runtime checks enabled (e.g. with debug or release-safe optimization levels)
but it does not have the compile-time guarantees of Rust. I don't think the parent comment is a fair reflection.
That being said, some other potentially interesting safety aspects that are present (or are being explored) to give some idea of the target audience:
- compile-time alignment checks [1]
- maximum compile-time stack usage/bounding [2]
I would expect safety at the end of the day in Zig will be more similar to
modern C++ and its smart pointers, alongside (optional) runtime checks,
than a full lifetime system. Will have to see what the future holds.