r/rust • • Nov 17 '22

What are Rust’s biggest weaknesses?

What would you say are Rust’s biggest weaknesses right now? And are they things that can be fixed in future versions do you think or is it something that could only be fixed by introducing a breaking change? Let’s say if you could create a Rust 2.0 and therefore not worry about backwards compatibility what would you do different.

220 Upvotes

390 comments sorted by

View all comments

Show parent comment

12

u/anengineerandacat Nov 18 '22

The thing is if you're a shitty programmer then Rust will wreck you mercilessly at the compiler and torment you for days before you really get anything up and working.

Or you are literally coming from a language where lifetime management is automated and isn't your problem.

Has nothing to do with being a shitty programmer and more about willing to learn and gain mastery over the subject.

I can somewhat understand if someone who spent 13-14 years on C/C++ or C# went "Fuck that" to Rust; lifetime management is pretty massive overhead when you need to constantly think about it.

It's like grabbing someone who has been driving an automatic vehicle all their life and suddenly putting them into a manual; they are going to struggle and some may even hate the experience because the pro's don't outweigh the con's. This doesn't make them a bad driver.

4

u/buyIdris666 Nov 20 '22

Manual lifetime management is also slower than GC in many cases.

If your object is nested, has cycles, or a linked list, a good GC like Java's new ones will clean up memory without pausing your main thread while everything gets dropped.

A lot of rust devs reach for arena collectors and ref counting when dealing with complex objects. Those are both just shitty forms of GC.