> On Dec 15, 2015, at 6:21 AM, Paul Pelzl wrote: > > On Mon, Dec 14, 2015 at 9:25 AM, Chan Ngo > wrote: > An alternative, if you want to do as follows: > - Compile Java program to an executable (not jar file) > - Call this executable and get the return values from it > > So you can think about Unix module in OCaml, you can use the standard I/O to realize a communication channel between your OCaml code and the executable Java. > https://ocaml.github.io/ocamlunix/ocamlunix.html > > > If the data to be exchanged is structurally complex, then this technique becomes difficult; a cross-platform serialization library can be very helpful for generating appropriate serialization code in multiple languages. As one example, Cap'n Proto has bindings for both Java and OCaml: https://capnproto.org/otherlang.html Yes, I agree, in some cases, it will become difficult and we need a cross-platform serialization library. Your example is a good point. In addition, if you can control the source code of the Java side, you can modify the code such that it can return the result as JSON object then the OCaml side can get this object value to parse complex data structures. Best, --- Chan Ngo INRIA, (+33)02 99 84 72 84 chan.ngo@inria.fr http://people.rennes.inria.fr/Chan.Ngo