Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] [ANN] ppx_deriving 1.0, ppx_deriving_yojson 2.0, ppx_deriving_protobuf 2.0
@ 2014-10-23 14:04 Peter Zotov
  0 siblings, 0 replies; only message in thread
From: Peter Zotov @ 2014-10-23 14:04 UTC (permalink / raw)
  To: caml-list

Hello,

I'm glad to announce the release of ppx_deriving and several
deriving plugins that I maintain. This release includes several
breaking changes; however, the interface can now be considered
stable and I do not expect it to change significantly.

The OPAM packages will be available shortly.

The two most important changes are:

   * The deriver names are now lowercase. I.e. you should replace
     all instances of [@@deriving Foo] with [@@deriving foo].

   * ppx_deriving now integrates better with ocamlfind.
     Specifically, it does not automatically discover the deriver
     plugins based on their names; rather, it now expects you to
     explicitly require the corresponding plugin.

     In order to write code that uses [@@deriving yojson],
     it is now enough to add -package ppx_deriving_yojson to
     the ocamlfind ocamlc command line, or package(ppx_deriving_yojson)
     to the _tags file.

     This will also automatically include any runtime component
     that a deriving plugin may need.

     The package ppx_deriving.std depends on all deriver plugins
     that come with ppx_deriving itself.

The changes were made in order to bring ppx_deriving closer to
type_conv and ease migration.

Some of the less important but interesting changes:

   * The [%derive.foo:] can now be shortened to [%foo:], given that
     deriving plugin foo is registered. For example, the following
     code will print a list of number pairs:

         print_endline ([%show: (int*float) list] pairs)

   * It is possible to combine several deriving plugins into a single
     executable, e.g. for cross-compiling:

         ocamlfind opt -predicates ppx_driver \
                       -package ppx_deriving_foo -package 
ppx_deriving_bar \
                       -package ppx_deriving.main -linkpkg -linkall \
                       -o ppx_driver

Full changelogs:

ppx_deriving 1.0
----------------

   * Make deriver names lowercase.
   * Remove Findlib+dynlink integration. All derivers must now be
     explicitly required.
   * Allow shortening [%derive.x:] to [%x:] when deriver x exists.
   * Make Ppx_deriving.core_type field optional to allow ignoring
     unsupported [%x:] shorthands.
   * Add support for [@@deriving foo { optional = true }] that does
     not error out if foo is missing, useful for optional dependencies.
   * Rename ~name and ~prefix of Ppx_deriving.attr and
     Ppx_deriving.Arg.payload to ~deriver.
   * Renamed Ppx_deriving.Arg.payload to get_attr.
   * Add Ppx_deriving.Arg.get_expr and get_flag.

ppx_deriving_yojson 2.0
-----------------------

   * Update to accomodate syntactic changes in _deriving_ 1.0.
   * Common helper functions have been extracted into
     ppx_deriving_yojson.runtime, reducing code size.
   * Add support for `[@@deriving to_yojson, of_yojson]`
     and `[%to_yojson:]`, `[%of_yojson:]` shortcuts.
   * Add support for `[@@deriving yojson { strict = false }]`.

ppx_deriving_protobuf 2.0
-------------------------

   * Update to accomodate syntactic changes in _deriving_ 1.0.

-- 
Peter Zotov

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-23 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 14:04 [Caml-list] [ANN] ppx_deriving 1.0, ppx_deriving_yojson 2.0, ppx_deriving_protobuf 2.0 Peter Zotov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox