JSON is ubiquitous & a bit of a lingua franca with fast serialization. However, JSON while being a bit bloated (can be saved on the wire by compression) also lacks a lot of valuable built-in types: maps, sets, dates, ADTs, etc. If using OCaml on both the front-end & back-end what alternatives are folks using to minimize loss of data type information …or is there such a performance gain to sticking JSON that any other encoding is just too slow? Are there XML, BSON, MessagePack, Avro, EDN or other users? Dhall or Nickel would cover a lot of the type+contractual information, but no parsers for the languages are available.
You can also see the serialization part of:
Atdgen has evolved to be quite advanced at handling OCaml/JSON interop, it seems to have support for quite a lot including variants.
I use ASN.1 when I can – you get