# ppx_deriving

ppx_deriving is an OCaml library and syntax-extension framework that generates boilerplate code from type declarations through plugins such as show, eq, ord, enum, iter, map, fold, make, yojson and protobuf.

ppx_deriving lets an OCaml type declaration carry a [@@deriving plugin] annotation that triggers code generation for that type, such as printing, equality, ordering, enumeration, iteration, mapping or folding, or serialization to Yojson or Protobuf. It installs via OPAM and integrates with build systems including ocamlbuild and Dune, where Dune's pps directive can link several preprocessors into a single executable to speed up compilation on large projects.

The project has been maintained since 2014, and for new deriving plugins the maintainers now recommend using ppxlib directly, whose Ppxlib.Deriving module offers similar functionality with tighter integration and a nicer API. ppx_deriving itself continues to be maintained so that its existing plugins keep working.

Website: https://github.com/ocaml-ppx/ppx_deriving
