From: Peter Zotov <whitequark@whitequark.org>
To: caml-list@inria.fr
Subject: [Caml-list] [ANN] ppx_deriving 1.0, ppx_deriving_yojson 2.0, ppx_deriving_protobuf 2.0
Date: Thu, 23 Oct 2014 18:04:32 +0400 [thread overview]
Message-ID: <5dc39ae7850ad5dbc7dd51387fe68ee8@whitequark.org> (raw)
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
reply other threads:[~2014-10-23 14:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5dc39ae7850ad5dbc7dd51387fe68ee8@whitequark.org \
--to=whitequark@whitequark.org \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox