7 ms·
> Writing memory safe code in unsafe languages requires global reasoning If you learn how to use arena allocators and in general use modern techniques, you don
by kristoff_it 3mo ago
> Writing memory safe code in unsafe languages requires global reasoning
If you learn how to use arena allocators and in general use modern techniques, you don't need global reasoning to write correct memory management code pretty much never.
If your code is a RAII and abstraction maze, then yes, you will probably need global reasoning, but that's not the case with Zig.
- J_Shelby_J 3mo agoThe billion dollar “if”
- kibwen 3mo agoArena allocators are great for certain use cases, but they don't provide any solutions to memory unsafety; they don't do anything for use-after-free, they don't do anything for buffer overruns, they don't address any sources of undefined behavior, and they don't do anything for thread-safety, which is a requirement for memory safety.
- saagarjha 3mo agoNot all code can be expressed well by an arena allocator.