Hi Metin,
Based on my experience, 1, 2 works really well. Piqi was pretty much created for this use case. It offers excellent support for both OCaml and Erlang. Protobuf serialization is pretty efficient in both runtimes. It has a non-0 overhead obviously, but it beats any ad-hoc protocol in terms of usability and extensibility. There are libraries out there for decoding External Erlang Term format in OCaml, but unless your protocol is trivial or you have unique performance constraints, Piqi/Protobuf is a better option.
Speaking of 3, I have no experience with using Piqi with js_of_ocaml/bucklescript. Protobuf stubs should in theory compile with bucklescript, but I would assume it would be way less efficient than using JSON. Piqi/JSON and Piqi-RPC/JSON works wonderfully when served by Eralng server. Piqi does not offer stubs generation for Bucklescript, so you'd have to encode/decode JSON manually. I've seen this working -- it is not too bad (it mainly relies on native JS JSON parser). Also -- I'd imagine that for someone who knows how to do it manually in Bucklescript, it would be rather trivial to add automated stubs generation for decoding Piqi/JSON for bucklescript to piqic-ocaml. I would be happy to include such functionality in the piqi-ocaml project if somebody contributes it.
Anton