As an erlang fan, and a jvm critic, a few people have asked me whether or not I have tried the programming language scala which compiles to the jvm and integrates with java. I had not, and was not motivated in spite of their attempts.
Then fuzzy came across scala and asked me the same question last week or so. I gave him the same reply, and felt no more motivation to do so than ever.
But you see, fuzzy is my boss and (moreover?) one of my co-workers and collaborators. This week I went on one of those web-based hunts for something unspecified that lead here and there. This time, almost out of time, and remembering fuzzy's email about scala, "there" led to http://www.scala-lang.org.
OK, playing with scala for just a couple of hours forces me to take back all the crap I have dished out about the futility of the jvm when it comes to erlang-like programming, which I think we all should be doing. (Note: I said we all should be doing erlang *like* programming, not *erlang* programming per se!)
Someone suggested some time ago I should look at scala's actor library. Now I am deeply sorry so much time has passed since I followed that suggestion. Maybe I should have given some credit to the primary author, Martin Odersky, since years ago (nearly ten???) I used his pizza language extension / compiler for java quite a bit.
I am not a terrific fan of ML-like, Haskell-like type-inferencing, etc. languages. OK, but I never got over the curve enough to feel up to my level of ease with the smalltalk/lisp-like approach. Scala is along the lines of ML and Haskell, but that is not really a turn-off for me, more of a "so what".
Like some implementations of Haskell (at least the one I used the most, hugs), scala comes with a read-eval-print loop. That helps me a *lot*. Also scala supports the conventional unix syntax for writing executable scripts. Well, it is a *little* unconventional.
Scala feels pretty good even without its actors library. But actors...
Scala's actors (and remote actors) implement a pretty good chunk of erlang-like processes, process management, and message passing. And the performance on an unmodified jvm is beyond impressive. I guess it makes sense since event-oriented java library implementations have done the same. Scala takes that somewhat clumsy approach (in java) and wraps it up in a much nicer language and a richer erlang-like library.
Nicely done. Nice mix of objects and modern functional programming with pattern matching, etc. Message passing, pattern matching, and scalable "actors" -- that's a good mix for the future.
Scala is fairly new and mature: hopefully more people will take a look at it without hestiating like I did. The lift web framework is another reason to look, although not what I am after at this point.