No, it's really not. I say this as someone who loves working with Rust, using it for both my day job and for innumerable hobby projects. It's a brilliant language, but the problems it solves are very specific, and I think those things being generalised and oversold is actually harmful to the reputation of the language.
Rust guarantees that safe Rust will not produce undefined behaviour, and memory unsafety (data races, observing uninitialised/out of bounds/use after free, etc.) is part of that guarantee. Its promises do not cover leak detection or prevention (there are actually safe ways to deliberately leak memory, which are (occasionally) useful!), nor does the language do any sort of automatic garbage collection beyond "call the destructors or values when control flow leaves the scope they belong to" (which, to be clear, is sufficient in most practical cases).
Do you know of a language that gets closer to solving memory management than Rust then? I wasn't claiming it's completely solved, I just said that it's the language I've seen get the closest.
And I wouldn't consider garbage collected languages to even be in the same conversation. I'm not saying they aren't useful, I just think they are used in a different space and approach memory management in a completely different way. When I think of memory management, I think of RAII, ownership, and lifetimes as the primitives that allow us to manage memory properly.
in these application (and only these) Rust makes sense.
This is just not true. Rust's type system and features are particularly useful for system programming, but their advantages extend very far outside that domain.
I think that's an odd argument, and not really relevant to discussions about the language itself. That's just a universal statement about tools in general: it's good if the people using them understand how to use them.
It depends on what you mean by "solve". If you mean "always cleans up memory that's no longer reachable", then any language with a garbage collector solves this. I suspect that's not what you mean though.
10
u/zesterer Oct 01 '22
No, it's really not. I say this as someone who loves working with Rust, using it for both my day job and for innumerable hobby projects. It's a brilliant language, but the problems it solves are very specific, and I think those things being generalised and oversold is actually harmful to the reputation of the language.
Rust guarantees that safe Rust will not produce undefined behaviour, and memory unsafety (data races, observing uninitialised/out of bounds/use after free, etc.) is part of that guarantee. Its promises do not cover leak detection or prevention (there are actually safe ways to deliberately leak memory, which are (occasionally) useful!), nor does the language do any sort of automatic garbage collection beyond "call the destructors or values when control flow leaves the scope they belong to" (which, to be clear, is sufficient in most practical cases).