Updates to FFI spec
Simon Marlow
simonmar at microsoft.com
Tue Aug 13 04:44:23 EDT 2002
> On 12-Aug-2002, Simon Marlow <simonmar at microsoft.com> wrote:
> >
> > I'd be equally happy (perhaps happier) if the header file spec was
> > removed altogether. In a sense, this would leave the
> Haskell part of a
> > foreign binding even more portable, because it doesn't have
> to specify
> > the names of header files which might change between platforms.
>
> This is a C interface we're talking about, right?
>
> In C, the name of the header file is part of the API.
> It doesn't change between different platforms unless
> the API changes.
>
> Specifying the header name is essential if Haskell
> implementations are to
> ever apply any type-checking to these foreign interfaces. If
> they don't,
> then in practice I think Haskell programs using the FFI are
> likely to be
> less portable, and certainly more error-prone, since they will contain
> type errors that may cause problems on one platform but not another.
Specifying the header name is also essential for certain implementations
(eg. GHC). I wan't suggesting not supplying the header file at all,
just not supplying it in the foreign declaration and not defining it as
part of the standard. But I take your point about the header file(s)
being a proper part of the API.
Cheers,
Simon
More information about the FFI
mailing list