Atdgen is a command-line program that takes as input type definitions in the ATD syntax and produces OCaml code suitable for data serialization and deserialization. Homepage: https://github.com/mjambon/atd
atdgen is now part of atd