Appreciate the pragmatism =)
Appreciate the pragmatism =)
I personally want to see examples of real Rust code that has a problem that this solves. I get monads, I like monads in Haskell, but I'm unconvinced that the additional complexity is worth it in Rust.
There was functional extremism in Tony Morris and his scalaz pet project, but Scala was already doomed.
Of course, these are all things Rust has seemed to avoid and hopefully continues to avoid.
Was? Last I heard, Dotty is ongoing and will transition into Scala 3.
I like to think of Scala as the C++ of the JVM world. It's a complex language with a lot of features, but it can be extremely powerful if you know what idioms to use and where to use them. For example, template abuse in C++ is akin to implicit abuse in Scala.
Maybe this is something that helped grow Go's popularity by being simpler ? (I don't know, just wondering)
But, on the other hand, a balance has to be found if Rust ever want to be widely adopted. Let's be honest 2s here, Rust is already hard enough to learn for the average developer, adding higher order function on top of that will not help adoption.
IMHO, right now Rust the just enough amount of complexity to still be interesting to the majority. It really depends on who Rust want to target in the long run.
Making things compact and focused helps. Of mixed-approach languages, I see Kotlin's approach to integrating FP as more successful.
I think it is a matter of choice of audience. If you want pure functional languages, there are plenty that will rock your boat (Haskell, OCaml ...).
But, to my mind, I see Rust as a somewhat "modernised" C/C++ with, like Python, the most interesting and accessible parts of FP backed in. It is a balance and it is fragile. So, as I said, I hope that Rust will keep that fine line.
All that said, it only is my opinion, I might be wrong and the wider audience might be ready for "harder" FP. But I doubt it.
With C++, I can't say the same is true. Some libraries try to alleviate that, of course.
The influence of "FP" on rust is really more like the influence of Haskell's type system. Rust is pretty far from a functional language but it does share a lot of type system features with Haskell: type classes, sum and product types, HM type inference
Haskell and Rust are different enough that this is definitely a concern. Lazy evaluation and GC used throughout, vs. eager evaluation in a language which uses affine typing and regions to avoid GC... I can see how general monads might not work very well, and the OP does touch on this a little bit.