Changes between Version 20 and Version 21 of ForeignFunctionInterface


Ignore:
Timestamp:
Oct 21, 2009 11:42:37 AM (6 years ago)
Author:
chak@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ForeignFunctionInterface

    v20 v21  
    2424 
    2525The following topics still require a bit of discussion or a decision between multiple alternatives. 
    26  
    27 === Libraries === 
    28  
    29 A large part of the FFI addendum are the libraries living under `Foreign` in the library hierarchy.  Given the general discussion surrounding the inclusion of libraries into Haskell', we need a concrete approach for the `Foreign` libraries.  A tentative proposal was the following: 
    30  
    31  * The FFI addendum has been written before the proposal for HierarchicalModules, it uses a flat names space.  In Haskell', we will use the hierarchical names from the [http://www.haskell.org/ghc/docs/latest/html/libraries/base/index.html standard library.] 
    32  * Haskell' keeps a subset of the libraries defined by Haskell 98 (but with their hierarchical names) and adds the FFI libraries. 
    33  
    34 Moreover, the current libraries have grown somewhat since the original FFI Addendum.  Do we want to add the additions listed in the following: 
    35  
    36  * The module `Foreign.Marshal.Pool` (which may be used by the OpenGL binding) 
    37  * In `Foreign.C.Error`: `throwErrnoIfRetryMayBlock`, `throwErrnoIfRetryMayBlock_`, `throwErrnoIfMinus1RetryMayBlock`, `throwErrnoIfMinus1RetryMayBlock_`, `throwErrnoIfNullRetryMayBlock`, `throwErrnoPath`, `throwErrnoPathIf`, `throwErrnoPathIf_`, `throwErrnoPathIfNull`, `throwErrnoPathIfMinus1`, & `throwErrnoPathIfMinus1_` 
    38  * In `Foreign.ForeignPtr`: `finalizeForeignPtr` 
    39  * In `Foreign.Marshal.Array`: `withArrayLen`, `withArrayLen0` 
    40  * `Foreign.Marshal.Error` does actually omit some routines of the FFI Addendum (namely those to construct I/O errors).  I think we need to keep them in the FFI specification. 
    41  
    42 '''TODO:'''  
    43  * Decide whether we adopt the above tentative proposal. 
    44  * Decide whether we want to adopt the additional module and functions. 
    4526 
    4627=== Reinitialisation after `hs_exit()` === 
     
    9071The [http://www.cse.unsw.edu.au/~chak/haskell/ffi/ FFI addendum] is already written and formatted in the style of the report — it should be straight forward to integrate.  In addition the following changes relative to the original addendum will be applied. 
    9172 
    92 === Hierarchical names for the libraries === 
     73=== Libraries === 
    9374 
    94 Changes to the library names as discussed above under "Open Questions". 
     75We use the hierarchical names from the [http://www.haskell.org/ghc/docs/latest/html/libraries/base/index.html standard library,] instead of the names in the FFI addendum. 
     76 
     77Moreover, the current libraries have grown somewhat since the original FFI Addendum.  We include the additions listed in the following: 
     78 
     79 * In `Foreign.C.Error`: `throwErrnoIfRetryMayBlock`, `throwErrnoIfRetryMayBlock_`, `throwErrnoIfMinus1RetryMayBlock`, `throwErrnoIfMinus1RetryMayBlock_`, `throwErrnoIfNullRetryMayBlock`, `throwErrnoPath`, `throwErrnoPathIf`, `throwErrnoPathIf_`, `throwErrnoPathIfNull`, `throwErrnoPathIfMinus1`, & `throwErrnoPathIfMinus1_` 
     80 * In `Foreign.ForeignPtr`: `finalizeForeignPtr` 
     81 * In `Foreign.Marshal.Array`: `withArrayLen`, `withArrayLen0` 
     82 * `Foreign.Marshal.Error` does actually omit some routines of the FFI Addendum .  I think we need to keep them in the FFI specification. 
     83 
     84NB: 
     85 * We do not include `Foreign.Marshal.Pool` in the standard as it doesn't appear to be widely used and doesn't have an efficient implementation at the moment. 
     86 * We omit the functions that, in the standard libraries, have been moved from `Foreign.Marshal.Error` to `System.IO.Error` (namely those to construct I/O errors). 
    9587 
    9688=== Transparent marshalling of newtypes ===