学习/使用机器学习。我应该使用哪个系统?

发布于 2024-10-20 03:47:42 字数 500 浏览 3 评论 0原文

我想学习和使用机器学习,但有很多编译器。我需要:

  • 速度
  • 低内存使用
  • 量 线程化
  • 可变数组和记录类型
  • 延续性
  • 为生产代码做好准备
  • 简单的 ffi
  • 最新
  • 有用库
  • ...在某种程度上可移植的

我不需要:

  • 对象
  • 对 Windows 的GUI
  • 支持

例如我发现 OCamlOCaml 电池包括MLton。对我应该选择哪一个有什么建议吗?

I want to learn and use ML but there are many compilers out there. I need:

  • speed
  • low memory usage
  • threading
  • mutable arrays and record types
  • continuations
  • ready for production code
  • easy ffi
  • up to date
  • ... helpful libraries
  • portable to some degree

I do not need:

  • objects
  • GUI
  • support for windows

For example I found OCaml, OCaml Batteries include and MLton. Any advice for me which one should I choose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不爱素颜 2024-10-27 03:47:42

SML 对延续有更好的支持。如果你有强烈的延续需求,是更好的选择; OCaml 没有对它们的语言支持,但有 Delimcc Oleg 的库用于分隔延续;由于是外部的,它可能比 SML 的实现慢。
除此之外,OCaml 如今似乎更受欢迎,因此您应该期望工具和库会稍微好一些。

更一般地说,SML 往往更加优雅,而 OCaml 具有一些更高级的功能、怪癖和用户。就性能而言,它们都很好。

(请参阅,了解最常见的语法比较两种语言的片段;当然 OCaml 的对象和多态变体没有呈现。)

SML has better support for continuations. If you have a strong need for continuations, it is a better choice; OCaml has no in-language support for them, but there is the Delimcc library by Oleg for delimited continuations; being external, it is probably slower than SML's implementations.
Otherwise, OCaml seems to have more traction these days, so you should expect the tooling and libraries to be slightly better.

More generally, SML tends to be rather more elegant, while OCaml has some more advanced features, quirks, and users. Performance-wise they're both good.

(See this for a syntactic comparison of the mostly-common fragments of both languages; of course OCaml's objects and polymorphic variants are not presented.)

無處可尋 2024-10-27 03:47:42

MLton 的优势:

  • 速度
    • 整个程序优化确实可以为您提供比 OCaml 更好的速度,但是每次重新编译所带来的惩罚可能会非常烦人。请参阅此链接,了解 MLton 和 OCaml 的简单非正式比较
  • 请参阅此链接,了解 MLton 和 OCaml线程
  • 可变数组和记录类型
  • 延续
  • 已准备好用于生产代码
    • 显然取决于您使用的库。但基础库是可靠的,但是 MLton 有自己的补充,其他一些库也有列出了扩展的存储库此处。然而 MLton 库项目 包含一些不错的代码。然而,与许多此类库/扩展一样,它们往往依赖于它们自己制作的其他扩展,因此很难仅使用其中的一小部分。
  • 轻松办事
    • ForeignFunctionInterfaceNoLonger-FFI 很棒。然而,我在大型 C 代码库上遇到了 NL-FFI 的速度问题,我认为这是由于 MLton 没有完全删除幻像类型。但这只是我的猜测,我可能做错了什么。
  • 在某种程度上可移植

Well for MLton:

  • Speed
    • The whole program optimisations definetley give you better speed than OCaml, however the penalty you serve for each and every recompile can be quite annoying. See this link for a simple informal comparison of MLton and OCaml
  • Threading
  • Mutable arrays and record types
  • Continuations
  • ready for production code
    • Obviously depends on the libraries you use. But the basis library is solid, however MLton has its own additions and a few others have repos with extensions listed here. However the MLton library project contains some nice code. However as with many of such libraries/extensions, they tend to rely on other extensions made by them self and thus it is hard to only use small parts of them.
  • Easy ffi
    • ForeignFunctionInterface and NoLonger-FFI are great. I have however had speed issues with the NL-FFI on big C codebases, which I think is due to MLton not removing the phantom types complety. However this is just a guess, I might have done something wrong.
  • Portable to some degree
ˉ厌 2024-10-27 03:47:42

Ocaml 满足您列表中除延续之外的所有要求。它速度快、内存效率高、可移植,具有 posix 线程绑定和用于轻量级协作线程的良好库。标准库非常有限,但有许多第三方库

有许多公司在生产中使用 OCaml 来处理各种事情。 Caml 联盟 网站上提到了其中一些公司。

我还建议阅读一些优秀的 OCaml 体验报告:

OCaml at Jane Street Capital

XenSource 上的 OCaml

Ocaml satisfies all the requirements from your list with the exception of continuations. It is fast, memory efficient, portable, has posix threads bindings and good libraries for lightweight cooperative threads. The standard library is pretty limited but there are many third-party libraries.

There are many companies who use OCaml in production for all sort of things. Some of the companies are mentioned on the Caml consortium website.

I also recommend reading some excellent OCaml experience reports:

OCaml at Jane Street Capital

OCaml at XenSource

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文