caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] proposal for finding, loading and composing ppx preprocessors
@ 2014-07-11 13:31 Benjamin Canou
  2014-07-11 14:21 ` Daniel Bünzli
  2014-07-11 16:13 ` Alain Frisch
  0 siblings, 2 replies; 14+ messages in thread
From: Benjamin Canou @ 2014-07-11 13:31 UTC (permalink / raw)
  To: caml-list

   Dear OCaml'ers,

To accompany the arrival of annotations in the forthcoming release, we 
propose to discuss and hopefully agree on a standard way of selecting 
the adequate preprocessor(s) for a given file. Gerd already introduced a 
mechanism in the last version of OCamlFind, that we'd like to extend as 
follows.

Our idea is to indicate via a pragma inside the file, how it has to be 
processed. You can see that as a machine readable way of writing (* this 
file has to be preprocessed with blah using options blah *). For this, 
we propose that build systems use a default preprocessor systematically, 
that would interpret these pragmas and find and call its fellow 
preprocessors accordingly.

The compiler already provides built-in annotations. In a way, it's a 
second predefined layer, this time for the build system.

We designed and prototyped such a tool [1], which understand annotations 
of the form [@@@ syntax "package"], to preprocess the following code 
using the ppx declared in the corresponding OCamlFind package.

The tool also defines a way to register plug-ins instead of executables 
so preprocessors can be dynlinked instead of called as processes.

Extensions could be:
  - delimiting a fragment of the code to process
  - add a way to associate a given annotation identifier to a 
preprocessor, so that only the mother preprocessor would do the tree 
traversal, specific preprocessors only seeing the nodes they are 
actually interested in.
  - other kind of pragmas for the build system ?

Again, the goal is to agree now on a standard way and avoid the mess we 
had with camlp4. What do you think ?

   Benjamin, Grégoire and Pierre @ OCamlPro.

[1] https://github.com/hnrgrgr/ppx_loader

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

end of thread, other threads:[~2014-07-15 15:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 13:31 [Caml-list] proposal for finding, loading and composing ppx preprocessors Benjamin Canou
2014-07-11 14:21 ` Daniel Bünzli
2014-07-11 14:36   ` Peter Zotov
2014-07-11 14:49     ` Daniel Bünzli
2014-07-11 14:55       ` Peter Zotov
2014-07-11 14:52     ` Mark Shinwell
2014-07-11 15:27     ` Anil Madhavapeddy
2014-07-11 15:35       ` Mark Shinwell
2014-07-11 14:55   ` Benjamin Canou
2014-07-11 15:23     ` Daniel Bünzli
2014-07-11 16:00       ` Benjamin Canou
2014-07-11 16:13 ` Alain Frisch
2014-07-15 13:59   ` Benjamin Canou
2014-07-15 15:56     ` Alain Frisch

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