Scala, Lift and being cussed

I'm back after three long weeks full of personal stuff mixed with work which had left me no time for sleep, let alone blogging. Now that I have a little more time, I'm figuring on devoting an hour a day to learning Scala. Quoting from the website:
Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java.

I've spent some time trying out some of the examples in the Scala tutorials and I like what I see. It's a pure OO language with none of the ugliness we see in Java. It supports the functional style of development. It's statically typed, but supports type inference, so for the obvious cases you don't have to declare variable types.

Why Scala? Well, first, it has a neat Actor library which looks very promising and rather Erlangy (I believe studying and understanding concurrency is important). Second is that it targets the Java JVM, and older versions used to also target the .Net CLR and (so I hear) will do so again in the future. It of course allows interop with existing JVM/CLR libraries. And most importantly, it isn't Erlang.

I'm not saying I have anything against Erlang, but since everyone is going on about Erlang and Yaws and Erlyweb and what have you (interesting discussion here), I'm going to be cussed and pick something else to learn.

Incidentally, the other contender in my 'language to learn this year' contest was Io, which some of my colleagues are already quite fond of (it surfaces on the internal ThoughtWorks developer mailing lists every few months). Io is a pure OO language with Actor based concurrency support, but it uses a prototype-based object model similar to that in Javascript. Understanding one new programming style (using Actors) is going to be hard enough for me with throwing that into the mix.

I'm trying to get beyond the 'Hello World!' stage with Scala by using lift, a fairly young web framework which is supposed to integrate the best features of all the existing frameworks including stuff like support for comet. This is pretty much how I got started with Ruby - I started with Rails and learned Ruby syntax and usage by looking at Rails code. Since this has worked once, I'm hoping it'll work again.

The initial stages of learning a new language always annoy me, when I look at some code and can't understand the syntax (Ruby used to drive up the wall), I don't know where to look for a solution if I have a problem and most importantly, my development environment isn't all figured out. I'm running into some of that already because my initial attempts to compile lift have failed - the Scala compiler ran out of heap space. Nothing to be found online on this. A quick look at the maven build scripts (and I'm not familiar with maven either) reveals the following
1524 MB! Yipe! Not that my laptop can't manage that, but still, 1.5 Gigs? Looks like I'll be spending some time on the lift mailing lists.

Let's see how this works out - I'll post updates whenever something interesting surfaces.
Post a Comment