[wg-camlp4] Structured comments, shallow embeddings and deep quasiquotations

Alain Frisch alain.frisch at lexifi.com
Tue Feb 5 15:34:33 GMT 2013

Hi Gabriel,

On 02/05/2013 03:51 PM, Gabriel Scherer wrote:
> A reasonable compromise I would see between the point of view of Alain
> and Jeremy/Leo is to have an "unsafe" interface for global
> preprocessing, which we would discourage people from using by being
> very good at breaking backward compatibility (we can do better than
> Camlp4!), and *maintaining* at the same time one or several safer
> entry point that provide the local structure and conventional syntax
> that we think will bring more robustness to syntax extensions (like
> type-conv can currently be seen as a protective hub around type-driven
> boilerplate generation)

Why not, but I'm still not convinced that the "unsafe" interface will 
create actual interaction problems between extensions, which cannot be 
solved by a proper ordering between -ppx rewriters.

Can we try to come up with some realistic example of potential problems 
before considering solutions to address those problems?

> - Leo suggests using an in-language feature (namespaces) to handle
> addressing of syntax extensions; what is the picture of
> outside-language tools to do this? I've had reasonable luck using
> 'ocamlfind' as a backbone for plugin discovery in Stog. Is this what
> Alain imagine users will use? Is it portable to Windows-land?

As long as ppx rewriters are specified purely on the command-line, 
ocamlfind do the lookup quite easily:

ocamlfind ocamlc -c -package sedlex -ppx "ocamlfind sedlex/sedlex.exe" 

(this already works)

I don't see any Windows-specific problem here (but I've not tried to use 
ocamlfind under Windows for a long time).

A more ambitious proposal is to let rewriters be specified in the source 
code.  Gerd has described a way to combine this with ocamlfind without 
forcing a dependency on ocamlfind.  I'm still undecided on whether it is 
good or not to specify rewriters in the source code.


More information about the wg-camlp4 mailing list