gpt4 book ai didi

sml - Poly/ML 中的共享库

转载 作者:行者123 更新时间:2023-12-01 02:24:36 27 4
gpt4 key购买 nike

是否可以使用 Poly/ML 构建共享库?
我希望能够创建一个 C Poly/ML 库的 API,并从不同的编程语言(例如 Python)调用/加载它。有人尝试这样做吗?
我知道这可以在 OCaml 中完成:

  • How can I call OCaml functions from a Python program?
  • 最佳答案

    以下是 Poly/ML 主要开发人员 David Matthews 提供的答案 (http://www.polyml.org/):

    The simple answer is no, at least at the moment. I had a look at this and wondered if it was possible. The foreign-function interface allows for call-back functions so there is the mechanism to produce a C function that when called calls an ML function. The difficulty I could see was that in order to produce a shared library the closure for the C function has to be "unpicked" so that relocation information can be produced for addresses within the closure. I'd have to add something to libffi to do that. It doesn't look to be too hard for X86 but I haven't taken it any further. There may be other issues that I'm not aware of.

    关于sml - Poly/ML 中的共享库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17580386/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com