caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] ppx_deriving 3.0
@ 2015-09-25 21:00 whitequark
  2015-09-25 21:13 ` Yaron Minsky
  0 siblings, 1 reply; 2+ messages in thread
From: whitequark @ 2015-09-25 21:00 UTC (permalink / raw)
  To: caml-list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] [ANN] ppx_deriving 3.0
  2015-09-25 21:00 [Caml-list] [ANN] ppx_deriving 3.0 whitequark
@ 2015-09-25 21:13 ` Yaron Minsky
  0 siblings, 0 replies; 2+ messages in thread
From: Yaron Minsky @ 2015-09-25 21:13 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

Jeremie just air-dropped about 25k lines of PPX code on github and opam, so
OCaml's PPX tools are finally out there.  You can find them here:

https://github.com/janestreet

On Fri, Sep 25, 2015 at 5:00 PM, whitequark <whitequark@whitequark.org>
wrote:

> 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 3621 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-25 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-25 21:00 [Caml-list] [ANN] ppx_deriving 3.0 whitequark
2015-09-25 21:13 ` Yaron Minsky

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).