Saturday, 12 July 2008

Calling C code from OCaml

The OCaml Journal just published an article about OCaml's foreign function interface:

"Although the OCaml programming language offers many improvements over older languages such as C, C++ and Fortran the need to interoperate with native code can still arise. The two most important uses for native code interoperability are performance and legacy. This article describes how native code can be invoked from OCaml programs using both the conventional OCaml approach of writing stub functions in C and also a new approach using LLVM to generate the necessary interface code at run-time..."