Wednesday, 21 March 2012

The Scary Bit of the Scala Experience

Listening to:

Goodbye Pork Pie Hat from Charles Mingus’s Mingus Ah Um

Scala is Wonderful, But

Despite being another of those worrying single-implementation languages (see also: Perl, OCaml and Haskell), Scala may just be a language I could use instead of SML. It certainly has a number of advantages compared to SML. Firstly, and most importantly, it still seems to be under development, and has thereby managed to attract a community of keen users. (In the SML world, only Poly/ML seems to get any development love.)

It also supposedly gets to leverage the big wide world of Java code, which is pretty appealing. I haven’t confirmed that this is actually possible without undue pain, but being able to link against arbitrary other bits of Java would be pretty awesome. After all, there’s a heck of a lot of Java out there (some of which is presumably useful).

Of course, compiling to the JVM means that you get reasonable portability “for free”, but I think it’s more important that it also gives you consistent access to proper concurrency on multi-processor systems.

(I don’t want to suggest other options might not be awesome too. In particular, Haskell is clearly pretty amazing and my limited experience of writing xmonad configuration files has helped me remain impressed by it.)

Scala’s biggest disadvantage seems to be the build system. That whole Java eco-system is a mysterious world to me, but it seems to have thrown away the simplicity of make and replaced it with the horror of sbt (itself built on top of something called maven apparently). I can build stuff with sbt: I type sbt compile and errors get reported, but I dislike having the system be such a black box. I know how make works, and knowing how it works means I can build a good mental model of what is happening when I invoke it. With sbt I might as well be praying to an inscrutable deity.

Perhaps I just have to invest the time in learning its intricacies.