Well Quite!


The Rants, Raves, and Rituals of Matthew Sackman
Thursday, June 26th, 2008

TiC 2008

I'm currently attending Trends in Concurrency in Prague which is a summer school, targeting researchers working on concurrency issues. Mainly we've had quite a large number of language tours which are not uninteresting, and each have their own quirks and niceties.

One of the most amusing things I find is how extensive Haskell's influence is now. Fortress and Scala really do seem to have been influenced heavily by Haskell and this seems to work to a greater or lesser extent in each language. Scala does actually support Monads so you can live in that world if you want, and it also has an effective equivalence to Type Classes (though certainly not with functional dependencies, associated types or any of the other magic; in fact I'm not sure whether they're even multi-parameter type classes). Fortress also has clearly been influenced by Haskell, and some of the talk on Monoids over trees reminded me distinctly (though the work is not directly related) of Hinze and Patterson's Finger trees: a simple general-purpose data structure paper and the subsequent presentation Ross Patterson gave at the London HUG.

However, Fortress is still a statement oriented language, and whilst Scala claims to be expression oriented, it's very much like Erlang in this respect, a list of expressions which are guaranteed to be executed in order. In neither language are you required to live under a Monad in order to express a given ordering (yes, I know that's not really what Monads are about, but let this one slide please...) and so they all just feel just a little bit broken. Neither are lazy by default, though Fortress has a means to make expressions lazy (and it also has an effect type system to work out where IO happens - is there some fear of making users actually use and/or understand Monads here?) and Scala allows the type ( => T) to capture a function which is due to emit a value of type T without actually calling the function: in effect allowing you to control laziness.

We also had talks on X10 and a child project (not at IBM) called Habenero which have some neat synchronisation barrier ideas in them called phasers. These allow a barrier to be shared between a dynamically chosen set of threads and for each thread to specify its relationship with the barrier: for example a wait (where the thread will block until the barrier is past), a signal (where the barrier won't be past until the thread sends the signal) or sig-wait (where the thread both has to signal the barrier and wait for the barrier - i.e. a full barrier from openMP). X10 does not seem to be Haskell influenced at all, but two out of three isn't bad. Also, I'm not actually the only one in the audience of just over 50 that's a Haskeller. There are several others here and a good percentage at least claim some functional knowledge. These are clearly not the hoards of unwashed Object-Oriented and Imperative programmers. Overall, really very interesting.