4 ms·
Hello sadiq, I have some more general questions for you: As understand that currently, the situation is analogous to Python. The GIL allows for process based c
by wuschel 5y ago
Hello sadiq, I have some more general questions for you:
As understand that currently, the situation is analogous to Python. The GIL allows for process based concurrency, with the well known disadvantage regarding memory consumption. Also, my guess is that OCaml relies library based solutions at the moment?
1) What does the introduction of MultiCore potential mean for Ocaml? Will Ocaml be a much better fit to run a webserver backend? Could you perhaps give a comparison to other programming languages?
2) How will Ocaml stand out with Multicore in the PL world, and what solutions would be it uniquely suited for?
3) What tools are going to be present to deal with bugs introduced by your new runtime e.g. race conditions?
4) If one wants to have a go at Multicore and play around with it, where/how do I start?
Many thanks!
- sadiq 5y agoGood questions! 1) As I mentioned in https://news.ycombinator.com/item?id=27142502 https://news.ycombinator.com/item?id=27142502 there is support for parallelism and concurrency. Giving an example of where these might be useful in a webservice. The addition of shared-memory parallelism is beneficial where you might have a great deal of shared state that needs to be used to service requests. An in-memory cache is a good example - with a processed-based approach managing read/writes and avoiding significant overhead from marshalling the data is difficult. Concurrency via effects at a minimum can make writing network-based services much more pleasant (and debuggable!). See the examples in https://arxiv.org/abs/2104.00250 https://arxiv.org/abs/2104.00250 where programs can be written in a direct-style similar to blocking IO but using effects are transformed to use asynchronous interfaces. There's work going on in the project at the moment to build fast cross-platform IO implementations that sit atop of uring/gcd/iocp. 3) This is a good question and one we're still working on. I think one of the lead developers KC has a few good ideas about instrumentation we can do to enable detecting races to global state. It's certainly going to be an issue for people porting large codebases. 4) This is the place to start: https://github.com/ocaml-multicore/multicore-opam#install-multicore-ocaml https://github.com/ocaml-multicore/multicore-opam#install-mu... .
- wuschel 5y agoThank you for the your answer! I will check out the URIs.