Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.)



In 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.


Rust has fine-tunable control. It‘s just locked behind an „unsafe“ block.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: