Rust learned a lot from Haskell, and now offers programmers something new that is nonetheless informed by other languages. So now I’m wondering, what can Haskell learn from Rust?
Conversation
Things from someone who is no good at rust:
- Performance matters a lot (Haskell still doesn't have SIMD/vectorization)
- Having an advertised way to get fast feedback from the compiler (should a beginner have to know `ghcid --command "cabal repl -fno-code`)
2
3
- Error messages are undervalued still (no fundamental reason Haskell could not make useful parser error suggestions like rust for example)
- Better agreement around core array types (amongst other things like iterators/streaming) makes the ecosystem seem cleaner.
1
1
There must be something to learn from how the compiler development seems to not lead to as much library churn but that might be a fallacy from me since I don't know rust.
1
1
Rust tries very hard to not break backwards compat – things might break, but an update to a library should be able to work on the old version of the compiler (eg. addding a type annotation or import). Ie. you don't need to conditionally compile based on rustc version.
1
1
Right yeah! I would say the worst of both worlds is having this kind of compiler churn and CPP as the only tool to handle it. Would be great if there was some nicer alternative.
1
Then you also have the issue of not being able to use multiple library versions in the same cabal project, and upper bounds on dependencies, which seems like it just compounds the churn… not saying Rust's approach to versions/dependencies is perfect, but it seems less painful.
While I hugely enjoy the reduced churn when using Rust, I try to temper my enthusiasm because I don’t know how much of the pleasantry is due to it just being younger. We get an inking of familiar trouble with splits like tokio vs async-std.
1


