archives

Darcs: an open source version control system implemented in Haskell

Slashdot today links to an interview with David Roundy, the author of darcs, one of a number of proposed replacements for CVS. Darcs is, rather thrillingly, based on a theory of patches with roots in quantum mechanics, a notion which Roundy brings down to earth a little in the interview:

At its most basic level, the theory of patches is about the commutation, or reordering, of changes in such a way that their meaning doesn't change. The rules of commutation tell us when, for example, one patch requires another, since dependent patches cannot be commuted. Once the commutation primitives have been worked out, one can do all sorts of interesting (and useful) operations, such as merging. And such operations can be shown to be independent of order, i.e. it doesn't matter whether you merge patch A or patch B first, you'll get the same result.

Also interesting is his choice of Haskell for an implementation language, and the reasons he gives for this:

Haskell is just a great language in which to program. It is purely functional, and lazy, both of which allow you to do really cool tricks. For example, by using lazy IO I can cleanly separate the file and directory reading, from the patch-applying (which is pure functional code), from the file or directory writing. Haskell also is a really good match for implementing the primitive patch operations, with its pattern-matching syntax and higher order functions.

Roundy also notes that he has had no difficulty finding Haskell coders to help with the project:

There seem to be quite a few people out there just looking for somewhere to use Haskell! And in fact, there have also been developers who learned Haskell expressly for the purpose of contributing to darcs.