3 ms·
Agreed but doing this at compile time would require some sort of pointer lifetime tracking in the compiler. Don't know how much of this is feasable without goin
by flohofwoe 5y ago
Agreed but doing this at compile time would require some sort of pointer lifetime tracking in the compiler. Don't know how much of this is feasable without going "full borrow checker", but static analyzers for C do a similar thing, by far not as watertight as Rust of course.
The General Purpose Allocator can optionally catch use-after-free by not recycling virtual memory addresses, not very efficient for small high-frequency allocations of course, but then Zig isn't an OOP language either (where it would be common to create and destroy massive amounts of tiny objects).
- pjmlp 5y ago> ...but static analyzers for C do a similar thing.. Exactly, which begs the question why bother with Zig at all.
- flohofwoe 5y agoZig is a much more ergonomic language, toolchain and build system. And since Zig is also a C/C++/ObjC toolchain, it's not about "Zig or C/C++", but about "Zig and C/C++" (at least from my PoV).
- pjmlp 5y agoFrom my point of view it isn't enough to warrant adoption over existing alternatives. Maybe someone proves me wrong with some killer application that makes Zig unavoidable for the rest of us.