Can OCaml be used as a scripting language for C ++?

I am interested in using OCaml as a scripting language for an application written in C ++. Similar to how languages ​​such as Lua, Python, or JavaScript can be used.

Is there any library (e.g. LuaJIT for Lua, CPython for Python, or V8 for JavaScript) that I can use to run and interact with OCaml?

+5
source share
2 answers

You can embed toplevel (REPL) in your application or embed the compiler and dynlink generated code (this is how ocaml_plugin works). Topless is provided by the libs compiler library installed with the compiler.

+3
source

there is ctypes that is designed to integrate C in Ocaml and vice versa.

0
source

All Articles