Is INRIA going to add concurrency primitives to OCaml?

旧城冷巷雨未停 提交于 2019-12-05 19:09:29

问题


By "concurrency" I mean lightweight processes like Erlang's actors and concurrent GC aimed to make such a processes work smoothly.

It would be very cool if INRIA got rid of those drawbacks of the current OCaml implementation to make OCaml more prepared for the multicore future.

P.S. F# isn't what I'm looking for.


回答1:


no

I cannot be more concise without reproducing his explanation. It speaks for itself. Yes, this is from 2002, but I haven't heard him sway on the issue, and from the text, it doesn't seem probable at all that he would back down from these goals.

For current developments on concurrent functional programming, possibly MPI solutions (with ocaml bindings) might be a solution to your problem. Obviously this is not shared memory parallelism. There is also concurrent ML.




回答2:


There is J&oCaml, which is …

Objective Caml plus (&) the join calculus, that is, OCaml extended for concurrent and distributed programming.




回答3:


It seems that Jane Street has funded a project for adding Concurrent GC to OCaml

  • http://ocamlnews.blogspot.com/2008/04/ocaml-to-get-concurrent-garbage.html

  • http://groups.google.com/group/fa.caml/msg/735752c0a7a0ba4c




回答4:


The Thread module in the standard library provides concurrency primitives, and has been around for quite a while. There are also third party libraries which provide higher-level / different concurrency APIs.

But it sounds like you are conflating concurrency and parallelism.

OCaml of course doesn't get in the way of parallelism. You can run OCaml on thousands or millions of machines at the same time. There are even MPI bindings to make it easier to program for massively parallel supercomputers. But the current reference OCaml implementation will not automatically parallelize concurrent programs, which I think is what you're really more interested in.

You may be interested in Multicore OCaml which provides better support for shared memory parallelism, as SMP computers have become quite prevalent over the last couple decades and it would be really nice to more easily optimize for them. They appear to be making slow but steady progress and trying to get it right.



来源:https://stackoverflow.com/questions/1302272/is-inria-going-to-add-concurrency-primitives-to-ocaml

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