Great things about Rust that aren't just performance

ntietz.com

183 points by vortex_ape 6 hours ago


lordnacho - 5 hours ago

For me, there's a headline draw, which is the borrow checker. Really great.

But apart from that, Rust is basically a bag of sensible choices. Big and small stuff:

- Match needs to be exhaustive. When you add something to the enum you were matching, it chokes. This is good.

- Move by default. If you came from c++, I think this makes a lot of sense. If you have a new language, don't bring the baggage.

- Easy way to use libraries. For now it hasn't splintered into several ways to build yet, I think most people still use cargo. But cargo also seems to work nicely, and it means you don't spend a couple of days learning cmake.

- Better error handling. There's a few large firms that don't use exceptions in c++. New language with no legacy? Use the Ok/Error/Some/None thing.

- Immutable by default. It's better to have everything locked down and have to explicitly allow mutation than just have everything mutable. You pay every time you forget to write mut, but that's pretty minor.

- Testing is part of the code, doesn't seem tacked on like it does in c++.