There are a number of interesting projects already doing this, either doing it manually via the c FFI or using projects like ocaml-rs [1] or ocaml-interop [2] for example
[1]: https://github.com/zshipko/ocaml-rs [2]: https://github.com/tezedge/ocaml-interop