[erlang-questions] Erlang FFI: new draft EEP, patches, and summary
Sat Sep 29 13:01:32 CEST 2007
based on the feedback received on this mailing list, I've updated
the Erlang FFI draft EEP and patches. Everything is available at
the usual place:
Here's a summary of the changes discussed so far (with references to
the previous emails):
1. buffer-to-binary and cstring-to-binary conversions 
2. passing/returning Erlang binary()'es as ErlDrvBinary'es 
3. FFI and preload information on erl_ddll:info/2 
4. high-level API with type-tagged values 
5. 'nonnull' FFI type, for representing (and checking) non-NULL
6. ffi:sizeof(Type) and hard-coded type size macros 
7. erl_ddll:load_library/2 and erlang:open_port/1 
Here's a list of enhancements that were *not* discussed before (for
the details, see the updated draft EEP):
8. passing iolist()s to the C side as ErlIOVec's
9. ffi:min/1, ffi:max/1 and ffi:check/1 (for range and
consistence checking on type-tagged values)
10. utility macros for easier binary matching of FFI types.
11. some new FFI types (pid_t, off_t).
At the moment, there are two known issues (in the patches and/or the
1. the patches have not been tested on big-endian platforms,
yet. I expect them to have signedness problems, so beta
testers (and bug fixers ;-) are welcome!
2. floating point types are not (yet) properly supported by
ffi:min/1, ffi:max/1 and ffi:check/1. In general, the
floating point checking API needs to be enhanced (for
example, there should be a way to obtain FLT_EPSILON for the
And finally, here's the only proposal that has not been integrated
(yet) in the draft EEP:
* David Hopwood proposed a very elegant closure-based FFI .
However, I didn't get how it could be actually used, and asked
for clarifications .
I think that's all. As usual, leave your feedback and/or try the
Notes and references:
 Erlang FFI : 1st discussion summary
 FFI: handling refcounted binaries
 David Howood's original proposal for the closure-based FFI
 Discussion about the closure-based FFI
Alceste Scalas <>
This message was sent using IMP, the Internet Messaging Program.
More information about the erlang-questions