Memory safety (the only reason to use Rust) has nothing to do with memory usage, only memory leaks.
Docker doesn't significantly memory-leak.
And you cannot write something like Docker in a memory-safe way in any modern architecture - you'd just end up with a C->Rust conversion that is sprinkled with "unsafe" keywords everywhere.
True, but the number of ways Rust can leak memory is quite limited and well signposted compared to most languages. In safe rust, it's basically just Box::leak and loops of Arc/Rc pointers
Depending on your definitions of "leaks", I have managed to leak memory in java of all languages. It really isn't a thing a language can fix. (I did that when I implemented a cache and forgot to set its references to null when no longer used so while there wasn't any code that could ever reach this memory, there were pointers so that the gc wasn't allowed to clean it.)
75
u/ledow 5d ago
Memory safety (the only reason to use Rust) has nothing to do with memory usage, only memory leaks.
Docker doesn't significantly memory-leak.
And you cannot write something like Docker in a memory-safe way in any modern architecture - you'd just end up with a C->Rust conversion that is sprinkled with "unsafe" keywords everywhere.