3 ms·
Oh, I'd love if that were true. But in my limited experience with Rust it was still the borrow checker that absolutely made writing in the language hard. That w
by onli 9y ago
Oh, I'd love if that were true. But in my limited experience with Rust it was still the borrow checker that absolutely made writing in the language hard. That was in 2017. My mental model of what should be safe was not at all the model the borrow checker had. And I really read the documentation about that part of the language.
I guess a confirmation that there were problems there is that they tried to improve the borrow checker in the releases after that.
- majewsky 9y agoI started working with Rust last month, and wrote about 2000 LOC since then. While I had my fair share of errors coming from the borrow checker, I've always found its complaints to be valid and easily resolved. Except for that one time where I tried to shuffle data between different threads and shouted at the borrow checker for two hours, until I realized that the borrow checker was actually right and what I tried to do was literally impossible without data races.
- smaddox 9y agoWere you writing functions/procedures under the implicit assumption that they would be executed under a single threaded context? Because Rust does not allow this assumption without using "unsafe". I've run into this before, and it can be a bit irritating, but if there's even a small chance you'll later want to execute the code in a multithreaded context, it will more than pay for the inconvenience. And if you're sure you won't, then you can just throw the data into an UnsafeCell and call it a day.
- steveklabnik 9y agoIt's not even inherently about multi-threading https://manishearth.github.io/blog/2015/05/17/the-problem-with-shared-mutability/ https://manishearth.github.io/blog/2015/05/17/the-problem-wi...