Last week I tweeted from Intel Developer Forum with the tantalising news that there is a version of Concurrent Collections for Haskell in development. Today, I have more news from its creator about the implementation, and when we can expect to see it.
First, a few words about Concurrent Collections for C++, which is available for download now. It provides a way to build C++ programs that will execute in parallel, by just focusing on the high-level computation steps, inputs and outputs. The key benefit is that it means domain experts can create parallel programs without having to become experts in parallel programming. The tool can be used to create a single source that can be used with run-times targeted for different parallel architectures, and the programming model supports all styles of parallelism without any need for rewriting or recompiling.
At IDF, Intel announced Linux support for Concurrent Collections, and it was already available for Windows. There was, as I said, also mention of an implementation for Haskell. I’ve been in touch with Ryan Newton, the man at Intel responsible for it, and he says: “I’ve been working on Concurrent Collections (CnC) for Haskell as an experimental side project. The basic idea is that CnC is a system that (1) computes a pure function in parallel for each complete invocation (heterogeneous set of collections -> heterogeneous set of collections); and (2) requires that the individual kernels (“steps”) be pure functions. You can only leverage (1) and enforce (2) in Haskell, so it’s a natural fit. One of the goals was to learn what interesting scheduling ideas exist (e.g. idempotent work stealing) or might exist in the pure domain.”
Ryan has implemented two versions of a CnC library for GHC. One is a pure version that relies only on “par” for parallelism. The other uses forkIO and a mutable formulation of collections. He says they both expose the same monadic interface and run the same client code.
“There are some particularly interesting scheduling possibilities with the pure version,” says Ryan. “Because it uses functional updates to the ‘world’, we can potentially have a looser coherence model.”
The software is pencilled in for release sometime next month,before the next major release of Concurrency Collections comes out in Q1 next year. The first release will be a sample implementation through whatif.intel.com, and an opportunity for the Haskell community to offer feedback on the implementation and suggest any ways it could be enhanced. The licence is to be open source.
I’ll let you know when I hear more!