English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] factor 5 speed increase for natively compiled camlp4 parsers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-23 (15:07)
From: Michel Mauny <Michel.Mauny@i...>
Subject: Re: [Caml-list] factor 5 speed increase for natively compiled camlp4 parsers
Dear Henrik,

Hendrik Tews wrote/écrivait (Tue, Jun 08, 2004 at 01:17:27AM +0200):


> 1. Why is the -linkall neccessary? Its clear to me that one needs
>    the -linkall when building camlp4o. However, I don't
>    understand why camlp4o.opt needs the -linkall.

It is because of the programming style used in the modules to be
linked: some of them are not referenced (and therefore not linked in
without -linkall), but have useful actions in their initialisation
code, such as fill in an external reference with a function they've
just defined. The -linkall option makes sure that all initialisation
codes are executed.

Now I agree with you that it looks strange. What I did (in the CVS)
is to use -linkall for building camlp4.cmxa: this way your recipe
works even without -linkall.

> 2. Is the process that generates pa_o_fast.ml applicable to all
>    camlp4 grammars?

No: it relies on the particular structure of files pa_o.ml and

>    Why is it not used for the revised syntax?

I suspect the revised syntax is meant to stay extensible, and this
extensibility would be lost if the parser was compiled `as much as'
the one obtained in pa_o_fast. This is just a guess: I don't master all
Camlp4 secrets (yet) ;-)

>    What is the option -meta_action of pa_extend.cmo doing?

It decides wether actions are to be interpreted as expressions or
meta-expressions (expressions at the meta-level). In short, it decides
wether "2+3" is parsed as the expression 2+3 or the expression

> 3. Would it be possible to include a ``mknativecamlp4'' script
>    that automates the described procedure in the next
>    distribution?

I'll see what I can do, but note that this not a top priority right now.

>    Would it be possible to build and install pa_o.cmx, pa_op.cmx,
>    pa_o_fast.cmx, and odyl.cmx? 

Done in the CVS.


-- Michel

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners