People should not have to bend their mind to satisfy some tool like the borrow checker, the tool should do the right thing and allow them to express their ideas in code with as little effort as possible.
People should not have to bend their mind to satisfy some tool like the borrow checker, the tool should do the right thing and allow them to express their ideas in code with as little effort as possible.
Erm, have you ever used Rust, and had much experience with C++? Rust's semantics are far clearer, simpler, and well defined than C++'s, and there are orders of magnitude less rules of thumb that you need to learn in order to avoid. If it looks complex, it's because it needs to be in order to adequately express the essential complexity of systems programming. Hopefully we will have languages that do a better and more elegant job in the future, but at the moment Rust is the best we have.
Example? In my experience, those saying this have either never used Rust, or never used C++. A strict compiler does not a complicated language make. To wit, if the response is "lifetimes", note that lifetime tracking is also critically important in C++ (not to mention C), it's just that C++ compilers give one far less help in doing so than Rust does.
But it's not just about a particular example, instead I get a general feeling of inaccessibility when reading Rust code. It's not enough to know C or C++, one has to understand the Rust way. This might seem unfair to complain about, but I didn't have any such issues when learning e.g. Swift or Objective-C, to give an example of non-GC languages.
src/first.rs:1:1: 4:2 error: illegal recursive enum type; wrap the inner value in a box to make it representable [E0072]
src/first.rs:1 pub enum List {
src/first.rs:2 Empty,
src/first.rs:3 Elem(T, List),
src/first.rs:4 }
error: aborting due to previous error
is now error[E0072]: recursive type `List` has infinite size
--> src/main.rs:1:1
|
1 | pub enum List {
| ^^^^^^^^^^^^^ recursive type has infinite size
2 | Empty,
3 | Elem(i32, List),
| ----- recursive without indirection
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `List` representable
Users have reported a lot less frustration after these changes, and we're always trying to make them better. For more on this effort https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-com...You haven't seen template metaprogramming, have you?