4 ms·
It's funny how he can dismiss Haskell as "hopeless academic idealism" and accuse dynamic language of "intellectual laziness" in one breath. Haskell is different
by tikhonj 13y ago
It's funny how he can dismiss Haskell as "hopeless academic idealism" and accuse dynamic language of "intellectual laziness" in one breath. Haskell is different from most languages, but that doesn't make it hopeless or academic a priori. Saying that is itself intellectually lazy, bordering on intellectually dishonest. But it is a good way to save yourself the effort of learning something new!
Besides this, Scala has way too much Java in it to really be "algebraically elegant" or even simple! Scala is a compromise. It has the legacy of Java compatibility dragging it down. That's one of the main reasons it's caught on, but it's also the reason it isn't actually particularly simple or elegant. It's one of the most complex (but not necessarily difficult) languages in common use.
It is nowhere near as elegant or simple as OCaml or Haskell as they can afford to be much closer to the λ-calculus. Which is also why they can afford such incredible things like tail call elimination and type inference!
Also, while Scala is a multiparadigm language, it is not the best of both worlds. In embracing Java and OO, it throws away many of the advantages of functional programming. In fact, any non-trivial functional programming quickly becomes unbearable. Especially compared to Haskell.
Edward Kmett wrote a nice Reddit post[1] about how Scala falls short from a functional standpoint. This is from an entirely practical commercial standpoint based on his experiences at S&P Capital IQ. Here is what he had to say about functional programming in Scala: "If scala was the only language I had to think in, I'd think functional programming was a bad idea that didn't scale, too." A pretty strong image!
Their story is interesting: they took a Java project to Scala. It was an incredible improvement. Then Scala became a pain on its own, so they designed their own functional language for the JVM[2] and moved to that. It was the same sort of incredible improvement. The same thing that happened to Java happened to Scala!
Ermine, their new programming language, is basically like the core of Haskell adopted to the JVM along with some interesting new features. One thing that really stood out for me is that they have customizable type error messages: they can have type errors that are domain-specific! That by itself probably has a fair amount of value.
[1]: http://www.reddit.com/r/haskell/comments/1pjjy5/odersky_the_trouble_with_types_strange_loop_2013/cd3bgcu http://www.reddit.com/r/haskell/comments/1pjjy5/odersky_the_...
[2]: https://github.com/ermine-language/ermine https://github.com/ermine-language/ermine
- lmm 13y agoI have high hopes for Ermine, but it's not (yet) a real alternative to Scala; it doesn't have anything like the maturity, tool support, or library ecosystem. Which is to be expected - it's barely a year old, whereas Scala has been with us for ten years. Scala is far from perfect, to be sure; even ten years in the future I'd expect/hope there will be a better option, whether that's Ceylon, Fantom, Ermine or something else. But right now Scala is in the sweet spot: it's a huge step up from most popular languages, and at the same time it's mature, popular, and java-compatible enough to be a practical choice for many projects. And as someone who does FP in Scala all the time, I'd be interested to hear what you're talking about with your "pretty strong image". (Also I think Scala's @implicitNotFound covers the interesting cases for customizable type error messages, no?)
- noelwelsh 13y agoI agree with just about everything you've said. In fact I just published this blog post that makes the same point (right at the end) http://underscoreconsulting.com/blog/posts/2014/01/29/unboxed-tagged-angst.html http://underscoreconsulting.com/blog/posts/2014/01/29/unboxe... The reason most people use Scala is because of JVM support and Java interop. Those are exactly the reasons that typeful programming can be a pain in Scala. Multi-arg functions don't compose as easily as curried functions. No TCO. Subtyping breaks extensive type inference. The JVM is Scala's blessing and its curse. I wish more people realised this. It would save us from a lot of frothing-at-the-mouth blog posts, if nothing else.
- orclev 13y agoI also agree with all of that. Scala is an ugly incomplete attempt at replicating Haskell on the JVM that fails at being Haskell, and also fails at being Java, it's the worst of both worlds. On a semi-related note have you taken a look at Ceylon? I found out about the language a few months back and I really like it. It isn't Haskell by any means, but for a JVM based language it's one of the most Haskell-ish feeling languages I've found. The type system in particular reminds me a lot of the Haskell type system.
- eklavya 13y ago