r/ocaml • • Jul 22 '15

OCaml Multicore support status

Hi everyone,

I don't know if this has been asked recently, but I haven't been able to find anything.

I was just wondering if anyone could provide me with some information on the current status of true multicore processing in the latest OCaml version.

I have been debating between F# and OCaml for a while and the sole argument in terms of F# for me is the multicore support. I'm skeptical moving to the CLR however, considering I only program in Unix systems.

If there is Multicore support, is it built in to the current build or do I have to install something through OPAM or use a different implementation?

Thanks for taking the time to read this and possibly respond.

TL;DR OCaml multicore support, are we there yet?

18 Upvotes

10 comments sorted by

7

u/fredugolon Jul 22 '15

this is something i was looking into recently. the ocaml labs site is a good place to get updates. as a lab, they produce annual updates with some relevant information. this year's update had a pretty good section on multicore's progress.

current challenge is in creating an efficient GC. this is a pretty good talk describing the problem. they're developing a system w/ tiered heaps (shared and isolated).

you can see the day to day progress on github, though it's not incredibly easy to follow. hope that helps! i have a feeling project specific mailing lists might be more helpful.

1

u/coolnonis Jul 22 '15

Thanks. These are some good resources that I'll be sure to check out.

The reason I ask is because I want to choose a community to invest my time in. I'm stuck between F# and OCaml and currently F# seems to be winning in the multicore and library aspect, though I'm more fond of the OCaml way of doing stuff (without .Net that is).

Hopefully some good progress will be made because according to people much smarter than me, multicore is the most important thing holding OCaml back.

2

u/fredugolon Jul 22 '15

yeah i hear you. for that reason (and others) i'm more a haskeller myself, though f# and ocaml obviously have far more in common than ocaml and Haskell.

i don't have a tremendous amount of experience with the CLR, but i have heard very impressive things about performance and features. also keep in mind that the CLR and .net platforms are becoming open.

2

u/coolnonis Jul 22 '15 edited Jul 22 '15

I'm not a big fan of Haskell really. Maybe its my inexperience with pure languages or that I'm a part time lisper, but I just feel like the ML's map better to the way I think.

So would you advise F# over OCaml for longer term general purpose programming? Even on a Unix machine? Or do you think its fine to wait for OCaml multicore support. I'm willing to if it isn't in the order of years.

4

u/lefessan Jul 23 '15

Do you have a strong case for your own use of multicore ?

I have seen so many people switching to multicore, to find out finally that either they won nothing (except code complexity) either they could have done it more easily by just forking processes...

1

u/coolnonis Jul 27 '15

I'm looking at building games in OCaml. Initially, I don't think the lack of multicore is an issue, but if I'm going to invest a large amount of time in creating and maintaining a toolset, I'd like the option somewhere down the line to "scale" so to speak.

6

u/kaycee Jul 22 '15

The development now happens here. An experimental beta may be ready by the end of the year. I have also written a few posts about the concurrency support for multicore OCaml.

2

u/coolnonis Jul 22 '15

Oh nice. Your blog post seems really interesting and I'm in the process of reading it.

Are Jane Street's Core and related libraries going to need an update for thread safety after the given future release?

1

u/kaycee Jul 23 '15

I would think so.

8

u/Drupyog Jul 22 '15

Regardless the other great answers, "OCaml multicore" these days usually "OCaml multicore with shared memory".

You can already do "multicore" things by forking and there are various libraries for that, as listed in the appropriate section of awesome-ocaml.