malfunction icon indicating copy to clipboard operation
malfunction copied to clipboard

Support for FFI

Open DemiMarie opened this issue 9 years ago • 1 comments

Support for FFI would be nice.

DemiMarie avatar Sep 13 '16 04:09 DemiMarie

Has ffi been implemented yet? If a language like idris2 compiles to malfunction, can it interact with c or ocaml functions?

GunpowderGuy avatar Sep 02 '24 19:09 GunpowderGuy

You can use (global $Module $function) to access the OCaml value Module.function. See examples/helloworld.mlf for an example. There are no current plans to expose a direct C FFI (it's fiddly), so for C FFI you'll need to write an OCaml wrapper and link against that.

stedolan avatar Nov 24 '24 14:11 stedolan