caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: whitequark <whitequark@whitequark.org>
To: caml-list@inria.fr
Subject: [Caml-list] [ANN] ppx_deriving 3.0
Date: Sat, 26 Sep 2015 00:00:45 +0300	[thread overview]
Message-ID: <6c322406f51662321d5f320f2e4f4f78@whitequark.org> (raw)

Hello,

I am glad to announce ppx_deriving 3.0. It brings two
major changes: hygiene and ppx_type_conv compatibility.
It is installable via opam[1].

First, hygiene. Earlier versions of ppx_deriving:
   1) assumed that all the modules that the deriver
      requires are not shadowed with a different signature;
   2) included user-specified code such as from [@default]
      attributes in a way that exposed deriver-internal
      identifiers to such code.

Now, ppx_deriving includes a mechanism for hygienic
unquoting[2], as well as a module[3] containing references
to most standard library modules under their proper names.
This allows it to coexist with e.g. `open Core.Std`.

Second, ppx_type_conv compatibility. You probably don't
know it yet, but Jane Street has converted all their syntax
extensions to ppx, so now there's ppx_type_conv, ppx_sexp_conv,
etc. I've coordinated the development of ppx_deriving with
Jane Street, so now ppx_deriving and ppx_type_conv use
the same syntactic conventions. In fact, they share
the [@@deriving] syntax without any effort from the user!

Furthermore, I have been looking at the sources of Jane Street's
ppx_core, ppx_driver, ppx_type_conv, etc and I find these
projects exceptionally well designed; further, they tackle some
important problems that ppx_deriving has explicitly left out of
scope, such as attribute hygiene.

While these libraries have a somewhat larger API, I think anyone
writing a new deriver should consider using ppx_type_conv.
I cannot outright recommend that since I have not actually
tried it (yet?), but it sounds worthwhile.

[1]: http://opam.ocaml.org/packages/ppx_deriving/ppx_deriving.3.0/
[2]: 
https://whitequark.github.io/ppx_deriving/Ppx_deriving.html#2_Hygiene
[3]: https://whitequark.github.io/ppx_deriving/Ppx_deriving_runtime.html

-- 
whitequark

             reply	other threads:[~2015-09-25 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 21:00 whitequark [this message]
2015-09-25 21:13 ` Yaron Minsky

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=6c322406f51662321d5f320f2e4f4f78@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;
as well as URLs for NNTP newsgroup(s).