I'm not quite willing to dismiss Rust merely for being hard to learn, but after poking around in both Go and Rust for a few weeks, I feel like I could build a project in Go (slowly, and with a lot of googling), but I don't feel like I could build anything in Rust without a lot more learning.
Rust has the same problem as C++ (to a lesser degree; maybe it'd be more fair to compare it to Java), in that if you're a casual coder who dips into a bunch of different projects in a bunch of different languages without ever really specializing, it can be overwhelming. Go is much more readily accessible; partly because it is less ambitious, and partly due to philosophical differences. I can read most Go code, today, having only worked through "A Tour of Go" on the website; I can't even begin to read Rust code after similar time/effort invested.
So, yeah, Rust really is hard. It may be necessary complexity to solve the problems they wish to solve. But, it means I'm unlikely to ever have the time to invest to make it a part of my toolbox, unless it becomes my primary job; whereas I'm already almost there with Go. I'll probably build something real in Go within the next month or two. It can be something I do for fun, in my spare time, and I can expect to get useful results.
I want to like Rust. I'm just finding it hard to get to know Rust.
I wouldn't worry about trying to learn enough about Rust to be able to develop something in it before you try. It is an extremely difficult language to learn. I tried reading over the section in the book about ownership and borrowing a few times and just didn't get it. For me and the other rust developers I've worked with, the best way is to just dive in, fight the checker and eventually it will make sense.
For me I feel like it took time but I've formed a good intuition and understand of the rules, but I would have a very difficult time formalizing a description.
I feel this conversation will be slightly different in 2018. The Rust team set their goals and vision for 2017[1][2] and the theme of the year is largely "ease of use."
I'll quote some of the proposed vision statement here:
# Rust should have a lower learning curve
Rust unique features make it valuable, but also means there's a lot to learn.
A common refrain is "the first couple of weeks are tough, but it's oh so
worth it." How many people are bouncing off of Rust before they get through
those first couple of weeks? How many team leads are reluctant to introduce
Rust because of the training needed? 1 in 4 survey respondents mentioned the
learning curve.
Some potential avenues: improved docs/training materials; improved compiler
errors; language improvements (e.g. things like non-lexical lifetimes).
# Rust should have basic IDE support
For many people—even whole organizations—IDEs are an essential part of the
programming workflow. In the survey, 1 in 4 respondents mentioned requiring
IDE support before using Rust seriously. Tools like Racer and the IntelliJ
Rust plugin have made great progress this year, but compiler integration has
yet to get off the ground, and there's a lot of room to do more.
# Rust's community should provide mentoring at all levels
The Rust community is awesome, in large part because of how welcoming it is.
But we could do a lot more to help grow people into roles in the project,
including pulling together important work items at all level of expertise to
direct people to, providing mentoring, and having a clearer on-ramp to the
various official Rust teams. Outreach and mentoring is also one of the best
avenues for increasing diversity in the project, which, as the survey
demonstrates, has a lot of room for improvement.
Rust's community should provide mentoring at all levels
This was an issue as I learned. With widely popular languages, googling a simple question like "reverse a list javascript" or "sum an array php" comes up with a hundred different suggestions and discussions.
With Rust, most of the discussion is very low level, often by people working on Rust itself and usually the rare answer you find is terribly out of date.
Just having a more stable language so answers don't become obsolete is a big step, but it will still take time for those very basic questions to get answered.
I've found the Rust community on Reddit to be very helpful. Every one of my questions, from borrow checker errors to compiler internals, has been answered within a day.
Are those real example questions? Cause I stackoverflow program a fair share, but those seem a little bit low level for any language, and if you google those for Rust, I end up with the docs for Vec and Iterator, which contain exactly the reverse and sum methods. And this isn't some case of "fuck you read the entire docs", the methods contain extensive built in examples (copypasted from their respective method docs):
let mut v = [1, 2, 3];
v.reverse();
assert!(v == [3, 2, 1]);
let a = [1, 2, 3];
let sum: i32 = a.iter().sum();
assert_eq!(sum, 6);
I'm not saying everything is simple, and there are hard parts of rust to learn. But as far as solving simple problems, I haven't ever had an easier time then with Rust.
No, they were just off the top of my head, not to be taken literally.
And the docs aren't organized as a tutorial. If I don't know what a method or type does, or even that it exists, I'm not going to know to look there for examples.
Ok fair enough. Those two examples though are specifically not good examples, and its hard to improve documentation without specific examples of what is missing.
> I'm not quite willing to dismiss Rust merely for being hard to learn, but after poking around in both Go and Rust for a few weeks, I feel like I could build a project in Go (slowly, and with a lot of googling), but I don't feel like I could build anything in Rust without a lot more learning.
I can totally relate to this: I spent almost a year reading blog posts about Rust or comments on /r/rust, between the first time I read the Rust book and the time I fell confident enough to write m'y first Rust software (a cli tool).
In the meantime I learned Go in three days and I was able to work with it.
Why did I continued to learn Rust your may ask ?
Comming from web languages, learning Rust was a pilgrimage. I learned so much about low level computer sciences: what is memory locality, what's a data race, how does a memory allocator work, what is inlining, etc. It was definetly worth the time I spend on it.
And now that I'm proefficient with both Rust and Go, I can tell I prefer Rust by a large margin. Rust is a really well designed language, with a really nice community and a decision process designed to improve the language with feature real people need. Whereas Go is a monolyth controlled by its creators built around the dogma of symplicity at all cost, and they usually reject users proposal for improvements.
Besides the politics, Rust is way more expressive and going back to Go is always boring because of the boilerplate. It's also way easier to shoot yourself in the foot in Go than in Rust, by ignoring error, misusing a shared variable (forgetting to use a lock, or using it improperly) or dereferencing a null pointer.
In short IMHO Rust is more difficult to learn than Go, but you learn more and when mastered, the language is more helpful.
To all of you strugling learning Rust: carry on, it's worth it ! And also, don't wait and go on #rust-beginners [1] on IRC[2], it's really helpful.
Rust has the same problem as C++ (to a lesser degree; maybe it'd be more fair to compare it to Java), in that if you're a casual coder who dips into a bunch of different projects in a bunch of different languages without ever really specializing, it can be overwhelming. Go is much more readily accessible; partly because it is less ambitious, and partly due to philosophical differences. I can read most Go code, today, having only worked through "A Tour of Go" on the website; I can't even begin to read Rust code after similar time/effort invested.
So, yeah, Rust really is hard. It may be necessary complexity to solve the problems they wish to solve. But, it means I'm unlikely to ever have the time to invest to make it a part of my toolbox, unless it becomes my primary job; whereas I'm already almost there with Go. I'll probably build something real in Go within the next month or two. It can be something I do for fun, in my spare time, and I can expect to get useful results.
I want to like Rust. I'm just finding it hard to get to know Rust.