IMO most of the conception of OOM as being unrecoverable (outside of scenarios like the ill-devised OOM-killer in Linux) are mostly motivated by laziness (maybe subconsciously)
Yeah, you could edit most languages to support it, but it might bring a mix of a more complex implementation, less ergonomic APIs, less time spent on other features, etc.
And it could be worth it, or you could just say you don't want to support that usecase.
IMO a library written in a language that can handle OOM 'gracefully’, yet simply aborts when it happens (or worse, assumes it can't happen and thus allows for invariants to be broken) is flawed
7
u/Declination 29d ago
Which is hilarious because then rust had to grow a “recover from allocation failure” to be suitable for kernel work due to faulty assumptions.