It does seem strange, because:
- It has constructs which aren't present in C/C++ in the exact form, like traits or pattern matching (maybe it'd be easier if they were called templates and switch, but they're not quite the same thing, so a different name is good). There's a lot of Rust-specific jargon for things that aren't as complicated as they seem.
- Some constructs (e.g. enums and empty structs) look like C's, but again aren't quite the same.
- It has powerful generics and macros, so people who want to write really clever code, can.
To take a cue from the article: how do you write a generic max() function for an arbitrary number of arguments?
macro_rules! max {
($e: expr) => { $e };
($e: expr, $($rest: tt)*) => { max($e, max!($($rest)*)) }
}There are three major kinds of backgrounds that Rust programmers come from: functional, systems, scripting.
The functional crowd instantly groks Rust's pattern matching, first-class functions, and expression-based-ness. But they miss some more complex, stronger type system features.
The systems crowd instantly groks Rust's low-level features, but struggles sometimes with the compiler being so strict.
The scripting crowd instantly groks our tooling, and the functional-ish things, but struggles with the low-level.
So really, everyone has a different definition of what "complex" is, because it's based on what you're familiar with. Some people find map to be more complex than for, some people think the exact opposite.
All generalizations are false.
I believe this sentence is a paradox.
It's close enough to true to be useful, but it's false when you treat the word "all" literally.
Like any type system, there are programs that are valid that cannot be expressed. This can frustrate people when they can see that their program is OK under the current configuration of it, but there's no easy way to represent that as a guarantee. (Same annoyance dynamic-languages users might feel about static typing.)
FWIW, I prefer ML-ish derived languages, am a mediocre C programmer, and Rust seemed easy enough to learn to the point I enjoyed using it.
And actually, borrowing isn't really complicated, just _different_.
And we weren't even using any templates!
Have you used languages with memory safety and no garbage collection before?
I think Rust has no more features than it needs to support its goals, and would be interested to know what features you would like removed.
The type system grows more powerful (and more complex) every time I revisit Rust, it seems.
I'm glad, as an increasingly powerful type system facilitates abstractions that were once painful, slow, unsafe, or impossible, but it is complex.
> The type system grows more powerful (and more complex)
> every time I revisit Rust, it seems.
There have been no additions to the type system since well before 1.0. I'm curious where this perception is arising from.If you don't count lifetimes, Rust's type system isn't really more powerful or complex than, say, that of Swift. There are no dependent types here. There are no type families. There aren't even higher-kinded type parameters.
> The type system grows more powerful (and more complex) every time I revisit Rust, it seems.
What additions are you referring to?