Monday, January 12, 2009

Scala Considered Interesting

I've been starting to teach myself Scala for a couple of reasons. One is that Programming in Scala is a Jolt finalist; another is that, pursuant to the Pragmatic Programmers' advice, I try to combat brain ossification by picking up a new language (preferably one orthoganal to my current knowledge inventory) every so often; and, finally, like just about everybody else who does sizable computations, we've been coasting on Moore's Law for some time now. That free ride has gone away, but the need for increasing computational power certainly has not.

For example, one of our faculty was talking Thursday about the performance of the PALMS model, a biophysical landscape simulator. Currently they're doing four-hour runs of this 100K SLOC FORTRAN model, but they'd like to run it at 5-meter resolution instead of the current 50, and simultaneously expand the area covered by a factor of 10 -- or more! Clearly parallelism is the only hope unless there are major bottlenecks in the existing code (unlikely, as the scientist maintaining it is a helluva coder). And I have fanged nightmares about the race conditions and deadlocks I'll be battling if I try to do it with nothing but low-level constructs like threads and mutexes.

Another model (RUSLE2) on which a couple of our applications depend has been struggling with threading issues for some time now, and its author is considering functional languages as a way out of that morass. Likewise SnapPlus (one of those apps that uses RUSLE2) is going to be facing these kinds of issues itself, and probably sooner than later.

I'm encouraged by David's experience with Scala -- obviously he's a lot further along than me, but clearly he's getting a lot of bang for his adoption buck!

The idea of clean, uncluttered notation combined with genuinely new functionality, all running on infrastructure which practically defines "carrier-grade" (i.e., the JVM) really appeals to me. I can't wait to start building things.

Coincidentally, also up for a Jolt this season is Demarco et al's Adrenaline Junkies and Template Zombies, which I highly recommend to anyone in the field. Even if you got nothing out of the project patterns these very experienced people have distilled -- unlikely -- you're still going to roar with laughter. One of those patterns is "Lease Your Soul": Don't sell your soul to a technology, committing to it for the rest of your career, hacking projects to fit it, and growing obsolete when it does. Instead, lease your soul, they say. Judiciously select new technologies applicable to what you do, learn and employ them, and ease them out when they're long in the tooth.

Anyone who works with me knows my propensity for Shiny Object Syndrome -- there's a reason they made me the new-products guy for Software Development, after all -- but I think Scala is going to have legs. I've made one or two lousy technology calls in this job. I was sure that object databases were going to be huge, and I bet a whole project on XML => XSL => HTML infrastructure (anyone remember Cocoon?).

Still, the big winners have far outnumbered them. Java, XML, Ruby, and Rails all seem like no-brainers now, but I was pushing their adoption here at Soil Science (and in the pages of SD, for that matter) back when they were the new kids on the block. One of Scala, Erlang, Haskell, or F#, IMHO, is going to be the Next Big Thing for software developers. Mark my words.


Post a Comment

<< Home