News for hackers. Stuff that matters.
Re:OCaml for the Masses (2011) by ynniv on Monday November 26, 2018 @07:48AM (#18532938)
I want to spend more time in OCaml, but without threads it's a tough sell. Modern performance requires parallelism with shared memory, and the current mainline solutions don't offer that.

Where threads aren't part of the equation, OCaml has become suddenly popular. That's telling.

Re:OCaml for the Masses (2011) by jasim on Monday November 26, 2018 @07:54AM (#18532952)
https://pl-rants.net/posts/go-and-ocaml-scalability/ has an interesting take where they found multi-process OCaml performing better than goroutines. I don't know how to interpret those measurements correctly, so any help there would be appreciated.
Re:OCaml for the Masses (2011) by ynniv on Monday November 26, 2018 @08:03AM (#18533010)
This experiment has "embarrassingly parallel" data, ie there is little to no benefit to sharing data between computations. It's not surprising that multiprocess does well on this, but this is not common in most real world applications. Imagine a simple chat server, where every request needs to read and write shared state. Even when the application doesn't seem to have shared state, any in-memory caching requires it.
Re:OCaml for the Masses (2011) by anentropic on Monday November 26, 2018 @10:49AM (#18534118)
"most real world applications" is a meaningless phrase, I doubt anyone can quantify "real world applications" one way or the other

also the result is still interesting, why wouldn't goroutines scale just as well, but apparently didn't?

Re:OCaml for the Masses (2011) by ynniv on Monday November 26, 2018 @12:46PM (#18535232)
That's fair, but perhaps I can rephrase it to say that embarrassingly parallel applications are a well known edge case and not the norm.
Re:OCaml for the Masses (2011) by jasim on Monday November 26, 2018 @08:42AM (#18533247)
That makes sense. Thanks.
Re:OCaml for the Masses (2011) by styluss on Monday November 26, 2018 @08:06AM (#18533024)
Did you try Lwt/Async? I'm a ocaml novice and i'm curious how far one can get with them.
Re:OCaml for the Masses (2011) by siftikha on Monday November 26, 2018 @09:08AM (#18533418)
Neither lwt nor async allow for parallel execution cause of the Gil. They are akin to async await in Python
Re:OCaml for the Masses (2011) by mseri on Monday November 26, 2018 @04:47PM (#18537113)
Correct. For parallel execution you can use parmap or a submodule of ocamlnet that I never remember