> > Mon, 14 Aug 2000 17:05:07 +1000, Manuel M. T. Chakravarty
> <[EMAIL PROTECTED]> pisze:
> >
> > > So, maybe you can briefly comment on whether your current code
> > > stays within Haskell 98 or not.
> >
> > It only relies on multiparametric type classes.
> >
> > Of course it uses primitive ghc operations that it is a wrapper for,
> > and libraries like CTypes, or PrelIOBase for exception constructors.
>
> CTypes is ok, because it part of the FFI. However, I don't
> see much point in a marshalling that uses multi-parameter
> classes and specifics of ghc's implementation of IO.
>
> In a sense, it is a pity because these things might be
> available in the next version of Haskell. But until then,
> as Haskell needs portable library bindings, I think, we
> shouldn't make any use of such features.
I agree to some extent, but I don't think we should discount the possiblity
of using this approach in the future. Marcin's library has two key
properties (if I understand correctly):
- typed pointers
- overloading, based on the type of pointers,
generates the marshalling code. The types of the
pointers are merely placeholders to direct the
overloading, and to provide some type-safety in
the marshalling code.
To me, the idea is sound (but I have a bit of trouble getting my head around
the details, the library is somewhat complicated. Perhaps with good
reason).
Would it be possible to decouple this into a basic marshalling library
without typed pointers, with Marcin's framework built on top? Seems that
would keep most people happy - I imagine the lower level layer providing
basic marshalling facilities in much the same way as Manuel's marshalling
library in c2hs.
The c2hs-style tool that Marcin mentioned ealier sounds great, and would
probably fit right into the lower layer - maybe it could optionally produce
code which uses typed pointers.
Cheers,
Simon