caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremie Dimino <jdimino@janestreet.com>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: "ocaml-core@googlegroups.com" <ocaml-core@googlegroups.com>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] [ANN] Jane Street's ppx rewriters
Date: Mon, 5 Oct 2015 21:40:11 +0100	[thread overview]
Message-ID: <CANhEzE4EJ20rq9bzeH-MVbG-P8n8D+=pqqzd3khz9FAhzA3qPg@mail.gmail.com> (raw)
In-Reply-To: <CAPFanBHr8=SBd1chLMAh6yOjvEpeq2xE50zxgYu9Qc4t4uAcyg@mail.gmail.com>

On Mon, Oct 5, 2015 at 2:48 PM, Gabriel Scherer
<gabriel.scherer@gmail.com> wrote:
> Do you plan provide any backward-compatibility guarantees for
> ppx-core, or do you plan the helpers there to mirror changes to
> upstream parsetree?

Good question. Currently most of the helpers are auto-generated from
the signature of Parsetree. Using names that closely matches the ones
in parsetree.mli. These will surely change as Parsetree changes. Then
we have additional helpers with different names for common use, these
will probably be backward compatible. Going forward we'll add more
such helpers to improve compatibility between versions of the
parsetree.

You can see the interface for these helpers here:

  https://github.com/janestreet/ppx_core/blob/master/src/ast_builder.ml
  https://github.com/janestreet/ppx_core/blob/master/src/ast_builder_intf.ml

And for patterns:

  https://github.com/janestreet/ppx_core/blob/master/src/ast_pattern.ml
  https://github.com/janestreet/ppx_core/blob/master/src/ast_pattern_intf.ml

> (I think there would be a place in the ppx ecosystem for a library
> that allows users to write rewriters on their current OCaml version,
> and know that they will still compile and be useable to preprocess
> OCaml code for future versions. This may require an API with explicit
> versioning.)

Sure. But having backward-compatible helpers for building the AST
is not enough as your patterns will still break. We have [Ast_pattern]
which is often enough for matching the payload of attributes and
extensions, but it doesn't conveniently replace all pattern matchings.

-- 
Jeremie

      reply	other threads:[~2015-10-05 20:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 13:40 Jeremie Dimino
2015-10-05 13:48 ` Gabriel Scherer
2015-10-05 20:40   ` Jeremie Dimino [this message]

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='CANhEzE4EJ20rq9bzeH-MVbG-P8n8D+=pqqzd3khz9FAhzA3qPg@mail.gmail.com' \
    --to=jdimino@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    --cc=ocaml-core@googlegroups.com \
    /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).