[darcs-users] libdarcs?

David Roundy droundy at abridgegame.org
Thu May 6 11:14:10 UTC 2004


On Wed, May 05, 2004 at 06:45:47PM -0700, Adam Megacz wrote:
> 
> Perhaps it's too early to ask about this, but I'm thinking of writing
> a graphical patch/diff management tool for darcs (mainly for seeing
> patches in two-pane view, but I might as well include a nice
> folding-tree patch history while I'm at it).
> 
> The idea is to write it in XWT (soon to be called Ibex) / www.xwt.org.
> 
> Anyhoo, is the darcs command set stable enough to declare an API of
> some sort?  XWT speaks XML-RPC, and I believe there are really easy to
> use XML-RPC bindings for Haskell; the XML-RPC types map very cleanly
> onto Haskell types.

There are two ways you could do this.  One would be to simply call darcs
annotate/changes --xml-output and parse the result.  This is pretty easy,
but also limited to viewing data that darcs already outputs.  On the other
hand, if you find something that darcs doesn't output, then adding that
feature could benefit everyone (including people using human-readable darcs
output).

Another possibility would be to create a C binding to darcs--a real
libdarcs.  That is something I'm definitely interested in doing, and have
been interested in for some time.

I looked briefly at the XML-RPC module, and it's pretty elegant, and in
fact also could be used (with minimal hacking) to create a C binding with
very little work.  Basically, it involves defining a conversion for each
haskell type I want to export into what is essentially a C struct.  Then of
course, one needs to figure out what functions to export, etc, which would
require careful thought.  So yes, I'd be happy to work on this (I'm happy
to work on too many things...), but we'd have to figure out an interface
obviously.  Just exporting darcs' internal data structures would be
unwise.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list