3 ms·
What does this have to do with my comment? If you're out of memory, how can zig know you can just continue on? What if your memory is held in tasks that are eff
by prussian 5y ago
What does this have to do with my comment? If you're out of memory, how can zig know you can just continue on? What if your memory is held in tasks that are effectively dead-locked because a dependent task is incapable of allocating? There are many things that can be happening once memory is effectively maxed out. The more common towards the edge is higher I/O and the system crawls.
I'm sure Zig is great, but I don't see from what you linked how that changes what I said.
- cies 5y agoI know Rust much better than Zig. I found that one difference between the two is Zig default behavior on mem alloc: it can fail. All code alloc'ing mem needs to deal with this potential failing: the dev can choose to "panic/die/exit/etc" or possibly a different strategy can be chosen (display smth in the UI, not allocating memory, etc). Rust has this "nicely return a Result, instead of exceptions/panics/etc", in most cases, but not in the case of mem alloc. That a big difference between Zig an Rust. Now Rust has alternative methods for mem alloc that return a Result: but these are not the default and thus hard to discover. This is "unsafe behavior by default" in Rust. This is special, as Rust usually promotes the safe path.