3 ms·
I thought this is what would be the case but the reason it is slow for me is not because it takes me a long time to get to compilation. (It’s true but it’s a sm
by bin_bash 4y ago
I thought this is what would be the case but the reason it is slow for me is not because it takes me a long time to get to compilation. (It’s true but it’s a small factor.)
The reason is most things are immutable. Frankly I’m just not used to writing code in that way (even though most of my scripting code is functional and not imperative). I find that when I refactor my Rust it requires significant work.
In mutable code I can just modify a class/struct when something needs to change but when it’s mostly immutable those changes often require significant redesigns.
Perhaps this is just because I’m new to Rust, but that’s just proving my point that it’s hard. I’m better setup to learn a new language than the majority of programmers for sure and it’s been a real struggle.
At this point I would probably be struggling as much in a language like Haskell I suspect. My issue isn’t the borrow checker, it’s immutability.
- zozbot234 4y agoRust only prevents shared mutable data by default. You can always mutate things in a local context (i.e. objects that are either owned or uniquely borrowed) or use the "cell" constructs to opt-in to shared mutable state.
- mcronce 4y ago> You can always mutate things in a local context (i.e. objects that are either owned or uniquely borrowed) You do have to explicitly declare them mutable, though, and will warn you if you have a mutable variable that you never mutate. This is helpful for avoiding surprises.