Skip to content

generate C stub code from fn/typ values #15

Closed
avsm opened this Issue Jun 3, 2013 · 3 comments

2 participants

@avsm
OCaml Labs member
avsm commented Jun 3, 2013

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.

@avsm
OCaml Labs member
avsm commented Jun 4, 2013

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.

@yallop
OCaml Labs member
yallop commented Aug 12, 2013

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.

@yallop
OCaml Labs member
yallop commented Aug 14, 2013

Pull request #62 is a small step in this direction.

@yallop yallop closed this in #124 Jan 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.