I am happy to announce a new release of Camlp4s 4.02.
Camlp4s is the classical Camlp4 compatible with all versions of OCaml
from 3.08.1 to 3.11.
Main page and download at:
http://pauillac.inria.fr/~ddr/camlp4s/
What is new:
Pretty print
* a new system of pretty print of ocaml programs:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/opretty.html
* an original library module for pretty printing data and programs:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/pretty.html
Parsing
* a full documentation of streams parsers, including 3 new features:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/parsers.html
* lexers: a short syntax for parsers of streams of type char:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/lexers.html
* a documentation for purely functional streams and parsers:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/fparsers.html
Other
* a documentation for the extensible functions:
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/extfun.html
* directive "pragma" allowing evaluations at parse time (experimental):
http://pauillac.inria.fr/~ddr/camlp4s/doc/html/pragma.html
Enjoy !
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
What do you think?
On Jul 9, 2007, at 10:40 AM, Daniel de Rauglaudre wrote:
> Hello everybody,
>
> I am happy to announce a new release of Camlp4s 4.02.
>
> Camlp4s is the classical Camlp4 compatible with all versions of OCaml
> from 3.08.1 to 3.11.
--
http://topdog.cc - EasyLanguage to C# compiler
http://wagerlabs.com - Blog
Dypgen based on the fly extensions will replace both :)
FYI .. the Felix programming language grammar is now loaded
from the library as text. This is made possible by two technologies:
* Dypgen is an extensible GLR parser, which allows new grammar
productions to be added to a grammar during parsing.
The LR0 kernel is rebuilt when this happens. The current
encoding is very fast.
* OCS Scheme is used to encode the user actions as text which
is executed to create an Ocs_types.sval or Scheme value
(aka s-expression). The s-expressions are translated to the
usual Felix AST terms built with polymorphic variants.
The syntax definitions and extensions are properly scoped
by the grammar itself.
Both camlp4's suffer from the weakness of being separated
from the user program text. This is a software engineering
disaster, because it means an '*.ml' file can't just be
compiled. You have know, through magic, ESP, or RTFM which
preprocessor has to be used to compile it (and you have
to make sure you compiled that too).
At the very least, Ocaml should be modified to add a new
statement/directive such as:
syntax fred;;
which tells the reader and the compiler which syntax extension
has to be used to interpret the rest of the program. That way
it might be loaded automatically, and, programs like ocamldoc
and ocamldep can proceed without the user having to keep
track of the language of every file separately from the file itself.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
Ugh, don't say that - I've been writing & upgrading extensions to use
the new camlp4 ...
Rich.
--
Richard Jones
Red Hat
On Mon, Jul 09, 2007 at 09:28:05PM +1000, skaller wrote:
> At the very least, Ocaml should be modified to add a new
> statement/directive such as:
>
> syntax fred;;
This exist ! You can use :
#load "fred.cmo";
Which is equivalent to put "fred.cmo" as parameter of Camlp4.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
yes, but it only works in the top level, where it is a burden.
It doesn't work where it is actually needed: batch compilation.
besides .. that command does dynamic loading, which is not
the same as specifying a syntax. For dynamic loading
the syntax is evil: the .cmo should not be required
(it could be native code loading native code .. :)
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
no, it works with camlp4 (the "old" one at least).
On Tue, Jul 10, 2007 at 07:08:39PM +1000, skaller wrote:
> > #load "fred.cmo";
>
> yes, but it only works in the top level, where it is a burden.
> It doesn't work where it is actually needed: batch compilation.
Yes, it does ! It has the same syntax than in the toplevel because it
has the same semantics : loading. In batch compilation, it means
"load in the preprocessor context".
> besides .. that command does dynamic loading, which is not
> the same as specifying a syntax.
I am sorry, but do you know that when you use "open Module" in a file,
the file "module.cmi" is "dynamically loaded" in ocamlc ? Ok, this is
not code, but it is the same idea: loading something in the compiler
to change its behaviour.
If you don't like the syntax "#load", ok, but the semantics is correct
and fully consistent with the same one in the toplevel.
> For dynamic loading the syntax is evil: the .cmo should not be
> required
This is not evil, this is great ! All the principle of camlp4 is that
syntax extensions are code previously compiled (therefore compilable)
and loaded in the preprocessor.
Well, if you want to "hide" that to the user, ok, but it is a problem
of "shell", not a problem of "kernel". Camlp4 is good in its fundamental
principles.
And I defend the idea that syntax extensions are loaded code. This is
Michel Mauny's basic idea and I agree with him. It is a the beauty of
camlp4.
> (it could be native code loading native code .. :)
It cannot be native code, because camlp4 uses only bytecode, and
the "#load" being done in the preprocessor, there is no difference
whether you compile your file by ocamlc or ocamlopt.
This "#load" does not mean "load in the program" but "load in the
preprocessor". This is a *directive*, indicating clearly that it is
information for the compiler, not for the user program.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
Does this also mean that it can be installed as a drop-in extension on
top of OCaml >= 3.10? Would CamlP4s conflict with the new CamlP4 which
is shipped by OCaml itself?
Thanks in advance for your answers,
Cheers.
--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the
(15:57:15) Bac: no, la demo scema \/ right keys at the right time
On Tue, Jul 10, 2007 at 01:32:59PM +0200, Stefano Zacchiroli wrote:
> Does this also mean that it can be installed as a drop-in extension on
> top of OCaml >= 3.10? Would CamlP4s conflict with the new CamlP4 which
> is shipped by OCaml itself?
Interesting question, thank you for asking :-)
Well, since my camlp4 is in the continuity of the previous official
one (what the "new" camlp4 is not), I did not change the names of
the commands, nor library files.
I may do, since I don't have the "official" version. I may change it
into "camlp5", "camlp42", or other without "camlp".
It does not help me, since I should also change the Makefiles of my
other programs, which are no more compilable with the "new" camlp4, to
call my camlp4 commands.
It is the reason why I kept the name, and I still hesitate to change.
In practice:
While running "configure" without parameters, the binaries will be
installed (after compilation) at the same place than the camlp4
binaries installed by ocaml, overwriting them. The library files
are installed in the directory "ocaml library +camlp4", the official
one being moved to "ocaml library +ocamlp4".
Otherwise, you can "configure" by using the parameters "-bindir",
"-libdir", "-mandir", or, globally, "-prefix", to specify another
installation place. In that case, the option "-I +camlp4" does not
work in ocamlc, you have to use "-I $(camlp4 -where)" instead.
If I change the name, there will be no more problem of installing.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
Ok, thanks for the explanation.
> I may do, since I don't have the "official" version. I may change it
> into "camlp5", "camlp42", or other without "camlp".
> It is the reason why I kept the name, and I still hesitate to change.
Now, I really hope you will go for this solution. I'm maintaining a huge
deal of OCaml related packages in Debian. As you can imagine some of
them will break with the new OCaml 3.10.0 due to CamlP4
incompatibilities. While I guess some of them are going to be fixed by
the respective authors, some aren't, for example ledit (I doubt you will
migrate it to the new CamlP4 :-P).
So we need in Debian a package of camlp4s, and I'm working on it.
However, given the current situation, camlp4s is a package which will
conflict with the official camlp4, that means that users can't install
both of them, and will also probably mean that no one will have camlp4s
installed. That still helps, since I (as a package maintainer) can
build-depend on camlp4s and be able to compile ledit, but it's
suboptimal, since OCaml developers needing the old camlp4 will need to
choose among the two camlp4 available aut-aut.
If you choose to rename camlp4s executables and libraries however, users
will be able to install both camlp4s and the official camlp4. Can you
please consider this option?
Many thanks in advance,
Cheers.
--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the
(15:57:15) Bac: no, la demo scema \/ right keys at the right time
_______________________________________________
> It cannot be native code, because camlp4 uses only bytecode, and
> the "#load" being done in the preprocessor, there is no difference
> whether you compile your file by ocamlc or ocamlopt.
> This "#load" does not mean "load in the program" but "load in the
> preprocessor".
My point exactly. I don't use any pre-processor, so the #load
doesn't work.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
> Otherwise, you can "configure" by using the parameters "-bindir",
> "-libdir", "-mandir", or, globally, "-prefix", to specify another
> installation place. In that case, the option "-I +camlp4" does not
> work in ocamlc, you have to use "-I $(camlp4 -where)" instead.
Have you ever tried to make all this work on Windows? :))
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
In the new one too.
--
Nicolas Pouillard
On Tue, Jul 10, 2007 at 11:05:38PM +1000, skaller wrote:
> My point exactly. I don't use any pre-processor, so the #load
> doesn't work.
Sorry, I was not clear.
In my message, by "preprocessor", I meant "camlp4".
If you are using camlp4, you are using a preprocessor.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
On Tue, Jul 10, 2007 at 11:12:01PM +1000, skaller wrote:
> Have you ever tried to make all this work on Windows? :))
Not yet.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
--------------------------------------------------
Yitzhak Mandelbaum
AT&T Labs - Research
http://www.research.att.com/~yitzhak
On Tue, Jul 10, 2007 at 02:33:22PM +0200, Stefano Zacchiroli wrote:
> If you choose to rename camlp4s executables and libraries however, users
> will be able to install both camlp4s and the official camlp4. Can you
> please consider this option?
Ok, I made a new release : 4.03.
You can change the name of all commands and libraries by using the
parameter "-name" of "configure" (default = camlp4).
For example:
./configure -name camlp5
would name the commands, files and manual pages: camlp5, camlp5o, camlp5r,
camlp5r.cma, camlp5.1 and so on, and the library would be installed in
a subdirectory camlp5 of the ocaml library directory.
Up to you to choose the name you prefer.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
Thanks, this is really helpful.
> For example:
> ./configure -name camlp5
>
> would name the commands, files and manual pages: camlp5, camlp5o, camlp5r,
> camlp5r.cma, camlp5.1 and so on, and the library would be installed in
> a subdirectory camlp5 of the ocaml library directory.
>
> Up to you to choose the name you prefer.
.. but this puzzles me a bit :) Can you please suggest an official name
so that we avoid drifting too much from distribution to distribution?
"camlp5"? "camlp4s"? Name one ...
Cheers.
--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the
(15:57:15) Bac: no, la demo scema \/ right keys at the right time
_______________________________________________
> For example:
> ./configure -name camlp5
>
> would name the commands, files and manual pages: camlp5, camlp5o, camlp5r,
> camlp5r.cma, camlp5.1 and so on, and the library would be installed in
> a subdirectory camlp5 of the ocaml library directory.
Due respect and all but this is really no good because it
makes things WORSE than they already are. How can someone
write a build script using camlp5 when it is called camlp4
on another system ..?
I think you should just fix the name to camlp5 or camlp4s,
since you have the power to do that, and can't change INRIA's
decision to retain the name camlp4 for an incompatible version.
At least make the default camlp5 or camlp4s to support future
co-existence.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
On 7/10/07, skaller <ska...@users.sourceforge.net> wrote:
--
http://till-varoquaux.blogspot.com/
And how would you know the name of 'camlp4s-config' ...?? :))
Well this would have to fixed... Thus you could call camlp4s directly
on your local machine (and Daniel could keep it as camlp4) and
indirectly in the general case (via camlp4s-config). I hope this seems
sensible. It seems to me as a lesser evil compared to the other
propositions.
Till
>
>
> --
> John Skaller <skaller at users dot sf dot net>
> Felix, successor to C++: http://felix.sf.net
>
--
http://till-varoquaux.blogspot.com/
My comment was tongue-in-cheek .. ;)
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
Best thing would have been if the new incompatible camlp* in ocaml
3.10 would have been renamed (to camlp5, obviously).
Regards -- Markus
On Wed, Jul 11, 2007 at 12:39:28AM +0200, Markus E.L. wrote:
> Best thing would have been if the new incompatible camlp* in ocaml
> 3.10 would have been renamed (to camlp5, obviously).
This is indeed logical but, even if Nicolas and Xavier would agree to
rename their camlp4, you would have to wait a release of OCaml.
Since I can make my releases independantly and fastly, I am ready to
change my camlp4 into camlp5, if everybody agrees, even if I have to
make also a release of all my sofwares, but it is not a big deal, and
things would be probably clearer like that.
On a too narrow street, when two vehicles arrive from opposite directions,
the lighter has to reverse. They are the lorry, I am the car, I can reverse.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________
Well, I think the -name argument is already a useful step. I just asked
for a suggested name to avoid a plethora of unknown different names. In
Debian, JFYI, I went for "camlp5" as it seems to me it's a name you like
and that it's welcome by the community.
Cheers.
--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the
(15:57:15) Bac: no, la demo scema \/ right keys at the right time
_______________________________________________
The thing is that the new camlp4 is not completely incompatible, there
is a bunch of people that use camlp4o with some standard options like
stream parsers or just plain OCaml and I don't want to break their
code for a naming change of command line programs.
--
Nicolas Pouillard
I know. The milk already has been spilled. Nicolas wrote that he did
not want to impose the burden to change their Makefiles on users of
camlp4 who only use compatible functionality. In a sense he is
right. Still: My migration strategy (if I were the OCaml team)
actually would have been to really split the source and have 2
preprocessors (camlp4 and camlp5) in the source tree for a while (they
are incompatible, so the implied contract is broken) and then (after
announcment) drop camlp4 from the distribution in the next release,
perhaps refering to your release stream as alternative. That would
have been clean and given everyone plenty of time to switch. Those
that wouldn't, just would have to change their build time requirements
from ocaml to ocaml + camlp4_daniel.
Well, but it's too late now.
> Since I can make my releases independantly and fastly, I am ready to
> change my camlp4 into camlp5, if everybody agrees, even if I have to
> make also a release of all my sofwares, but it is not a big deal, and
> things would be probably clearer like that.
I'm not affected (not having relied on camlp4 for released software so
far, despite having dappled with it over the years), but I can imagin
that changing your camlp4's name would help a lot. Though camlp5
suggests "the camlp after camlp4, which it obviously isn't :-). What
about camlp4ddr (your initials in honor of the author?). Or simply
camlp4org?
> On a too narrow street, when two vehicles arrive from opposite directions,
> the lighter has to reverse. They are the lorry, I am the car, I can reverse.
Yep. That's the right spirit: Always look at the bright side ... :-).
Regards -- Markus
Obviously you all didn't get the camlp4/camlp5 pun :-(.
Regards -- Markus
On Wed, Jul 11, 2007 at 08:45:30AM +0200, Stefano Zacchiroli wrote:
> Well, I think the -name argument is already a useful step. I just asked
> for a suggested name to avoid a plethora of unknown different names. In
> Debian, JFYI, I went for "camlp5" as it seems to me it's a name you like
> and that it's welcome by the community.
Ok, I made a release (4.04) of camlp5. Download at:
http://pauillac.inria.fr/~ddr/camlp5/
No fundamental changes, except renamings, in all files.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
_______________________________________________