News for hackers. Stuff that matters.
Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @09:48AM (#29875599)
As usual I'm happy to answer any questions I can.

(for maybe the second to last time)

Re:OCaml Multicore merged upstream by Zababa on Monday January 10, 2022 @11:26AM (#29877215)
What's next after this? There are a lot of different projects ongoing for OCaml (typed effects, modular explicits/implicits, all of the RFCs, flambda and flambda 2, and I'm probably forgetting a lot of them). However, while following the progress of OCaml Multicore was easy thanks to the monthly posts, it's a bit harder to know where the focus will be next. Is there something like a "state of OCaml" that's planned, or a roadmap?

Congratulations on the merge, and thank you for all the work that went into it!

Re:OCaml Multicore merged upstream by octachron on Monday January 10, 2022 @12:19PM (#29878092)
Few of those projects are still at the research stage (typed effects, modular implicits, unboxed types), with a handful of people working on them at most.

It is hard or even counter-productive to try to fit them on a roadmap.

The multicore project is(was?) a bit unusual from the point of view of OCaml development since it is a massive engineering effort with a focused team.

Nevertheless, I hope that we continue and extend the "OCaml compiler bimonthly" news to give more information about the ongoing work on the compiler.

Re:OCaml Multicore merged upstream by Zababa on Monday January 10, 2022 @01:29PM (#29879216)
Thank you for the explanation. I hope too you will continue the OCaml compiler bimonthly, it's always an interesting read, and it's nice to be up to date with what's happening.
Re:OCaml Multicore merged upstream by systems on Monday January 10, 2022 @10:01AM (#29875828)
For the not so OCaml savvy, can you recommend a blog post that explain, what programming constructs this adds

Maybe a before and after, but one that focus on expressiveness, what you were not able to say/express in OCaml before, that is now* possible

not just speed or performance

*s/not/now

Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @10:23AM (#29876210)
Good question!

https://github.com/ocaml-multicore/effects-examples has links to tutorials and examples for how effects can be used.

There's also some slides from KC's talk on effect handlers https://kcsrk.info/slides/handlers_edinburgh.pdf and materials from the CUFP 17 tutorial: https://github.com/ocamllabs/ocaml-effects-tutorial

https://gopiandcode.uk/logs/log-bye-bye-monads-algebraic-eff... this is also a great introduction

Re:OCaml Multicore merged upstream by yodsanklai on Monday January 10, 2022 @10:48AM (#29876602)
What were the main technical challenges? why did it take so many years? did it take research breakthrough, or was it something else (organisational issue / technical debt...)?
Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @11:06AM (#29876899)
It involved a fair amount of research and there were many technical challenges. Maintaining backwards compatibility in terms of language features and single-threaded performance puts constraints around what you can implement. Also from my personal experience, debugging segfaults in parallel programs that could be caused by GC bugs is a painstaking process.

We've written a couple of papers detailing the internals and the trade-offs involved: https://arxiv.org/abs/2004.11663 (for parallelism) and https://arxiv.org/abs/2104.00250 (for effects)

Added to that is the complexity of tracking a moving target. Multicore had to be rebased through 12 releases of OCaml, which in itself was a non-trivial amount of work.

Re:OCaml Multicore merged upstream by Operyl on Monday January 10, 2022 @10:48AM (#29876603)
Perhaps not the question you expected, but ..

> (for maybe the second to last time)

How come?

Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @10:58AM (#29876758)
With the merging to trunk, Multicore doesn't really exist as a separate project. The last major milestone that is likely to have a multicore-dominant discussion thread is probably the 5.0 release.
Re:OCaml Multicore merged upstream by tyre on Monday January 10, 2022 @12:22PM (#29878148)
As someone who has worked so long on the project, how do you feel? Relieved?
Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @02:46PM (#29880824)
Hah. I only contributed to the project for about half it's life.

There's still a lot of work to be done before 5.0 is released, it's just it'll happen through the usual PR and review process rather than a separate one.

Re:OCaml Multicore merged upstream by Zababa on Monday January 10, 2022 @02:04PM (#29879907)
Maybe a bit of a stupid question, but, will the compiler itself evolve to use multiple cores?
Re:OCaml Multicore merged upstream by sadiq on Monday January 10, 2022 @02:49PM (#29880900)
Not a stupid question. I think adding parallelism to the compiler might be possible, though there are certainly parts that use a lot of mutable state that could prove tricky.

Whether it's beneficial or not is unclear though.

Re:OCaml Multicore merged upstream by maxwell86 on Monday January 10, 2022 @11:41AM (#29877470)
Can you recommend a good resource for getting started with OCaml ?
Re:OCaml Multicore merged upstream by av_conk on Monday January 10, 2022 @12:25PM (#29878195)
Real World OCaml (https://dev.realworldocaml.org/) is a great one.
Re:OCaml Multicore merged upstream by gmfawcett on Monday January 10, 2022 @04:44PM (#29883078)
Books, videos, and other good resources are listed here: https://ocaml.org/learn/

This course text is also great, I don't know if it's listed at ocaml.org/learn or not:

https://cs3110.github.io/textbook/

Re:OCaml Multicore merged upstream by HellsMaddy on Monday January 10, 2022 @10:57PM (#29887334)
+1 for CS 3110 (OCaml Programming: Correct + Efficient + Beautiful), and the video series is similarly excellent: https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b...