Typing f.e.d.

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Mon Feb 12 16:32:01 EST 2001


Alastair Reid wrote:
> [...] ps I have a feeling of feeping creaturism as I watch this list -
> a nice simple design seems to be getting more complex.

Could you elaborate on this? The basic FFI *is* still nice and simple
IMHO. Mentioning plain Addr in it was a design mistake because:

   * Pointers to code and data need not have the same size.

   * The extra type parameter in Ptr/FunPtr tremendously helps to resolve
     overloading ambiguities.

   * Addr doesn't carry any type information, so there is no help at all
     from the type checker, which is even worse than C.

Admittedly, we have to be a little bit careful with the FFI libs: Not
every little two-liner is really needed in a standard lib, but on the
other hand, a standard "vocabulary" for e.g. marshaling improves
readability of code written by others a lot and opens up ways for
performance improvement which didn't exist before (e.g. alloca & friends).

Cheers,
   Sven




More information about the FFI mailing list