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.
Edward Kmett is a Haskell evangelist (not to mention absurdly productive engineer) so it's natural for him to point out the inconsistencies in Scala, inconsistencies that the average programmer will never even realize exist.
He ends his semi-rant with a concession: there's a lot of good in Scala, and that's absolutely true, there is _so much good_ in Scala that only when you leave it's confines do you realize, shit, I miss:
immutability
lazy vals
case classes
pattern matching
named parameters
implicits
import aliases
partial functions
Option, Either (wish latter was biased)
map/flatMap/fold & collections FP friends
and on and fucking on, how can you not love Scala? o_O
Ok, compile times and IDE support leave something to be desired, but things have improved by leaps and bounds in the past 3 years, and more goodness to come with Scala 2.11 in (hopefully) March.
I 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?)
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.
I don't necessarily agree with everything you said - I don't know enough about Scala to have a good opinion - but I absolutely agree with your first paragraph.
"For sane type-level programming look at latest Scala collections"
Is this a joke? The Scala collections library are terrible. They are inconsistent, hard to reason about, suffer from scope creep, and have terrible performance characteristics.
"Brilliantly simple" is an odd description of Scala. I would easily put Scala in the top 3 most-difficult-languages-for-me to work with. Maybe even top 2.
I had my first experience for Scala last week with doing the Stripe CTF.
I really liked the look of the language and I started trying to develop my solution in it. I knew exactly what I wanted to do, and had a reasonable idea of what to write to get there.
Holly molly, compilation times were absolutely horrible. I tried to persevere but a tiny change would mean 2 minutes waiting for a recompile. In the end I just switched to python where I could develop a solution from scratch (remember, the Scala solution was 90% finished) in no time at all.
Would like to look closer at the language one day but I have better things to do with time than waiting for a machine to churn through code.
Use incremental compilation during development, and keep your files small (this is a good idea anyway). If you're coming at it from a python background were you working in the command line? A lot of the benefits of scala only really apply when using it in an IDE.
> I tried to persevere but a tiny change would mean 2 minutes waiting for a recompile
incremental compilation:
sbt> ~run
in most cases code changes should take one second. Note: SBT sub projects are God's gift to Scala devs (or Mark Harrah's gift at any rate).
You have to get your feet wet in the language, trying something last week for a day or two is not going to result in you flying to the moon on the productivity spaceship of delight.
Programming in Scala 2nd edition is a great intro to the language.
I guess you were having some troubles and asked around in #scala. A huge amount of work in Scala is left for the compiler, all the niceties and features put that load on it. So while it makes life a lot more easier for you it also has more work to do. Anyways compile times have improved significantly in Scala 2.11 but more importantly, incremental compilation has landed.
I've used Scala for a few years now. The blog post doesn't do a particularly good job of selling Scala despite the best intentions. I would encourage anyone who is interested in Scala to spend some time learning the language and using it, rather than worrying about occasional misdirected criticism which the blog seeks to counter.
I've found Scala to be very expressive and well suited to large-scale systems. It takes some effort to learn the language, but once you have put in the effort coding in Scala is a pleasure (esp. compared to Java).
"intellectual laziness of dynamically typed languages"
What a claim! What an absurdity!
Dynamically type checked memory safe languages (eg. Python, Ruby, Javascript, etc...) enable styles of programming impossible in non-dynamically checked languages. So it certainly isn't the users who are being "intellectually lazy." Nor are the creators, who have focused on productivity and usability instead of waiting for proof systems (static type checkers) to catch up with their ideas. Laziness doesn't factor in on either side.
It would be nice to have more substantive criticisms. While I dislike SBT[1], scalaz and spray are a large part of why I enjoy scala so much. While akka was so difficult to use that it almost soured me on the whole thing, and shapeless' monstrous compile times made it practically unusable. So don't think this post represents some kind of consensus.
[1] The notion of configuring your build tool in a full programming language is alluring but ultimately a bad idea IMO; builds should be simpler and more declarative than that.
Agreed, I would like to hear more specifics on why spray was so maligned.
Scalaz is a library that I wish I grokked better, but in all I think it has hurt as much readability as it ever hoped to help. That is, learning the concepts I fully want to do. Using the opaque names, not so much. I'd rather have that level of understanding on my target domain, not category theory. (Were I only smart enough to do both...)
I also agree regarding Akka. I want to like it, but I also feel it purposefully makes things complicated. It was hilarious to read the quote from Torvalds saying that "distributed algorithms are really hard" in context of why microkernels are hard to do, and then see Akka basically say that they make it so that all algorithms are written in a distributed way. Or sad. Not sure which.
I know that I'm in the vast minority, but I don't see what people find difficult about SBT. For the most part, it seems to keep itself out of the way. I would say I've found it only slightly more cumbersome than Rake, and a breath of fresh air when compared to the JVM alternatives (although I haven't had first-hand experience with Leiningen).
The world was different when those languages were designed; type theory was not as mature as it is today. IMO if you're designing a new language today and not giving it a real type system, yes, that's intellectually lazy.
As for using them... eh. My subjective view is that scala is much better than all those languages, outside certain small domains. But that's not exactly objective fact. I will say that if you don't know scala then you're being intellectually lazy - even compared to ocaml, it's different enough to be worth knowing, and it's a language you'll learn something from, whether you ultimately find yourself using it or not.
All one has to do to avoid intellectual laziness as a programmer, is to have enough curiosity to constantly re-establish how much one doesn't know. The surprising part is that it might take 10 years to approach an accurate answer.
Also, as you probably know, it's possible to program static typed projects in a Lisp.
Yes, and this is a feature not a bug. As Larry Wall observed, three cardinal virtues of a good programmer are laziness, impatience and hubris. Laziness is important because I have more things on my to-do list than hours in my lifespan, and more things I need to know than neurons in my brain. I didn't choose Python only or even primarily because it's dynamically typed, but nonetheless, every thought I don't have to think about static types is a thought I can instead think about something I actually care about.
Ultimately, every language is simply a tool and they all have their issues. I'll admit that I pegged Scala as "C++ for JVM" when it first came out, but am not a hard headed man.
Q to the op is what is the turn over of your dev team? Please provide a defense of Scala in terms of economics of development (from a business pov). Items to address are maintaining the codebase after the whiz kids have left for more exciting pastures.
"The biggest issue with Scala’s perception is the deeply varying quality of frameworks and tools that significantly affect one’s perception of the Scala language itself"
That's a pretty terrible defense of scala. Sounds more like a "I hate some random scala projects for made up reasons". How does scalaz have "colossal snobbism" exactly? Because it contains stuff you haven't learned?
Agreed, doesn't paint Scala in a good light despite claiming to defend it.
As for Scalaz elitism, the canonical example would be the T-hole himself, _ Morris (who has more or less been expelled from the main Scala user groups). I think the general POV the OP is trying to convey is that Scalaz is an incomprehensible cluster fuck of symbols to everyone but those in the know; in other words, the learning curve is steep and historically the response to beginner questions has been something along the lines of, "go read this paper" a la Haskell.
SBT suffers a similar problem but that's, IMO, more due to lack of IDE support for the project/ build than anything else (i.e. it's difficult to discover [for me] the library without being able to click through method calls and experientially explore the code [Scala docs only get me so far]).
In other news the last milestone of Scala 2.11 was just released; 2014 should be a good year for Scala on many fronts (faster compilations and improved IDE support particularly)
[+] [-] tikhonj|12 years ago|reply
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_...
[2]: https://github.com/ermine-language/ermine
[+] [-] virtualwhys|12 years ago|reply
He ends his semi-rant with a concession: there's a lot of good in Scala, and that's absolutely true, there is _so much good_ in Scala that only when you leave it's confines do you realize, shit, I miss:
and on and fucking on, how can you not love Scala? o_OOk, compile times and IDE support leave something to be desired, but things have improved by leaps and bounds in the past 3 years, and more goodness to come with Scala 2.11 in (hopefully) March.
[+] [-] lmm|12 years ago|reply
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|12 years ago|reply
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.
[+] [-] scott_s|12 years ago|reply
[+] [-] kasey_junk|12 years ago|reply
Is this a joke? The Scala collections library are terrible. They are inconsistent, hard to reason about, suffer from scope creep, and have terrible performance characteristics.
[+] [-] octo_t|12 years ago|reply
[+] [-] NigelTufnel|12 years ago|reply
[+] [-] btd|12 years ago|reply
[+] [-] aidos|12 years ago|reply
I really liked the look of the language and I started trying to develop my solution in it. I knew exactly what I wanted to do, and had a reasonable idea of what to write to get there.
Holly molly, compilation times were absolutely horrible. I tried to persevere but a tiny change would mean 2 minutes waiting for a recompile. In the end I just switched to python where I could develop a solution from scratch (remember, the Scala solution was 90% finished) in no time at all.
Would like to look closer at the language one day but I have better things to do with time than waiting for a machine to churn through code.
[+] [-] lmm|12 years ago|reply
[+] [-] virtualwhys|12 years ago|reply
incremental compilation: sbt> ~run
in most cases code changes should take one second. Note: SBT sub projects are God's gift to Scala devs (or Mark Harrah's gift at any rate).
You have to get your feet wet in the language, trying something last week for a day or two is not going to result in you flying to the moon on the productivity spaceship of delight.
Programming in Scala 2nd edition is a great intro to the language.
[+] [-] eklavya|12 years ago|reply
[+] [-] thescrewdriver|12 years ago|reply
I've found Scala to be very expressive and well suited to large-scale systems. It takes some effort to learn the language, but once you have put in the effort coding in Scala is a pleasure (esp. compared to Java).
[+] [-] timtadh|12 years ago|reply
What a claim! What an absurdity!
Dynamically type checked memory safe languages (eg. Python, Ruby, Javascript, etc...) enable styles of programming impossible in non-dynamically checked languages. So it certainly isn't the users who are being "intellectually lazy." Nor are the creators, who have focused on productivity and usability instead of waiting for proof systems (static type checkers) to catch up with their ideas. Laziness doesn't factor in on either side.
[+] [-] ionforce|12 years ago|reply
[+] [-] lmm|12 years ago|reply
[1] The notion of configuring your build tool in a full programming language is alluring but ultimately a bad idea IMO; builds should be simpler and more declarative than that.
[+] [-] taeric|12 years ago|reply
Scalaz is a library that I wish I grokked better, but in all I think it has hurt as much readability as it ever hoped to help. That is, learning the concepts I fully want to do. Using the opaque names, not so much. I'd rather have that level of understanding on my target domain, not category theory. (Were I only smart enough to do both...)
I also agree regarding Akka. I want to like it, but I also feel it purposefully makes things complicated. It was hilarious to read the quote from Torvalds saying that "distributed algorithms are really hard" in context of why microkernels are hard to do, and then see Akka basically say that they make it so that all algorithms are written in a distributed way. Or sad. Not sure which.
[+] [-] JackFr|12 years ago|reply
[+] [-] benburton|12 years ago|reply
[+] [-] timclark|12 years ago|reply
[+] [-] ojbyrne|12 years ago|reply
[+] [-] ionforce|12 years ago|reply
[+] [-] binarymax|12 years ago|reply
Ouch. So if I choose to use python, ruby, javascript, lisp, - I am 'intellectually lazy'?
[+] [-] lmm|12 years ago|reply
As for using them... eh. My subjective view is that scala is much better than all those languages, outside certain small domains. But that's not exactly objective fact. I will say that if you don't know scala then you're being intellectually lazy - even compared to ocaml, it's different enough to be worth knowing, and it's a language you'll learn something from, whether you ultimately find yourself using it or not.
[+] [-] stcredzero|12 years ago|reply
Also, as you probably know, it's possible to program static typed projects in a Lisp.
[+] [-] rwallace|12 years ago|reply
[+] [-] eternalban|12 years ago|reply
Q to the op is what is the turn over of your dev team? Please provide a defense of Scala in terms of economics of development (from a business pov). Items to address are maintaining the codebase after the whiz kids have left for more exciting pastures.
[+] [-] frowaway001|12 years ago|reply
[+] [-] porlw|12 years ago|reply
I've seen the same thing said about Common Lisp.
[+] [-] rch|12 years ago|reply
[+] [-] saryant|12 years ago|reply
[+] [-] asdasf|12 years ago|reply
[+] [-] virtualwhys|12 years ago|reply
As for Scalaz elitism, the canonical example would be the T-hole himself, _ Morris (who has more or less been expelled from the main Scala user groups). I think the general POV the OP is trying to convey is that Scalaz is an incomprehensible cluster fuck of symbols to everyone but those in the know; in other words, the learning curve is steep and historically the response to beginner questions has been something along the lines of, "go read this paper" a la Haskell.
SBT suffers a similar problem but that's, IMO, more due to lack of IDE support for the project/ build than anything else (i.e. it's difficult to discover [for me] the library without being able to click through method calls and experientially explore the code [Scala docs only get me so far]).
In other news the last milestone of Scala 2.11 was just released; 2014 should be a good year for Scala on many fronts (faster compilations and improved IDE support particularly)
[+] [-] octo_t|12 years ago|reply