FFI Report, CVS Id 1.5

Fergus Henderson fjh at cs.mu.oz.au
Sat Jun 16 00:51:48 EDT 2001

On 15-Jun-2001, Simon Peyton-Jones <simonpj at microsoft.com> wrote:
> I'm trying to compile Haskell for the .NET platform.
> For this platform it makes perfect sense to say
> 	foreign import ccall  "foo" foo :: Int -> Int
> because you can make C calls on .NET as well as .NET calls.
> The problem is that the call must specify which DLL the 
> function comes from.  The line in the .NET assembly code
> looks something like
> 	pinvoke dllname::foo 
> I remember now that this is why I originally suggested that
> the C calling convention specify a "package name" rather
> than a header file name. Thus
> 	foreign import ccall "wuggle::foo" foo :: Int -> Int
> rather than wuggle.h

The main problem with that is that in general there will not be
any relationship between the DLL name and the header name.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

More information about the FFI mailing list