2006-07-18
Scala and Actors
The Scala programming language has been getting a bit of attention on Lambda the Ultimate lately. One paper in particular interested me, covering the implementation of a lightweight concurrency model in Scala.
Scala compiles to JVM bytecode (and apparently there is a version that compiles to .NET as well). The paper describes implementing an Erlang style concurrency system within the JVM that doesn't use native threads. This allows large number of 'actors' to exist, communicating with each other. An interesting aspect of what they've done is how they've gone about mapping the actors to native threads so that long blocking operations can get their own thread as well as utilising threads to run some of the lightweight processes.
All of this is implemented as a library rather than extending the Scala language itself.