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

5

u/NobodyXu Nov 18 '22

Rust is bad at literals. Lots of stuttering, lots of verbosity, runtime expense with "some string".to_owned() that could have been avoided. Macros help paper over the worst cases but that has its own problems.

Maybe you want std::borrow::Cow or beef which provides smaller Cow implementation (same size as String)?

&dyn Trait is nice, but not quite the same thing--this would still be statically typed, just a different call ABI.

dyn Trait uses dynamic dispatch instead of monomorphization. It's not a different call API, but it's a fat pointer that contains the vtable.