Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The recently released ocaml-ctypes <https://github.com/ocamllabs/ocaml-ctypes > library by Jeremy Yallop does something similar. It uses GADTs to represent the C type system in OCaml's type system with as-you-would-expect OCaml signatures. For example, you can pass an OCaml comparator to a C sort function that takes a function pointer and it works.

It's not quite as smooth, as far as I know, but it will soon include C header consumption and C stub generation to both improve binding accuracy/safety and remove dynamic paths for performance.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: