[darcs-users] compiling darcs with ghc-6.4 failed

David Roundy droundy at abridgegame.org
Tue Mar 29 23:31:52 UTC 2005


On Mon, Mar 21, 2005 at 11:33:10AM +0100, Andrei A. Voropaev wrote:
> Is that a normal thing that each new version of Haskell compiler can't
> compile code written for older versions? Or is it some problem in the
> distributions of ghc that I'm using? (I had downloaded binaries for i386
> from ghc web-site)

The problem is that in a few places darcs uses ghc-specific internal APIs,
which are subject to change.  I'd like to fix this, but it's a bit of a
pain.  The issue in this case is a function that allows me to open a file
descriptor in C code, and then create a haskell Handle describing this
descriptor, which is a rather low-level operation, but fundamental to how
darcs uses zlib.

I'd like to move to a framework where we don't use Handles to avoid this
ugliness (and it is indeed horribly ugly), but that will take some time
(and there haven't been volunteers jumping up and down wanting to work on
this--perhaps because it's my baby).  The catch is that we'd have to switch
every bit of code that reads or writes compressed files to the new
framework, which could be quite a pain.  The reading won't be bad, but
writing efficiently via a generic API (i.e. that may go through zlib or the
C library) is going to be a bit of a challenge.

For interested Haskellers, a start on this is in DarcsIO, which defines a
few classes which allow IO-like operations (but possibly on in-memory data
structures, or on compressed files--the idea is to also clean up the Slurpy
code).  I'd love to have someone volunteer to take this over (and would of
course be willing to help if you're unsure what to do).  I think it's an
interesting, challenging task, but just don't know when I'll have time.
Also, the code almost always comes out better if someone else writes it and
I critique it, than if I just write it myself...

The basic idea of DarcsIO is vaguely similar in intent to John Goerzen's
vfs (spelling?) module, but it is encapsulated in a monad, and doesn't
therefore have to be run in the IO monad.  The directory-related
slurpy-replacement stuff is intended to allow us to lazily parse and apply
patches, which will reduce memory consumption on commands like get and
check, and may also speed things up.
-- 
David Roundy




More information about the darcs-users mailing list