[darcs-users] Other Haskell implementations?

David Roundy droundy at abridgegame.org
Sat May 15 11:35:32 UTC 2004

On Sat, May 15, 2004 at 09:31:23AM +1000, Donald Bruce Stewart wrote:
> dons:
> > bet:
> > > Could anybody offer me a guess as to whether porting darcs to build
> > > under some lighter-weight Haskell would seem practical; and if so,
> > > whether nhc98 would be a reasonable choice?
> > 
> > The nhc98 compiler is a full implementation of H98, plus the ffi, plus
> > extras. It works on all 32-bit machines, (at least NetBSD has ported it
> > to 22 architectures). It has a very small footprint, and is maybe 10
> > times faster than an interprter like Hugs.
> > 
> > Getting darcs to use portable Haskell would be a worthy goal.


> > However, I'm not sure what GHC-specific features darcs is using, beyond
> > h98 and the ffi (besides unboxing stuff, which could be disabled?)
> > Can anyone comment?
> Well, you can start by setting GHC=nhc98 in the bulid script. Which gets
> a little way in and then:
>         nhc98  -cpp  -package unix -package text -O ...
>         Warning: -package unix library  not found.
>         Warning: -package text library  not found.
>         Warning: -package util library  not found.
>         Warning: -package net library  not found.
> Aah. Library support. nhc98 only has the base hierarchical libraries at
> the moment.  Looks like we're stuck.

Indeed, libraries are the problem.  There are very few instances of use of
ghc extensions--just in SignalHandler (deriving Typeable), SHA1 (which I
guess is a workaround for lack of recent libraries) and win32/Posix, where
I'm not sure what's used.

There are more places where #ifdefs are used that would need to be cleaned
up, but this should be done anyways--if these are still needed, they should
be checked via autoconf macros.

The lack of unix, text, util and net isn't necesarily a serious problem.
Most of the functions in there could be pretty easily implemented using the
FFI.  A much more serious problem is that nhc98 doesn't seem to have a
recent version of the base hierarchical libraries--in particular it is
lacking Control.Monad.ST, which is used in Lcs to provide (moderately)
efficient arrays.

The main reason I'm not too interested in nhc98 is that it doesn't run on
64 bit platforms, and the only time I've ever had trouble getting ghc
installed was on a 64 bit platform.
David Roundy

More information about the darcs-users mailing list