I am trying another approach... it might make more sense for me to embed the Ocaml into C++.
I have read the instructions, and it seems feasible, except that I have a few questions:
- All I need to pass, as arguments, are int, float, string, and arrays of these. Any example of how to deal with the arrays?
- How can I return arrays, in a way that C or C++ understands? How can I return tuples, i.e., how can I return multiple values from Ocaml to C?
- Finally, do I need to worry about the Ocaml garbage collector, if I call Ocaml from C/C++? Will it run every now and then? How can the garbage collector know whether a value returned by an Ocaml function is still being used in C/C++? How can I tell it that it is no longer used?
The problem I am trying to solve seems to be a can of worms from whichever angle I take it...
Luca