ignoramous
ignoramous

Reputation: 89

Reading OCaml's Marshall Files in Java or Python

Is there a way to read OCaml's default serialization output (.marshall) in other programming languages, like Java?

I am aware of thrift/protobuf, both of which do support seralization for OCaml types. There a couple of options that help serializing the types to JSONs-- Anton Lavrik's excellent Piqi-lib and Martin Jambon's super Yojson. Generated JSONs are too huge (think GiBs), and seem ineffective, and we really don't want serialization/de-serialization to be as heavy a bottleneck + space inefficient. Not to mention the RAM usage!

Is there something else that I haven't explored which would let me read OCaml's default marshall output as-is in Java or Python?

Upvotes: 0

Views: 158

Answers (1)

ivg
ivg

Reputation: 35260

First of all you can use piqi lib to serialize to protobuf. That will be much more efficient in space and time. Also, take a look at cap'n'proto. It is available for all three, and is very fast (faster than protobuf). Other option, would be to use Janestreet bin_prot, but this will require you to write parsers in Python and Java, since it is only available to OCaml, currently.

And of course, it is impossible to read marshaled data in languages other then OCaml, since it is at least non-documented.

Upvotes: 2

Related Questions