Statically Typed

because Hindley-Milner rocks

Concurrency Patterns: Actors and STM

I’ve been playing around with Scala on my free time as well as attending the Boston Scala group.  Not only am I a fan of the mixed paradigm languages (C++, ML, Scala, Python, F#) with the ability to use functions as first class objects or in the case of C++ come close but I’m also a big fan of some of the “new” approaches being taken with concurrent programming.  Case in point the Scala’s Actor model.

Originally the Actor model appeared in Erlang (a really cool language) and others have adopted it.  I’m still waiting for someone to attempt to get something going for Boost in the Actor realm.  I’ve only been able to find Theron which doesn’t claim to be a lighter, less full-blown implementation of the Actor.  While in Java without resorting to using Scala (why wouldn’t I want to do that?) I’ve found ActorFoundry which appears to be more of a researchy type project.  There’s nothing for ML or CPython due to their inability to work on more than a single core.  Such a shame too as I’d love to see a multi-core OCaml implementation.

Then there’s this other thing called STM.  This has really peaked my interest not only because I’ve never used it before but because it shows so much promise.  I’ve done my fair share of DB-centric programming and anyone that can leverage such well-known and well-tested techniques to memory has my thumbs up.  Clojure is based on such a system and has been impressive to say the least.  I’m hoping they bring one over to Scala.  In the meantime I’m waiting on DeuceSTM for Java and Towards Boost for C++.

Towards Boost is in alpha stages and not yet accepted into Boost, hence the name.  The minute it goes beta I’m grabbing it and attempting to use it in my work work not just play work.  The fact that they’re trying to make it a Boost library and not just another research endeavor is very impressive.  I doubt there is grant money to be had for doing this, instead what I think they’ll gain is a much deeper understanding of concurrency issues.  Look at the very broad and large audience who would test it to the extreme.

DeuceSTM on the other hand I think looks to be a research focused.  I don’t want to play around with Clojure to experience a tried and true STM as I like statically typed languages with compile time checks.  All I need is another run-time error because of something I didn’t expect while I kept track of all the types in my head.  I think dynamic typing is great for scripts, don’t get me wrong, but for full-fledged production with many engineers?  No.  The best stuff that has come out of programming research has been geared towards reducing complexity and limiting the amount of information which must be kept in our heads at any one time.  Case in point, garbage collection.  I hope STM takes off as I see it being the next step in reducing record keeping.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


This entry was posted on January 30, 2010 by in Uncategorized.
%d bloggers like this: