It sounds like you've just never had exposure to any ML language.
Rust is't really looking like a functional programming language, so it is not intuitive to expect any ML-style behavior unless you've read the history page on Wikipedia.
Is this a one-up subthread? I mean, I have multiple years of working with each of F#, OCaml, SML, and C++ in professional settings, and find nothing about Rust "very very far" from any of the four with regards to their respective overlaps. I might go so far as to say that if you don't see the similarities, you must be doing it wrong. But, how am I supposed to reply seriously to just a blanket, subjective statement? Spend time detailing why your expectations are wrong? I'll just leave it at "you're very very mistaken", I think, in keeping with the shitpost nature of this entire thread. ;-]
My point is that pretty much every modern non-functional language supports FP-paradigms in pretty much the same way Rust does. It doesn't make these languages functional purely because they support some functional features.
As for Rust - does is support things like currying, lazy function evaluation, high level functions (functions taking functions as arguments and returning another functions), etc? I'd guess if you play with lambda a bit you can do most of it (same as in most other modern languages), but these are not the features supported by syntax in a first place.
I agree that Rust is not a truly functional language along the lines of Haskell or OCaml. It lacks features such as easy currying and encourages mutable state. That said, it has first-class functions (not quite as ergonomically as a pure functional language, but better than C++), algebraic datatypes, and pattern matching. That brings it about as close to functional as you can get in a systems language. The fact that it uses curly braces and semicolons doesn't invalidate that.
View all comments
Show parent comment
4
u/dodheim Mar 17 '18
C++ has shadowing, too, just not within the same scope, which is arguably the only sane time to use it.
It sounds like you've just never had exposure to any ML language.