Ephemeron module

What is the ephemeron module referenced here in the rescript compiler?

I came across in in sexplib0 and wanted to see what it does but compiler says it doesnt know what it is.

Do we have access to it? And what does it do?

Thank you.

Ephemerons Ephemeron - Wikipedia is a way to interact with the garbage collector for values. In particular it makes it possible to safely garbage collect some structures with cycles where the reference is “weak”. Wikipedia has some examples of where they find use.

They were implemented in Ocaml 4.03 in 2014. But as they require some intricate GC interaction, I’m not sure about their implementation on top of a Javascript interpreter/JIT.

@jlouis thanks. Since the GC module is not available either, I guess its a legacy part of the compiler we are not supposed to be using.

More like, a non-portable library like Str or Unix because it depends on the OCaml native or bytecode runtime.

1 Like