I'm glad to see this post here. Just because I hear/read a lot of people outright dismiss Rust's potential here with arguments that kind of miss the point:
1. You don't need CPU performance for most web stuff. It's all IO bound.
2. Related to #1, garbage collectors are fine and you don't need the Rust model.
3. Rust is so hard to learn that it isn't worth it unless you need the performance.
There's so much more to Rust than the performance. It hits a really nice sweet spot between being expressive and letting you take as much control as you want/need.
Sometimes GC'd languages are a pain in the butt because I just want a damned destructor and I would like to be able to guess when/if it's gonna run.
And, frankly, Rust isn't that hard. It's an imperative language. It's not Haskell.
Can someone elaborate on why #2 is wrong on the server level? My systems are not performance bottleneck'd and as a Java dev I'm more worried about the potential for memory bugs (which I admit I will create) if I stray away from automatic garbage collection.
It's not wrong. I didn't mean to imply that. I just mean that saying non-GC languages are about performance overhead of the garbage collector is missing the point.
Sometimes, it's convenient and easier to reason about stuff when you can predict when something is actually dropped from memory.
And in Rust, you wouldn't create those memory bugs you're worried about. (Well, you can, but you have to go out of your way to take the safety off :)) That's kind of Rust's whole "shtick"
Depends what we're talking about. A "true" memory leak (as in allocated memory that is not referenced) is not very likely.
A reference cycle with `Arc`s can happen though.
But if you're talking about Java and mediocre devs (I'm in the club- don't worry), I feel like there are no shortage of ways to make bugs with null, concurrency issues, etc, that Rust completely eliminates. You can make reference cycles in Rust, though.
Also, in Rust code you often don't have references to references to references the way you do in Java, so it's just not an issue that I'm aware of having had yet.
That SO answer restates what the parent said: you can leak data either explicitly (Box::leak/std::mem::forget) or by creating reference cycles when using Arc/Rc.
1. You don't need CPU performance for most web stuff. It's all IO bound.
2. Related to #1, garbage collectors are fine and you don't need the Rust model.
3. Rust is so hard to learn that it isn't worth it unless you need the performance.
There's so much more to Rust than the performance. It hits a really nice sweet spot between being expressive and letting you take as much control as you want/need.
Sometimes GC'd languages are a pain in the butt because I just want a damned destructor and I would like to be able to guess when/if it's gonna run.
And, frankly, Rust isn't that hard. It's an imperative language. It's not Haskell.