FFI Report, CVS Id 1.5

Simon Peyton-Jones simonpj at microsoft.com
Fri Jun 15 05:46:42 EDT 2001

| There is now a new revision of the definition at
|   http://www.cse.unsw.edu.au/~chak/haskell/ffi.{ps.gz,tex}

Great stuff.  It's looking good.

| > * You mention en passant that there's a new type CInt.  
| Very good, but
| > the full set of types (and their operations) must be defined in the 
| > language-specific sections.  Indeed, I suggest we take 3.2 and 
| > make it a top-level Section, with a sub-section for each language.
| The types have to be defined, but I was planing to do that
| as part of the libraries (where they are defined).

I disagree with this.  Here's why.

I think it is useful to make a separation between
	- what must be implemented by the Haskell compiler
	- what is defined by a portable library

To implement a C interface, a Haskell compiler must implement
	- foreign ccall ...
	- the types: CInt ...etc
	- Storable instances for those types

So I propose that we have

Section 4: External platforms

   4.1: C [ccall, stdcall]
   4.2: Java
   4.3: .NET

(i.e. lift current 3.5 to top level).   Furthermore, within each of
these I suggest
we define what foriegn types and instances must be defined.


More information about the FFI mailing list