caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dario Teixeira <dario.teixeira@nleyten.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] META file standards for ppx extensions
Date: Thu, 09 Apr 2015 13:24:24 +0100	[thread overview]
Message-ID: <d8a23c877189537c81524be5df2b4377@nleyten.com> (raw)
In-Reply-To: <1428576994.22412.21.camel@e130.lan.sumadev.de>

Hi,

> There is still the question how to set the standard. Just talking
> about it isn't sufficient. My thinking here is that there should
> be a couple of pointers into the right direction giving advice to
> the developers.  There could be a good ppx example in the findlib
> manual (or maybe a link to a blog post explaining the issue).

Fair point.  At the end of this email I'm posting a first draft of
META samples for all ppx variations.  (It's bound to be incomplete
and/or contain errors, so please share additions and/or corrections!)


> I'm also thinking about a helper inside ocamlfind, maybe
> 
> ocamlfind check META
> 
> that would (a) search for hard errors, and (b) give
> recommendations. For example, if a library cannot be linked at all,
> or not be loaded into the toploop, this would be (a). If the ppx
> preprocessor isn't separated from the runtime, this would be (b)
> (i.e. using ppx together with archive).

That would be interesting indeed.


> Do we have a project that could be used as reference for ppx?

LWT is doing things the right way, I think.

Best regards,
Dario Teixeira


####################################################################

META file skeletons for ppx extensions, 1st draft:

Broadly, there's three types of packages defining ppx extensions:
1) libraries where ppx is optional candy, 2) primarily ppx extensions
with mandatory runtime, and 3) primarily ppx extensions without
runtime.  I've named the sample packages for each case as Fooloot,
Foolex, and Foonad, respectively.  Below you'll find sample META
files for each case.


1) Package "Fooloot" is like LWT: it's a library that can be used
    without a camlp4/ppx extension, but it also offers an optional
    camlp4 and/or ppx extension.

    ###### META begins #####
    version = "1.0"
    description = "Fooloot library"
    archive(byte) = "fooloot.cma"
    archive(byte, plugin) = "fooloot.cma"
    archive(native) = "fooloot.cmxa"
    archive(native, plugin) = "fooloot.cmxs"

    package "syntax" (
      version = "1.0"
      description = "Camlp4-based syntax extension for Fooloot"
      requires = "camlp4 fooloot"
      archive(syntax, preprocessor) = "pa_fooloot.cma"
      archive(syntax, toploop) = "pa_fooloot.cma"
      archive(syntax, preprocessor, native) = "pa_fooloot.cmxa"
      archive(syntax, preprocessor, native, plugin) = "pa_fooloot.cmxs"
    )

    package "ppx" (
      version = "1.0"
      description = "New-style (ppx) syntax extension for Fooloot"
      requires = "fooloot"
      ppx = "ppx_fooloot"
    )
    ##### META ends #####


2) Package "Foolex" is like Sedlex: it's used only as a ppx
    extension, but it requires a runtime.

    ###### META begins #####
    version = "1.0"
    description = "Foolex library"
    archive(byte) = "foolex.cma"
    archive(byte, plugin) = "foolex.cma"
    archive(native) = "foolex.cmxa"
    archive(native, plugin) = "foolex.cmxs"

    package "ppx" (
      version = "1.0"
      description = "New-style (ppx) syntax extension for Foolex"
      requires = "foolex"
      ppx = "ppx_foolex"
    )
    ##### META ends #####


3) Package "Foonad" is like ppx_monad: it's used only as a ppx
    extension, and it requires no runtime.

    ###### META begins #####
    version = "1.0"
    description = "Foonad"

    package "ppx" (
      version = "1.0"
      description = "New-style (ppx) syntax extension for Foonad"
      ppx = "ppx_foonad"
    )
    ##### META ends #####


  reply	other threads:[~2015-04-09 12:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 18:20 Dario Teixeira
2015-04-08 18:59 ` Drup
2015-04-08 19:59   ` Dario Teixeira
2015-04-08 20:37     ` Daniel Bünzli
2015-04-09 10:07       ` Dario Teixeira
2015-04-09 10:56     ` Gerd Stolpmann
2015-04-09 12:24       ` Dario Teixeira [this message]
2015-04-09 15:33         ` Daniel Bünzli
2015-04-09 16:45           ` Gerd Stolpmann
2015-04-09 17:27             ` Daniel Bünzli
2015-04-09 18:05               ` Daniel Bünzli
2015-04-09 22:26                 ` Gerd Stolpmann
2015-04-09 22:21               ` Gerd Stolpmann
2015-04-09 23:06                 ` Daniel Bünzli
2015-04-10  8:53                   ` François Bobot
2015-04-10  9:42                     ` Daniel Bünzli
2015-04-10 10:09                       ` Alain Frisch
2015-04-10 11:45                         ` Thomas Gazagnaire
2015-04-10 11:04                       ` François Bobot
2015-04-10 11:55                         ` Daniel Bünzli
2015-04-10 16:33                           ` François Bobot
2015-04-10 17:43                             ` Daniel Bünzli
2015-04-12  6:00                       ` Anil Madhavapeddy
2015-04-10 11:25                   ` Gerd Stolpmann
2015-04-10 11:55                     ` Daniel Bünzli
2015-04-09 15:45         ` Thomas Gazagnaire
2015-04-09 16:28           ` Dario Teixeira
2015-04-09 16:51             ` Gerd Stolpmann
2015-04-10 12:23         ` Daniel Bünzli
2015-04-10 14:55           ` Gerd Stolpmann

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=d8a23c877189537c81524be5df2b4377@nleyten.com \
    --to=dario.teixeira@nleyten.com \
    --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).