- Calling C functions returning structs by value is now supported
- Factor callbacks can return structs by value too
- Support for stdcall callbacks on Windows
- The Linux/ARM port now has working FFI
- The Linux/PPC port now has working FFI
Now with these out of the way, Factor 0.88 is ready for release.
The C library interface is quite complete now. Here is what it already supports:
- Easy to use: no glue code has to be written in C, concise
- Relatively efficient
- Supports both stdcall and cdecl ABIs on Windows (and as of 0.88 this support is complete)
- Integer and floating point parameters, return values
- Automatic conversion for ASCII and UTF16 C string parameters, returns
- Declaring C struct and union types, allocating/deallocating/mutating C data
- Passing struct parameters by reference and value (value struct returns were missing until 0.88)
- Calling C functions indirectly by function pointer
- Callbacks from C to Factor
I'm quite proud of how well it works. There are only a few missing features, and I will be adding all of them in the near future:
- "long long" return values work on 32-bit systems, but not "long long" parameters
- Declaring structs and unions which contain fixed-size value arrays
- Passing floating point parameters on ARM
Apart from these I can't really think of anything else I could add to the FFI. It really does seem quite complete and portable these days.
2 comments:
That is seriously slick. I bow to the master.
I'm just a humble servant.
Post a Comment