5 ms·
> I wish there was a good ML-style language for the JVM. Scala?
by fnl 10y ago
> I wish there was a good ML-style language for the JVM.
Scala?
- elcapitan 10y agoML?
- fnl 10y agohttps://en.wikipedia.org/wiki/Scala_(programming_language) https://en.wikipedia.org/wiki/Scala_(programming_language) (first paragraphs and "influenced by") https://www.quora.com/What-are-the-influences-of-the-ML-language-on-Scala https://www.quora.com/What-are-the-influences-of-the-ML-lang... ...
- elcapitan 10y agoOk, yeah, influenced. Javascript could also be called a LISP with C-Syntax, but that wouldn't make it a LISP. But I get what you mean.
- fnl 10y agoYou should compare the actual syntax and constructs. I agree that JS and LISP certainly are as far apart as anything else, and Python is as "functional" as any other imperative language. But Scala indeed is very similar to (1) OCaml and then (2) ML, and last, (3) Haskell in terms of type inference, syntax, and many other FP concepts [1]. [1] http://www.appservgrid.com/hyper/hyp/ml http://www.appservgrid.com/hyper/hyp/ml
- elcapitan 10y agoFair enough, thanks for the pointer :)
- drivebyops 10y agoScala is Hindley-Milner?
- fnl 10y agohttp://www.scala-lang.org/old/node/4654 http://www.scala-lang.org/old/node/4654 (Short answer: No, because it has [to support] subtypes.)
- hugofirth 10y agoThis! Don't be fooled by the prevalence of Haskell-like libraries and patterns in the Scala community (or a vocal subset). Those are absolutely useful but you're free to use them or not, and if you want to just write ML style functional code then Scala is great for that too. There is actually a really interesting (to me) discussion going on about where Scala sits on the Intersection of Java,ML & Haskell going on in the r/Scala subreddit at the moment: https://www.reddit.com/r/scala/comments/5sv1w5/the_divergence_of_strongly_typed_programming/ https://www.reddit.com/r/scala/comments/5sv1w5/the_divergenc...
- JimmyM 10y agoSo, I just started learning Haskell and I learned a bit of Standard ML in the past. I was/am expecting Haskell to be broadly similar to ML - what's the main way the two languages differ? edit: never mind, from the reddit discussion you linked: > while these languages are undoubtedly strongly typed, they are not referentially transparent by default, and actually embrace some levels of imperative programming. Good read, thanks!