It may be stating the obvious, but if you based your ideas of the difficulties of Rust on the topics discussed in this forum, I think it would be very misleading.
Obviously people tend to post here when they are stuck on something, and it is often incomprehensible to me what the problem is, or what the solution is. Nevertheless, I still have no problems whatsoever writing programs in Rust, despite my apparent lack of knowledge.
Would you agree? I thought perhaps it was worth pointing out for any newcomers to the language browsing this forum. Don't be put off!
I agree. It took me a while to get comfortable with Rust and stop trying to shoehorn OO patterns into it. After that, I settled into a style which suits me and seems to work fairly well.
I read the forum to see the things people get stuck on and the generally very insightful replies. Sometimes the level of the responses are over my head on topics I haven't touched much: FFI, async and macros. But generally I follow and I think it helps with my own work.
Strangely enough this kind of thought passed through my mind today. I'm checking this forum for interesting tidbits everyday, but I realised that most of the time I have no idea what the problem is the poster is having and worse I have no idea what the solutions do! More to the point I really don't have the time to carefully unravel what the conversation is about, I have code to write!
So the thought is: God help the beginner hoping to be enlightened here.
Meanwhile, over my year or so of Rust use I have managed to get what I wanted done in ways that I am very happy with.
On the other hand. When I have become stuck in Rust I have asked about it here and quickly got very helpful advice in response and had some interesting discussions about alternative solutions.
So yeah, don't be put off by discussions here. But do ask when you get stuck.
I find that the questions here fall into one of three categories: questions I could answer (but usually someone else has already done so), questions I cannot answer and questions that are answered by the compiler’s error message but the poster pasted the error message without reading it. Sometimes the compiler even says exactly what should be changed to make it work. Either way, the group of active experts here are generally very patient.
Between the compiler’s error messages, The Book and The Reference I find that my favorite thing about Rust is how easy it is to answer my questions with what is already written. It’s comforting to know that this forum is here if I need it, but it really is a place best suited for questions about the deepest low-level details of the language that only come up in the rarest cases.
It's kind of hilarious when you're in the helping mood and you log on to these forums to see if you can help any "n00bs" and someone posts a "I'm new to Rust, and I don't understand how to frobnicate the quantum flux capacitor", and you're sitting there just scratching your head, and then you see some of the old dinosaurs reply "Oh, it's easy, just fribble the brobble twice!" and the OP replies "Hey thanks, that was easy!".
I'll just keep trudging away at my projects, and one day I'll suddenly realize I've become a dinosaur too. But until that happens, I'm going to keep logging on here and getting a kick out of being incredibly confused all the time.
But seriously though, these forums are really fantastic -- they have a mix of practical problem solving and theoretical discussions about and around Rust. It's just that, as you say, one should be aware that one don't need to understand all the difficult topics to be productive in Rust.
Yes, I'd totally agree. Many topics discussed here are quite advanced and you won't usually need them during everyday programming. Seeing these topics could make Rust appear more complex than it really is.
I feel the same: Many code snippets and errors people struggle with are (often) incomprehensible to me as well. Yet I can get along with Rust well in most cases.
I would agree with what you wrote, but I still believe that Rust is difficult to learn. On the one hand side, I don't want to discourage anyone from learning it (it was worth the effort for me). But I also don't want to give the impression that Rust is an easy language to learn. At least for me, it was hard to learn (not as hard as some topics on this forum might suggest though).
Personally, I like the wide range of topics discussed:
newbie questions (reading them or also replying to them helps me to reflect about certain languages aspects that I sometimes forget),
assistance with particular errors in projects,
theoretical considerations / abstract ideas,
"which crate to use" questions (my personal favorite, as I often feel lost when I have to select one),
comments on / questions about the APIs of libraries,
discussions on how to idiomatically implement certain tasks,
Just because some discussions are really crazy / technically deep, it doesn't mean that everything about Rust is that crazy .
Top Left indicating this is URLO (users.rust-lang.org)
Reading left to right,
New user in truck: "Hello I have Rust dump truck, how to dump trash?"
Person with trident and crown standing at a keyboard: "Your trash compaction algorithm is inefficient"
Person in an oversized witch outfit using magic standing on a very fast giant flying muffin: "I transmute trash directly into atoms using unsafe nightly"
New user again: "Compiler says engine is on fire"
Witch person again maybe?: "In other languages, your engine may catch fire randomly. Rust makes you deal with this explicitly by triggering it immediately"
Just to clarify: Rust is not as hard to understand as the jokes discussed here!
Even in this topic, dark arts such as Transmutation showed up. Rust isn't all that complex when you stick to safe Rust, and you won't need to understand quantum physics either to master Rust (I hope ).
As an extension of the feeling I have, I believe there is a long list of things you generally do not need to know ( until you do... of course ). When these come up, I do want to understand, and I have some vague inkling of what they are about, but I mostly cannot follow the discussion properly. Such as
[ Plus a lot more.... ]
There is some "easy subset" of Rust that I actually use to write programs that does not involve knowing about any of the above.
Variance: definitely relevant, but only if you use unsafe rust
unsafe: not needed unless you want to improve performance, implement self-referential structs yourself (avoiding Arc/Rc), or use a foreign function interface (e.g. call functions written in the language "C")
Writing macros: can be helpful, but entirely optional in most cases
Workspaces: had to look it up to see what it is
FFI: not needed if you can rely on Rust libraries and don't need to write your own interfaces to non-Rust libraries or provide an API for code written in other languages than Rust
PhantomData: I think this is also only needed when you do unsafe, right?
So I mostly agree, except on when you want/need to use unsafe. That's when things get really tricky and you do need to care about some of these things. (But I doubt most people really need unsafe.)
That's certainly the goal. (Well, outside FFI where it's often unavoidable.)
And when people do need it, it's almost always better to write a little crate with a safe interface to encapsulate the soundness logic. That way it's easier to review, and lets more people benefit.
That's also why I'm excited for things like [T]::as_chunks (and soon as_simd) -- that's not a complicated bit of unsafe code, but having it available in a safe interface makes so many things that little bit easier and less error-prone.
A couple weeks ago I logged in and saw a cake next to my post, and it was only then that I realised I've been using Rust for 5 years
Over time it definitely feels like the average "difficulty" level of the posts on this forum has risen, and I can think of a couple contributing factors:
A lot of the "old dinosaurs" have seen all the simple questions newbies will encounter and already know what to respond with, meaning the newbie questions tend to only get a handful of comments before quickly fading into obscurity
Rust has gained a lot in popularity, meaning there are now a lot more resources for learning, existing resources are much better, and you have more peers to talk to
the u.rl.o community as a whole have matured and spent more time writing Rust (e.g. average number of years with Rust increased), and as you gain experience you move past simpler things and onto deeper, more subtle topics
people like to nerd out and go down rabbit holes, and advanced topics like unsafe give you a lot more material to work with
Oh absolutely! You can 100% spend months writing Rust without needing to learn about macros, monads (the umbrella that Result, Option, Iterator, and Future fall under when you do method chaining), or generics more complex than "I have this trait with a couple methods".