Changes between Version 2 and Version 3 of ForeignFunctionInterface


Ignore:
Timestamp:
Dec 6, 2005 12:33:57 PM (9 years ago)
Author:
ross@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ForeignFunctionInterface

    v2 v3  
    99== References == 
    1010 * [http://www.cse.unsw.edu.au/~chak/haskell/ffi/ addendum] to Haskell98. 
     11 * [http://www.haskell.org/ghc/docs/latest/html/users_guide/sec-ffi-ghc.html Using the FFI with GHC] 
    1112 
    1213== Pros == 
     
    1516 
    1617== Cons == 
     18 * Inaccurate `foreign import`s can invalidate all guarantees given by Haskell. 
     19 
     20== Issues == 
    1721 * Some feel that the inclusion of `unsafePerformIO` sends the wrong signal. 
    18     * It is true that giving inaccurate `foreign import`s can invalidate all guarantees given by Haskell, including providing a way to define `unsafePerformIO`, but that doesn't mean it should be standard. 
     22    * It is true that by giving inaccurate `foreign import`s one can define `unsafePerformIO`, but that doesn't mean it should be standard. 
    1923    * The stated purpose of `unsafePerformIO` in the FFI (hiding marshalling and unmarshalling for otherwise pure functions) can be achieved with a `runST`-like device if the language has [wiki:Rank2Types] or [wiki:RankNTypes]. 
     24 * Foreign imports may specify a single include file. This is sufficient in theory, but most GHC users prefer to use `-#include` options instead, and the standard form is poorly supported by GHC. The hierarchical libraries use an `INCLUDE` pragma as a portable replacement for `OPTIONS_GHC -#include`. 
     25 * Cross-platform libraries (e.g. HOpenGL) often want to import the same foreign functions using the `ccall` convention on Unix and the `stdcall` convention on Windows. The usual method is to use CPP hackery. 
     26 * The specified CString conversions are not yet supported in the hierarchical libraries.