Interesting talk on data layout in OCaml: https://www.youtube.com/watch?v=RV-4Xddk0Yc
Stephen Dolan :thumbs_up:
(I don't think he has published his caml-oxide rust/ocaml binding paper like he promised us ? :)
That was a cool talk. There is a crate implementing a "compact"
Option on crates.io, that is, an
Option<T> that's always the same size as a
T. It currently does so by providing a trait that you can implement to tell the type how to use the niche. So that's kind of what this talk shows for
nullable, but in OCaml it would be built into the language.
@gnzlbg were you referring to the optional crate, perhaps? Seems like a match to me
though I suppose in the case of
optional::Optioned<T>, the niche value has to actually be an instance of
T ... which is not exactly the same as a "true niche" the way that its done internally in Rust...
yes this one: https://github.com/llogiq/optional