4 ms·
> My understanding is that rust provides safety guarantees that no other language matches, but at the cost of pretty much everything else. In that regard, the "
by spease 3y ago
> My understanding is that rust provides safety guarantees that no other language matches, but at the cost of pretty much everything else. In that regard, the "linked list" example is a pretty good (although maybe over-pathological) example of the hard parts of the language.
The build system is easier to use than any other language I know of. Integrating third-party libraries into a project is night-and-day between C++ and Rust, and the Rust ecosystem benefits tremendously from it.
Energy efficiency is also extremely good, as is performance.
https://aws.amazon.com/blogs/opensource/sustainability-with-rust/ https://aws.amazon.com/blogs/opensource/sustainability-with-...
And as far as code confidence, I don't know of any other language that compares, either. You can dodge memory safety errors in Java or C# thanks to the GC, but exceptions keep flow control from being as explicit as Rust since your function can be silently pre-empted.
I see Java or C# as paying a small (and in many cases fully justified) cost to smooth things over so there's less friction to development. Go additionally adopts an extreme focus on keeping the language small and simple so it's easy to learn.
Rust declines to pay that runtime cost, but requires you to explicitly address those friction points, while C++ lets you hang yourself.
Rust also has a carefully curated standard library and idiomatic patterns, while C++ has addressed the problem of lessons learned by continually adding to the standard library without keeping different features compatible or consistent with each other.
So, yes, Rust will have a steeper learning curve, but it levels off long before C++'s does. In addition, the compiler messages are far more helpful in Rust, and the default tooling is far better than C++.
- jandrewrogers 3y agoThe relative learning curve between Rust and C++ is strongly dependent on the type of software you are building. I use both. They each have domains where the other is not particularly close in being equally effective (or safe!) as a programming language. One area where C++ still runs rings around Rust, for example, is modern database kernels. Rust’s safety features largely don’t apply, so no benefit, and Rust has large expressivity gaps that make it more complex and less safe to implement things that are straightforward in C++. Also, the relatively weak generics and metaprogramming features of Rust causes this type of code to balloon in size and invites bugs. But for other types of code, this barely matters at all because you don’t have many uses for these C++ features. Horses for courses.