4 ms·
>"we figured out how to relax type checks to allow this safe program to compile that was previously failing to past muster with the borrow checker" While perha
by foerbert 6y ago
>"we figured out how to relax type checks to allow this safe program to compile that was previously failing to past muster with the borrow checker"
While perhaps not a large change in practice, this seems like the sort of thing that incurs a large cost when it comes to updating your mental model of how the compiler works, what it can and cannot do, and what options you have when it comes to implementing something.
- silveraxe93 6y agohttps://xkcd.com/1172/ https://xkcd.com/1172/
- pdpi 6y agoThe reaction to seeing code using these changes is "oh neat that works now". Every time I see changes like this in the change log, it actually simplifies my mental model, because the rules are the same but there are fewer exceptions.
- a_humean 6y agoI would suggest it does the exact opposite. Allowing more safe programs to compile if anything simplifies your mental model.
- foerbert 6y agoThe end result is a simpler model. The process of simplifying your model may not be cheap. It's like how you can get some weird set of complex rules and after a bit of time and practice you can just apply them without thinking much about it. However if you suddenly change those rules - even to make them simpler - you'll have to spend awhile readjusting. It doesn't make the changes bad, but it might explain why people trying to keep up with Rust feel it's changing more significantly than it actually is.
- mleonhard 6y agoMy experience learning and using Rust over the last 9 months has included a lot of repeats of this: 1. Write some code that does something tricky with borrowed types 2. It won't compile. Search online for the error message. Find the Rust github issue about adding support for doing things that way. 3. Try to find or think up a different way to write the code. Go to 1. GP is referring to changes that make compilation succeed at step 1. These changes will save newbs from many hours of frustration. The cost of these changes is minimal. Actually they free up a lot of mental capacity currently used for workarounds. I'm really happy with Rust and the steady progress made by the core team. Rust stable is really excellent to work with.
- foerbert 6y agoI understand that. And I still think these changes might be particularly expensive ones. Trying to keep track of what workarounds you do and do not need to use is hard. Removing workarounds is good, but still an expensive step. Applying a large set of rules can be quite easy after an adaptation period, but changing those rules remains hard. Even if the new rules are simpler. I'm not saying Rust shouldn't be making these changes. I'm just saying I think this might be part of the reason why you hear comments about how hard it is to keep up with Rust.
- mcherm 6y ago> this seems like the sort of thing that incurs a large cost when it comes to updating your mental model of how the compiler works Why? If you simply do NOT update your model won't that work just fine? You would continue to avoid certain constructs that used to bother the borrow checker; your code would work fine, and the compiler wouldn't complain exactly as it used to.
- foerbert 6y agoI agree you don't strictly need to update your mental model, but that doesn't make the update itself less expensive. I'd guess most people using Rust and checking the changelogs are people who are interested in keeping up with Rust. They are likely to update their mental model because they wish to. And as a result, they often have to deal with these 'expensive' updates which makes it feel like it is difficult to keep up with Rust.