7 ms·
JVM has a lot of functional languages. As well as the usual Clojure, Scala, etc. I think it has some Haskell-like ones.
by mc3 7y ago
JVM has a lot of functional languages. As well as the usual Clojure, Scala, etc. I think it has some Haskell-like ones.
- desert_boi 7y agoIs there an ML on the JVM? The best part of F# is it felt like a simpler version of Scala, even without things like higher kinded types that are present in OCaml.
- snuxoll 7y agoFrege is a Haskell inspired language on the JVM, about as close as I’ve found.
- tombert 7y agoIt’s not exactly ML, but there is a pretty-ok port of Haskell to the JVM called Eta [0]. [0] https://eta-lang.org/ https://eta-lang.org/
- yen223 7y agoIf you squint very (very) hard, Kotlin can fill that role. You've got algebraic data types via sealed classes, a weaker form of pattern matching via `when` expressions, and decent facilities for higher-order functions.
- soulnothing 7y agoI was going to comment the same thing. I moved from F# to kotlin and have about 80% of what I want / used from F#. With more tools eco system that makes management happy. Arrow adds to that, with it's library and compiler additions. I have also been building type providers in Kotlin. Where a gradle plugin scans a file / schema then generates types and DSLs off of it. It's a pragmatic functional language. The biggest catch to me. Is there are very few places using Kotlin in a fully functional style. On the back end more often than not you'll find Spring. Which undoes a lot of these features / patterns.
- apta 7y agoIncidentally, Java is getting pattern matching that is more capable than Kotlin's (and probably on par with Scala's).
- zelly 7y agoNah there isn't, I looked. There's Scala, but I don't have 5 years lying around to get up to speed on it.
- mycall 7y agoCould F# be ported to JVM?
- juststeve 7y agoJVM has already got clojure, scala and kotlin.
- pjmlp 7y agoNot until JVM supports value types, low level pointer manipulation and reiffed generics.
- zelly 7y ago2 out of 3 of those are coming in Valhalla. You don't need pointers.
- pjmlp 7y agoIf you want to support F# without performance degradation emulating features, I am not so certain.
- adgasf 7y agoIn addition to that, the .NET runtime supports tail calls but the JVM does not, IIRC.
- pjmlp 7y agoYes, JVM still has it under "some day it would be nice". Actually this is one of the bytecodes that .NET Native doesn't handle, if I am not mistaken.
- phillipcarter 7y agoYes, but it wouldn't be F#. F# is so deeply tied to .NET semantics that you'd have a very different language, even if the syntax looked the same.
- tincholio 7y ago> I think it has some Haskell-like ones. Eta might be what you're referring to: https://eta-lang.org/ https://eta-lang.org/ (there's also Frege, but it's less haskell-y)