cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc

Ross Paterson ross@soi.city.ac.uk
Mon, 14 Apr 2003 11:53:46 +0100


On Mon, Apr 14, 2003 at 11:18:39AM +0100, Alastair Reid wrote:
> ross 2003/04/11 16:39:44 PDT 
> > Modified files:
> > libraries/base/Foreign/C Error.hs libraries/base/System/Posix
> > Internals.hs libraries/network/Network Socket.hsc 
> >
> > Log:
> > Hugs only: add a CBITS "pragma" to tell the Hugs conversion script
> > which files from <package>/cbits should be linked with the module by
> > ffihugs, e.g. {-# CBITS HsNet.c initWinSock.c ancilData.c #-}
> [...]
> Is this the best way to handle cbits though?

It's the best I could think of, but I'm not emotionally attached to it.

> 2) Can the problem of associating C files with Haskell ffi files
>    be solved in a way that all compilers (and associated tools,
>    makefiles, etc.) can support and exploit?
> 
>    (e.g., other compilers support the CBITS pragma, or an ffi
>    extension, or a package configuration file extension, or a text
>    file which can be read both by GHC makefiles and by your package
>    conversion script, etc.)

It seemed to me that Hugs is quite different from the compilers in this
respect: they link all the cbits stuff together in a library, with which
the whole package is linked, while Hugs links each module separately, so
only Hugs needs an association between modules and C files.