Also being Rust relatively new, it is much cleaner in many aspects, for example the basic types names.
Compilation error messages are good, unlike gcc's
Another cool thing is all libraries can be found in one place (https://crates.io) and documentation is automatically built at https://docs.rs
I don't use the functional side much, but parsing a file like this felt pretty good
Code: Select all
v.extend(std::fs::read_to_string(filename).unwrap().split('\n').map(|s| s.split(' ').collect::<Vec<&str> >()[0].to_string()).filter(|s| s.len()>=min_len).take(n));
Plus some of the crates provided are really cool, like serde, serializing json (or anything) into a strongly typed struct is very useful.
The only thing I really wish was ready now is a good GUI framework, but I guess I'll have to wait.
As for the pattern matching of types, I had never really seen std::variant, but from a quick glance it looks like a c++ version of unions.
In Rust I guess you would use enums as they can hold stuff inside the elements and can be pattern matched against with match.
idk about pattern matching directly for types, but does it really make sense in a strongly typed language?