Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate C stub code from fn/typ values #15

Closed
avsm opened this issue Jun 3, 2013 · 3 comments · Fixed by #124
Closed

generate C stub code from fn/typ values #15

avsm opened this issue Jun 3, 2013 · 3 comments · Fixed by #124

Comments

@avsm
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Owner

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
Copy link
Owner

yallop commented Aug 14, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants