ocaml-interop icon indicating copy to clipboard operation
ocaml-interop copied to clipboard

OCaml 5 support

Open mt-caret opened this issue 1 year ago • 3 comments

Hi!

In the same vein as https://github.com/zshipko/ocaml-rs/issues/125 I'd love to know if there are any plans to add support for OCaml 5, and if you have some roadblocks that you anticipate. I'm guessing bumping the version of boxroot and perhaps implementing something along the lines of https://github.com/tizoc/ocaml-interop/issues/42 to support the rules around the multicore runtime may be necessary, and I'd love to hear your thoughts on this (and would also be eager to work on any blockers if you're open to accepting PRs related to this)!

mt-caret avatar Dec 11 '23 13:12 mt-caret

Hi @mt-caret. There are plans for supporting OCaml 5 yes. A new release of boxroot is required that will fix a bug that is causing issues with OCaml 4.x, then some API changes are required in ocaml-interop (related to #42), which I already implemented a while ago, and just require some refining.

tizoc avatar Dec 11 '23 13:12 tizoc

I tried cloning this repo and updating the boxroot dependency to 0.3.0 and I got the following compilation error:

error[E0308]: mismatched types
  --> /home/patrick/code/ocaml/rust/ocaml-interop/src/boxroot.rs:29:31
   |
29 |             boxroot: unsafe { boxroot_create(val.raw) },
   |                               ^^^^^^^^^^^^^^^^^^^^^^^ expected `BoxRoot`, found `Option<BoxRoot>`
   |
   = note: expected struct `ocaml_boxroot_sys::BoxRoot`
                found enum `Option<ocaml_boxroot_sys::BoxRoot>`
help: consider using `Option::expect` to unwrap the `Option<ocaml_boxroot_sys::BoxRoot>` value, panicking if the value is an `Option::None`
   |
29 |             boxroot: unsafe { boxroot_create(val.raw).expect("REASON") },
   |                                                      +++++++++++++++++

So there is a little work to be done to make this compatible with the newer release of boxroot.

patrick-nicodemus avatar Aug 19 '24 05:08 patrick-nicodemus

Hey. It seems there have been updates on ocaml-boxroot, now mentioning OCaml 5 in the README: https://gitlab.com/ocaml-rust/ocaml-boxroot. Is there anything we could help with?

dannywillems avatar Sep 10 '24 21:09 dannywillems