Updates to FFI spec

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Fri Aug 9 07:32:52 EDT 2002

For those not on the cvs mailing list:

I've applied all the changes discussed over the last 2 moniths that
received some support and no dissent.
  Changes since RC5:
  * Author list: changed Alastair Reid's institution
  * 4.1.1: Removed [lib] from impent syntax and discussion
  * 4.1.3: Added parentheses round FunPtr ft to make it easier to 
           understand a tolerably complex type.
  * 4.1.4: Removed all mention of library objects
  * 6:     Specified that HsBool==int in table2
           Relabelled column 1 in table 3 (C symbol -> CPP symbol)
           Replaced 0 and 1 with HS_BOOL_FALSE/TRUE

You will need this file:


to build it.  (I came close to adding this file to the repo but
figured that Manuel must have a reason for not having done so

Changes not applied:

- I really, really want to resolve the ForeignPtr issues soon.


- I'd like to see a standard way to call the GC from C

  Note that Hugs and GHC have had this for ages except that we call the
  function 'performGC' and there's no way to control how many generations
  are collected.

- I see the question of Function prototypes as a portability problem
  waiting to happen.  Either Hugs and GHC are right (you should use the
  user-supplied header file or NHC is right (you should ignore the
  header file).  They can't both be right if we want portable code
  so the report should be clear about which one is right.

  (Given my druthers, I'd drop header files from the foreign import syntax
  and say that you have to specify it on the command line or propose that
  we standardize some variant of the GHCism {-# -include "foo.h" #-}.  But
  I'm not excited enough about it to push hard for this.)

- Changes to hs_init 


Alastair Reid                 alastair at reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/

More information about the FFI mailing list