On Thu, Jun 3, 2021 at 7:18 PM Christophe Raffalli <christophe@raffalli.eu> wrote:

Hello dear camlers,

I just noticed that in 4.12+effect, in the road to multicore, we have now the
nice exception:

  Failure("Serializing closures is broken in multicore")

This is a bit a pity: if you want to use both multicore and multi-machine
parallelism, then, marshalling closures was useful for communication between
machines in some cases. Is it a final decision or serialization of closures will
be lost forever in OCaml ?

I was not aware of this limitation of Multicore OCaml, and looking at its git history, it looks like it was introduced very early in the development, perhaps to make things simpler initially.

Marshalling of function closures has always been sort of experimental and not super reliable, but I was not expecting it to be incompatible with Multicore OCaml.  We (the core dev team) will sort it out.

Kind regards,

- Xavier Leroy


Remark: Closures is not marked as obsolete in Marshal.mli

Cheers,
Christophe