Hi, I would like to achieve something similar to, but different from what is discussed in OCaml in Jupyter-based Environments . tl; dr: How can I get python REPL access to OCaml values exported via
The use case is this: I have an OCaml library that does machine-learning type computation. I would like to generate, plot and analyze the results interactively, with the best possible ease of use and flexibility. For the plotting and analysis I want to use Python.
I have tried
ocaml-jupyter, which provides a nice notebook environment but no python kernel and the very useful
ocaml-matplotlib which offers a matplotlib binding but cannot cover all my python library needs.
A possible solution would be to use
pyml and its numpy array memmapping support to export OCaml values to a python process. The problem here is that I can’t find a way to interact with the python process spawned from
pyml in an interactive python console. I am thinking there should be some way to spawn a Jupyter python kernel from
pyml and then access that from a separate jupyter console. I have not been able to find one by googling though.
Another solution might be to wrap my OCaml library as an external python module. I’m afraid that this may be painful – please convince me otherwise