26 ms·
There is a Haskell implementation for the JVM if you want a language like F# (it's called Frege). Kotlin has some FP features. You can easily make immutable da
by mike_hearn 11y ago
There is a Haskell implementation for the JVM if you want a language like F# (it's called Frege).
Kotlin has some FP features. You can easily make immutable data classes (one line definitions of struct like things), you have map/filter/reduce/etc with a much more efficient approach than Java 8's streams framework, the compiler knows about tail recursion, there's some basic forms of pattern matching.
I suspect Kotlin will take a breather from new features for a while now to try and stabilise what they've got. But after that, I imagine a few more FP features might materialise.
- mcintyre1994 11y agoSorry, I think I was a bit unclear. I have no doubt the jvm can support a functional language - scala isn't bad and Kotlin looks really nice. My point is more that Java is constrained in how it can compete with functional jvm languages in much the same way c# is against functional clr ones. The linked article explains those limits a lot better than I could :)
- mike_hearn 11y agoAh, I see. Yes I misunderstood you, apologies.
- pron 11y agoAnd there's a very good implementation of OCaml for the JVM: http://www.ocamljava.org/ http://www.ocamljava.org/