Last updated
on 11-05-2009
at 12:00 PM


This year we’ve got a Concurrent Programming option, which I’m taking, which takes our quite abstract Concurrency course and makes it practical. It’s basically design patterns etc for actually writing concurrent programs. It pains them to doing a course that isn’t just abstract, but we do have to see code occasionally. A rant for another post perhaps. Meanwhile the code is written in Scala with CSO, and it doesn’t work unless you set it up just right…

Scala is an object-orientated language, with functional programming elements, which compiles to Java bytecode. I know, what? It’s like they just merged every paradigm together to make a super-language (and then added some questionable syntax). This also means it can use all the standard java libraries too, which is wonderful. It’s remarkably like haskell with ArrayLists. A bizarre experience.

The concurrent part comes from CSO, a Scala library that provides code versions of CSP operators (i.e. our concurrency course). Works all wonderful and great, in labs, but back at home it’s a right struggle getting it to run, which means I can’t really revise, and doing practicals is nearly impossible. Luckily, we’ve got SSH access to the comlab system, and gedit et al run happily with GVFS, but it’s not a great solution.

To get CSO working with Scala in Ubuntu, install this version of Scala, and then use this version of CSO.

I’ve set it up by extracting the JAR and adding the target directory to my $CLASSPATH:

export CLASSPATH=$HOME/path_to_library/:$CLASSPATH

(I assume there is a way of including jar’s directly, but this works, no problem)

If you use other versions of Scala, it doesn’t like that version of CSO, and apparently the current version has a bug in it that causes issues. CSO was created by an Oxford University lecturer (Bernard Sufrin), who doesn’t even teach the course on it anymore, so I’m not hugely confident that it’ll get fixed in any great hurry (ever). In the meantime, this way everything seems to work! I can revise, without SSH! All is well in the world.