One useful addition would be a command-line IDL generator to generate static C stubs and the matching external mli signature file from a fn/typ type description.
This would permit the C output to be statically linked rather than dynamically opened, and would completely sidestep the dependency on libffi2.
Related to this is avsm/ocaml-cstruct#17
We could improve cstruct dramatically by making the camlp4 extension just generate a Ffi.C.type, and having logic elsewhere to map that into Bigarray accesses. Right now cstruct needs to understand the packing and alignment rules for structs, which is both incomplete and also duplicated in this library.
Generating C stubs almost removes the dependency on libffi2, but we'll still need a way to squeeze closures into function pointers, which isn't possible with pure C. Perhaps a configure-time option -- libffi2, ffcall (#56), or no closure support -- is a reasonable approach.
Pull request #62 is a small step in this direction.