FFI Report, CVS Id 1.4

Manuel M. T. Chakravarty chak at cse.unsw.edu.au
Fri Jun 1 04:36:01 EDT 2001

...is available at


It contains the results of the discussion on external
entities for the C calling conventions.

Summary of changes:

* Modifiers are at the moment only for import declarations.

* import = define variable; export = use variable

* Import declarations in ccall have the following form

  entity -> " ['static'] [fname] ['&'] [cid] "
	 |  " 'dynamic' "
	 |  " 'wrapper' "

  where `fname' is the name of a header file that must end
  in `.h'.  If `&' prefixes the cid, we import the address
  of that label.  `dynamic' corresponds to the old import
  dynamic and `wrapper' to the old export dynamic.  This has
  essentially the same functionality as Sven's last posting,
  but allows to specify a header file without being forced
  to specify the C identifier.

* Appendix B contains a rationale for items about which
  there has been much discussion.

Open question:

  In foreign import dynamic, the old FFI spec restricted
  type of dynamically imported functions to 

    prim_args -> IO prim_result  

  Why did it forbid thunks and pure functions?  Is this
  really necessary?


More information about the FFI mailing list