Is it possible to use OCaml in embedded mode?

萝らか妹 提交于 2019-12-10 09:31:19

问题


Some time ago I emerged for myself that Guile and Racket can be embedded and be called right from any C++ application.

Can OCaml work like this?


回答1:


You can have a look at the Embedded O'Caml Toplevel done by Clément Capel. It's the result of a summer internship so it wasn't updated since 2004.

Otherwise, there is ocamlmklib.




回答2:


You can use the OCaml toplevel as a library. It is part of the official OCaml distribution and up-to-date. See toploop.mli in OCaml sources for the interface. It is officially only available in bytecode, but there is experimental support for native code.

If you plan to redistribute your application, be aware that the toplevel library (and the compiler itself) are under a more restrictive license (modified QPL) than the standard library and runtime (modified LGPL).



来源:https://stackoverflow.com/questions/8635197/is-it-possible-to-use-ocaml-in-embedded-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!