简体   繁体   中英

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

I'm interesting in using OCaml as a scripting language for an application written in C++. Similarly to how languages like Lua, Python, or JavaScript can be used.

Is there any library (like there is LuaJIT for Lua, CPython for Python, or V8 for JavaScript) that I can use to run and interace with OCaml?

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

存在用于在Ocaml中集成C的ctypes ,反之亦然。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM