caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "blue storm" <bluestorm.dylc@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OSR: META files for packages containing syntax extensions
Date: Thu, 13 Mar 2008 18:08:52 +0100	[thread overview]
Message-ID: <527cf6bc0803131008y151941a3ka3b9e50721ba3229@mail.gmail.com> (raw)
In-Reply-To: <1205422246.31340.1.camel@flake.lan.gerd-stolpmann.de>

> Topic for discussion: for the sake of standardisation, it would be
> nice if all packages of this type were to share a common prefix.
> The most obvious candidate is "pa_".

Though this can be refined later, i think we could do something a bit
more elaborate there.
I have not used camlp4 pre-3.10 (camlp5 these days), but if i
understood correctly, prefixes were used to describe the internal
machinery of the extension : pa_ denotes a parser extension, while pr_
denotes a printer extension. I do not know of any other prefix.

With the new camlp4, those suffixes are not required, but they were
kept in order to ease the transition (i'd assume pa_r.cmo actually
refers to Camlp4Parser/Camlp4OCamlRevisedParser.cmo). This is a good
idea imho, but i think that if we stick to that convention (describing
the actual effect of an extension in his name) we should adopt a
naming convention a bit more powerful, to reflect the actual abilities
of camlp4 : for example, we can have AST filters, wich are neither
parsers nor printers.

Here would be a draft suggestion concerning this naming scheme :
- pa_ for parsers
- pr_ for printers
- pf_ for filters
- p_ in uncertain cases

Some extensions use eg. both a parser and a filter; i guess they'd
need to chose the most meaningful prefix (are they primarily intended
to modify the existing syntax, or change a behavior ?).
There are some code that can be described as a "syntax extension", but
that does not use any of the camlp4 parser/printer/filter tools. The
'extensions' using the library type-conv (
http://www.ocaml.info/home/ocaml_sources.html#type-conv ), for
example, use a specific registration mechanism. I guess the p_ prefix
would be appropriate for those corner cases.

I think it is important to keep a camlp5 compatibility (even if i'm
not sure ocamlfind support camlp5 yet); the re-use of the standard
prefixes provide this.



> Another common occurrence is for the syntax extension to rely on a runtime
> module or library included with the package.

Another common case is when the syntax extension rely on a
preprocessor-time module or library (eg. type-conv). It could be
helpful to add a description of that possibility.

Is there a way to specify a dependency on a specific preprocessor
(between camlp4o and camlp4r, for example ?). Most extension actually
won't work with both syntaxes (classical and revised), and it could be
helpful to make it apparent in the package description (although most
of the time an horrible preprocessor-runtime error will happen).
More generally, i'm concerned with the possible incompatibilities
between syntax extensions (however, this may be a bit off-topic).


Thanks for that very useful proposal.


  reply	other threads:[~2008-03-13 17:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 12:40 Dario Teixeira
2008-03-13 13:14 ` Sylvain Le Gall
2008-03-13 13:21   ` Eric Cooper
2008-03-13 13:30     ` Sylvain Le Gall
2008-03-14 15:00       ` [Caml-list] " Dario Teixeira
2008-03-14 14:53     ` Dario Teixeira
2008-03-14 14:52   ` Dario Teixeira
2008-03-14 15:09     ` Sylvain Le Gall
2008-03-14 15:41       ` [Caml-list] " Dario Teixeira
2008-03-13 15:05 ` [Caml-list] " Stefano Zacchiroli
2008-03-13 15:30   ` Gerd Stolpmann
2008-03-13 17:08     ` blue storm [this message]
2008-03-14 15:33       ` Dario Teixeira
2008-03-14 15:51         ` Gerd Stolpmann
2008-03-16 21:34 ` [Caml-list] OSR: META files for packages containing syntax extensions (take 2) Dario Teixeira

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=527cf6bc0803131008y151941a3ka3b9e50721ba3229@mail.gmail.com \
    --to=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.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).