That said, dealing the borrow checker is just a skill. You take out a few hours to learn to deal with it, and then you just can. As you said it's super powerful and definitely your ally, so saying its a downside of Rust is silliness.
Because it's more expressive than just forbidding mutability. You could program in Rust the same way you program in Haskell, by encapsulating mutability in functions with different types (&mut). Then the flow sensitivity and other issues would never bother you.
Rust's flow-based control of mutability is strictly more expressive than the monad system of Haskell. If you don't like that expressivity, don't use it.
So far the Rust tricks with unsafe for certain data structures (e.g. double linked lists/DAGs) seem like fighting with the borrow checker. Or the issues to be solved with upcoming 1.3 changes for pattern matching.
That seems like a non-sequitur. What does the borrow checker have to do with actor libraries?
Are you implying that these actor libraries give you the data race freedom guarantees that Rust's mutability rules give you? If so, that's trivially false. Those libraries guide you toward patterns that eliminate data races in simple cases if you follow them, but nothing enforces the rules. Moreover, being forced into actors or message passing for concurrency severely restricts the expressiveness of your program. Rust's approach lets you use shared memory if you like, or message passing if you like, or a combination of the two, with enforcement of the rules no matter which you pick.
> So far the Rust tricks with unsafe for certain data structures (e.g. double linked lists/DAGs) seem like fighting with the borrow checker. Or the issues to be solved with upcoming 1.3 changes for pattern matching.
Yes, they're tough. This is a downside of manual memory management (though one that can be improved in future iterations). But doubly linked lists/tree-like data structures are hard in Haskell too. "Tying the knot" is not exactly easy or intuitive.
No they don't give the freedom, but they give them comfort for the average developers.
I deal a lot with 9-5 enterprise developers that don't even know that HN and Reddit exist, or whatever languages exist out there besides what they use on the job.
Yet they do write multi-threaded code with help of such libraries, happy that someone gives them training wheels.
> But doubly linked lists/tree-like data structures are hard in Haskell too.
True, but laziness helps. However Haskell is hardly a mainstream language.
And they create a lot of bugs in the process. Empirically, a message passing framework does not eliminate data races as a very common class of bug.
> However Haskell is hardly a mainstream language.
Well, you brought up Haskell earlier. I agree of course that both Rust and Haskell make it hard to write doubly-linked lists and trees, and that Haskell is not a common industry language.
As for data races elimination, I don't see people really moving away from those libraries, but I might be wrong.
(Haskell in particular has a much more restrictive borrow checker than that of Rust: purity.)