4 ms·
I like Zig a lot, but I'm concerned that it's yet another language that leaves memory management up to the developer. For example, Zig does not appear to have
by atombender 6y ago
I like Zig a lot, but I'm concerned that it's yet another language that leaves memory management up to the developer.
For example, Zig does not appear to have any concept of lifetimes, and does not enforce single mutable ownership. As I understand it, Zig does not have RAII, either, so cleanup (with "defer", etc.) is also left as an exercise for the programmer. Zig has arenas, allowing quick cleanup, but seems pretty bare-bones otherwise.
(I was relieved to see that Zig does not allow unchecked null pointers.)
- higerordermap 6y agoIn very low level programming, we probably want more fine grained control, and specialized code tends to use specialized arena allocators anyway. If I am to write a browser engine, I'd choose rust, to write an embedded OS I'd choose zig.
- j-krieger 6y agoRust has fine-tunable control. It‘s just locked behind an „unsafe“ block.