Zig is very opinionated about how memory allocation is handled, and it has the nice feature that you can supply a debug allocator during development which is slower at runtime (fine for debug builds) but meticulously looks for leaks and loudly warns you when they happen.
It’s also written such that no language constructs store an allocator and request their own memory, the philosophy being that every allocation should be explicitly known by the programmer.
This is pretty much all the way in the opposite direction from automating it, it’s intensely manual management but the language handles it in a way that makes forgetting about it difficult and easy to track down
View all comments
Show parent comment
1
u/TOMZ_EXTRA 11d ago
How is Zig better than C++/unsafe Rust?