News for hackers. Stuff that matters.
Re:Rust 1.42 by burntsushi on Thursday March 12, 2020 @01:06PM (#22558998)
I'm not sure if it's a simulation so much as the rules just become normal constraints you use when writing code. It is super rare for me these days to write any line of Rust code that makes the borrow checker complain in a way that surprises me. It took me a while to get to that point. I don't remember how long though.
Re:Rust 1.42 by throwlaplace on Thursday March 12, 2020 @01:12PM (#22559087)
any suggestions for exercises that drill this in? I'm going through the linked list book but it's still not completely transparent for me.
Re:Rust 1.42 by burntsushi on Thursday March 12, 2020 @01:14PM (#22559126)
Not really. Pick a project and start building. At least, that's my learning style. Reading things like the linked list book is great, but eventually, you probably have to put it to practice in order to really learn it (like most things).
Re:Rust 1.42 by steveklabnik on Thursday March 12, 2020 @01:29PM (#22559340)
I would like to second everything you've said here, and add a few things:

1. If you are feeling stuck, please reach out on users.rust-lang.org or discord.gg/rust-lang. We're here to help!

2. If you're feeling really stuck, maybe take a break and come back to Rust in a few months. A number of people have given up on Rust in frustration, came back after a significant amount of time, and then said "why did I think that was so hard before?"

3. Don't worry about a few calls to clone when you're getting started; it's better to have a working program that does some extra copying than it is to not have a program at all.

4. Especially when starting out, you almost always want structs to own their data. Don't use references as struct members unless you're absolutely sure that's what you want. Advice #3 helps with this.

5. I think one of the biggest mindsets that can set you up for failure with Rust is "The compiler says no, how do I get it to do what I want anyway" instead of "The compiler says no, what is it telling me, and how can I work with it instead?" Especially if you come from an OO heavy background, you may need to change the patterns that you reach for initially. Yes, you can write any style in any language, but Rust pushes you towards its idioms much more strongly than other languages do.

Re:Rust 1.42 by aganame on Thursday March 12, 2020 @02:40PM (#22560196)
The Rust channels on Matrix and oftc irc are really helpful as well :)

For drills, I recommend exercism.io in practice mode (mentor/student ratio is pretty bad). After working on your own solution for a while, then checking how the others solved it... priceless. Somebody almost always figured out an objectively better solution.

Re:Rust 1.42 by adamch on Thursday March 12, 2020 @02:34PM (#22560125)
+1 to the Rust Discord being _really_ helpful. If you can provide an example on play.rust-lang.org, someone will definitely help you.
Re:Rust 1.42 by CameronNemo on Thursday March 12, 2020 @02:10PM (#22559834)
>discord.gg/rust-lang

Why not plug the rust channel on Matrix?

Re:Rust 1.42 by steveklabnik on Thursday March 12, 2020 @03:27PM (#22560754)
I only plug:

* Things that are run by the project

* Things that I use

I have no idea if the Matrix channel is any good or not, so I cannot recommend it.

Re:Rust 1.42 by CameronNemo on Thursday March 12, 2020 @08:50PM (#22563667)
Fair enough. Hope you do get a chance to check out the Matrix channel! (#rust:mozilla.org)
Re:Rust 1.42 by burntsushi on Thursday March 12, 2020 @01:43PM (#22559512)
Hah yes, this is a MUCH better answer. Thank you. :-)
Re:Rust 1.42 by steveklabnik on Thursday March 12, 2020 @01:49PM (#22559603)
Naw I think you hit the most important bits right up front :)
Re:Rust 1.42 by hechang1997 on Friday March 13, 2020 @10:15PM (#22572603)
I found the "Too Many LinkedList" tutorial is very helpful. Try to follow the tutorial by writing your own code.