学习/使用机器学习。我应该使用哪个系统?
我想学习和使用机器学习,但有很多编译器。我需要:
- 速度
- 低内存使用
- 量 线程化
- 可变数组和记录类型
- 延续性
- 为生产代码做好准备
- 简单的 ffi
- 最新
- 有用库
- ...在某种程度上可移植的
我不需要:
- 对象
- 对 Windows 的GUI
- 支持
例如我发现 OCaml,OCaml 电池包括和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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
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.)
MLton 的优势:
Well for MLton:
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