4 ms·
No it's about "by default" not pestering users. Rust has all the tools needed to gracefully handle memory allocation failure. Yes, the tools are a bit limit w
by dathinab 6y ago
No it's about "by default" not pestering users.
Rust has all the tools needed to gracefully handle memory allocation failure.
Yes, the tools are a bit limit wrt. usages in the standard library where you mainly can use them to handle "known to potentially fail big" allocations but not every single small allocation.
But enter no_std and it's basically all your choice, which is also the default thing to use for embedded/bar-metal and I count the kernel as embedded/bar-metal. (It's default because the std library types are tuned for the most common use-cases including web-server and user-space system programming, in which you always can have panic on OOM, and error kernel as a much more ergonomic pattern then explicitly returning a result on every thing which potentially allocates).
Through without question the discussion around it is a mess.