具有并发垃圾收集器的函数式语言?
Microsoft 的新 F# 编程语言提供了函数式编程(一流的词法闭包和尾部调用)与高效并发垃圾收集器的强大组合,可以轻松利用多核。
据我所知,OCaml、Haskell、Erlang 以及所有免费的 Lisp 和 Scheme 实现都没有并发 GC。 Scala 和 Clojure 有并发 GC,但没有尾部调用。
因此似乎没有结合这些功能的开源编程语言。 那是对的吗?
Microsoft's new F# programming language provides the powerful combination of functional programming (first-class lexical closures and tail calls) with an efficient concurrent garbage collector that makes it easy to leverage multicores.
OCaml, Haskell, Erlang and all free Lisp and Scheme implementations that I know of do not have concurrent GCs. Scala and Clojure have a concurrent GC but no tail calls.
So there appear to be no open source programming languages that combine these features. Is that correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Erlang 有一个无共享模型,其中每个进程都有自己的垃圾收集器。 无论您是否认为这不是并发,这取决于您。 但随着进程数量的增加,它确实可以很好地扩展。
Erlang has a shared nothing model where each process has it's own garbage collector. Whether you consider that to be no concurrency or not it's up to you. But it sure scales very well as the number of processes goes up.
最新版本的GHC支持并行GC。 请参阅发行说明。
Latest version of GHC supports parallel GC. See the release notes.
Scala 有一些尾递归优化。 但要获得完整的 SISC 方案。
Scala has some tail recursion optimization. But get SISC scheme for the full thing.
这并不是您问题的真正答案,但据我所知,F# 使用标准 .NET 垃圾收集器,它不是并发的; GC 期间所有线程都会停止。
编辑:我的错误,多处理器模式下有并发GC。
Not really an answer to your question, but to my best knowledge, F# uses the standard .NET garbage collector, which is not concurrent; all threads are stopped during GC.
Edit : my mistake, there is a concurrent GC in multiprocessor mode.
据说 Java 正在添加尾部调用。 当这种情况发生时,Clojure 就会获取它们。 同时,您可以使用循环/递归机制手动获取它们。
Java is supposedly adding tail calls. When that happens, clojure will get them. In the meantime, you can get them manually with the loop/recur mechanism.