[darcs-users] GHC package for darcs

Craig M.Lennox list-darcs-users at cosmic.com
Mon Sep 20 15:44:44 UTC 2004


droundy at abridgegame.org (David Roundy) writes:
> > On Fri, Sep 17, 2004 at 10:11:27AM -0400, Craig M. Lennox wrote:
> > > However, when I read through the WishList on wiki, it makes me think
> > > that a lot of these things (like the patch browser) would become
> > > trivially easy if there existed a package interface that even a
> > > fledgling Haskell programmer could call upon without having to reckon
> > > with the complex underlying machinery of Darcs.
> 
> Yeah, adding an interface to darcs would be very nice.  There would be a
> couple of ways to do it.  One would simply be to export all the modules
> that darcs uses internally.  This wouldn't simplify anything, but would be
> relatively easy (you'd just have to figure out how to create a ghc
> package).

I like the easy route; it suits me. :) In any case, it would be a
decent first step towards loftier goals.

And creating a ghc package is really a piece of cake.  Mostly it's
just a matter of archiving the .o files into library, and moving the
.hi files generated by the compiler into directory under your
hslibs/imports directory.  Then you run the ghc-pkg utility to tell
GHC where you've put the stuff.

I've created a simple little "hello world" type example of a GHC
package as a tutorial for anyone who's interested.  It can be
retrieved using darcs from <http://cosmic.com/repos/haskell-pkg>

> The other (better) idea would be to create a stable, simplified interface.
> The trouble is that this is hard.  Until we've seen a few applications
> using the interface, it's hard to know what will be too simple, and what
> sorts of things need to be supported.

Well, we already have the three: darcs itself, darcs_cgi, and the unit
tester.  It would be an interesting exercise to try to make those
three programs compile with nothing but themselves and a binary darcs
package.

Beyond that, I agree, it would be mostly an evolutionary process
driven by what people decide to write.  However, the impression I get
from having written a couple of (dirt simple) programs is that what
exists now is already pretty good -- mostly what it lacks is
documentation, combined with perhaps a good old fashioned culling of
dead code.

> Another (perhaps even better?) idea would be to create a C interface to the
> darcs internals.  This would obviously require a stable, simplified
> interface, and would have the advantage allowing interfaces with all sorts
> of interesting programs.

But C is *so* last century... I'm not certain we should be encouraging
its continued existence.  :)

cheers,
Craig




More information about the darcs-users mailing list