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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Darcs is fun. I encourage any of you who haven't tried it to give it a go. I think my current favorite aspect is that, when recording a set of changes, it allows you to selectively choose which parts go into the set and which don't, even within a single file. This is in contrast to CVS, wherein you either record the changes to an entire file, or you don't.

Slashdot thread

This is the thread on slashdot. By the way, it's as depressing as ever to read most comments there...

changeset algebra

The "theory of patches" from the manual is interesting. I've occasionally heard mention of changeset algebra, but I've never found any references. Are there papers on the subject?

Pierce's semi-related work

While it's not directly connected, there are Benjamin Pierce's papers on data synchronization. One you might really be interested in is "Combinators for bi-directional tree transformations: A linguistic approach to the view update problem", which used to be up on his papers web page but no longer seems reachable from there [ed. nevermind, the full version is still there under the link "tech report", it's just that the short version no longer is linked]. The slides from his invited talk at the Fall 2004 NEPLS session are still there.

oh yeah!

(Hi, Stevie!) I was just thinking about that talk. I wonder if the two groups have communicated with each other at all.

Ugh, dialup

An excellent question, especially given the language of choice for both groups. I'll see about finding out sometime soon unless someone beats me to the punch.