Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] camlp4 on Debian lenny

26 views
Skip to first unread message

Oliver Bandel

unread,
Dec 20, 2008, 8:13:03 AM12/20/08
to OCaml
Hello,

I wanted to explore camlp4 with the tutorial:
http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html

There seems to be some paths wrong?!

======================================
Objective Caml version 3.10.2

# #load "camlp4o.cma";;
Camlp4 Parsing version 3.10.2

# #load "pa_extend.cmo";;
Cannot find file pa_extend.cmo.
#
======================================

The file was not available until I installed the camlp5-package.

Now I assume, it's not available because it's in
the wrong directory...

==================================================
oliver@siouxsie:~$ locate pa_extend
/usr/lib/ocaml/3.10.2/camlp5/pa_extend.cmi
/usr/lib/ocaml/3.10.2/camlp5/pa_extend.cmo
/usr/lib/ocaml/3.10.2/camlp5/pa_extend.cmx
/usr/lib/ocaml/3.10.2/camlp5/pa_extend_m.cmo
/usr/lib/ocaml/3.10.2/camlp5/pa_extend_m.cmx
/usr/lib/ocaml/3.10.2/camlp5/pa_extend_m.o
/usr/lib/ocaml/3.10.2/camlp5/pa_extend.o
oliver@siouxsie:~$
==================================================


What is with camlp5 and camlp4?
Will camlp5 replace camlp4?
Will it afterwards be renamed to camlp4?
(This is, what I remember, but I'm not sure on it.)

When will there be a consistent new way to work with this
tools?

Do I have to install more packages on Debian,
to get this functionality without using symlinks?

I have installed the packages
"camlp4",
"camlp4-extra" and
"camlp5".

Any idea on how to fix the problem (by using official administration
tools)?

Ciao,
Oliver

_______________________________________________
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

Sylvain Le Gall

unread,
Dec 20, 2008, 8:25:10 AM12/20/08
to caml...@inria.fr
On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> Hello,

>
>
> What is with camlp5 and camlp4?
> Will camlp5 replace camlp4?
> Will it afterwards be renamed to camlp4?
> (This is, what I remember, but I'm not sure on it.)
>
> When will there be a consistent new way to work with this
> tools?
>
> Any idea on how to fix the problem (by using official administration
> tools)?
>

Well there is no problem in fact,

camlp4 is the tool shipped with ocaml distribution
camlp5 is a separate tool compatible with camlp4 before ocaml 3.10.

These are 2 separate things, you are just following old tutorials (i.e.
pre-3.10)

Regards,
Sylvain Le Gall

Oliver Bandel

unread,
Dec 20, 2008, 8:31:07 AM12/20/08
to OCaml
Zitat von Sylvain Le Gall <syl...@le-gall.net>:

> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> > Hello,
> >
> >
> > What is with camlp5 and camlp4?
> > Will camlp5 replace camlp4?
> > Will it afterwards be renamed to camlp4?
> > (This is, what I remember, but I'm not sure on it.)
> >
> > When will there be a consistent new way to work with this
> > tools?
> >
> > Any idea on how to fix the problem (by using official
> administration
> > tools)?
> >
>
> Well there is no problem in fact,
>
> camlp4 is the tool shipped with ocaml distribution
> camlp5 is a separate tool compatible with camlp4 before ocaml 3.10.
>
> These are 2 separate things, you are just following old tutorials
> (i.e.
> pre-3.10)

[...]

1) Where can I find the old tutorials?
2) what is camlp5 good for?
Or: what is the difference between camlp4 and camlp5?
3) is it planned that camlp4 will be thrown out of the
Ocaml-distribution?


Ciao,
Oliver

Stefano Zacchiroli

unread,
Dec 20, 2008, 8:35:32 AM12/20/08
to OCaml
On Sat, Dec 20, 2008 at 02:12:53PM +0100, Oliver Bandel wrote:
> The file was not available until I installed the camlp5-package.
>
> Now I assume, it's not available because it's in
> the wrong directory...

No, it is simply because camlp4 3.10 got rid of pa_extend.cmo.
See for example
http://martin.jambon.free.fr/examples/pa_json_static_3100beta.html for
a comparison of the required compilation commands.

> What is with camlp5 and camlp4?
> Will camlp5 replace camlp4?
> Will it afterwards be renamed to camlp4?

CamlP4 is the legacy/official one, integrated with OCaml. It changed
significantly from OCaml 3.09 to 3.10. CamlP5 is no longer legacy, but
descend from the line of development of CamlP4 pre-3.10.

> When will there be a consistent new way to work with this
> tools?

There is one already: CamlP4 >= 3.10.

> Do I have to install more packages on Debian,
> to get this functionality without using symlinks?

So, in essence, you don't have any specific problem with your
installation, nor there is one with the Debian packages you are
using. You just need to decide against which "flavor" of CamlP* you
want to develop.

Cheers.

--
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'č ..| . |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu ą tous ceux que j'aime

Oliver Bandel

unread,
Dec 20, 2008, 8:59:35 AM12/20/08
to OCaml
Hi,

ok, thank you (and the others) for the fast response.

So I will explore this tool now.
Fine that all is fine. :)


Ciao,
Oliver

Sylvain Le Gall

unread,
Dec 20, 2008, 9:06:59 AM12/20/08
to caml...@inria.fr
On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> Zitat von Sylvain Le Gall <syl...@le-gall.net>:
>
>> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
>> > Hello,
>> >
>> >
>> > What is with camlp5 and camlp4?
>> > Will camlp5 replace camlp4?
>> > Will it afterwards be renamed to camlp4?
>> > (This is, what I remember, but I'm not sure on it.)
>> >
>> > When will there be a consistent new way to work with this
>> > tools?
>> >
>> > Any idea on how to fix the problem (by using official
>> administration
>> > tools)?
>> >
>>
>> Well there is no problem in fact,
>>
>> camlp4 is the tool shipped with ocaml distribution
>> camlp5 is a separate tool compatible with camlp4 before ocaml 3.10.
>>
>> These are 2 separate things, you are just following old tutorials
>> (i.e.
>> pre-3.10)
> [...]
>
> 1) Where can I find the old tutorials?

You already have the old tutorial:
http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html
(look at http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html this
tutorial is for camlp4 coming along ocaml 3.07)

The new documentation:
http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html

> 2) what is camlp5 good for?
> Or: what is the difference between camlp4 and camlp5?

camlp4 is a refactored version of camlp5. I don't know the real deep
difference.

> 3) is it planned that camlp4 will be thrown out of the
> Ocaml-distribution?

Don't know.

Regards
Sylvain Le Gall

Oliver Bandel

unread,
Dec 20, 2008, 12:07:54 PM12/20/08
to caml...@inria.fr
Zitat von Sylvain Le Gall <syl...@le-gall.net>:

> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> > Zitat von Sylvain Le Gall <syl...@le-gall.net>:
> >
> >> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> >> > Hello,
> >> >

[...]


> > 1) Where can I find the old tutorials?
>
> You already have the old tutorial:
> http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html
> (look at http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> this
> tutorial is for camlp4 coming along ocaml 3.07)
>
> The new documentation:
> http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html

[...]


Heheh, both URLs are the equal. :)

Can you explain the difference? ;-)

(Or do you have a second URL?)


Ciao,
Oliver

Oliver Bandel

unread,
Dec 20, 2008, 12:11:02 PM12/20/08
to Oliver Bandel, caml...@inria.fr
Zitat von Oliver Bandel <oli...@first.in-berlin.de>:

> Zitat von Sylvain Le Gall <syl...@le-gall.net>:
>
> > On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> > > Zitat von Sylvain Le Gall <syl...@le-gall.net>:
> > >
> > >> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> > >> > Hello,
> > >> >
> [...]
>
>
> > > 1) Where can I find the old tutorials?
> >
> > You already have the old tutorial:
> > http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html
> > (look at http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> > this
> > tutorial is for camlp4 coming along ocaml 3.07)
> >
> > The new documentation:
> > http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> [...]
>
>
> Heheh, both URLs are the equal. :)
>
> Can you explain the difference? ;-)
>
> (Or do you have a second URL?)

[...]

Maybe this one?

http://caml.inria.fr/pub/old_caml_site/camlp4/tutorial/

So, this is a second url,
but the new one also links to the 3.07-stuff....

Matthieu Wipliez

unread,
Dec 20, 2008, 12:11:54 PM12/20/08
to Oliver Bandel, caml...@inria.fr
> Heheh, both URLs are the equal. :)

>
> Can you explain the difference? ;-)
>
> (Or do you have a second URL?)

lol

The documentation of the current Camlp4 can be found on the Wiki:
http://brion.inria.fr/gallium/index.php/Camlp4

There is a couple of tutorials there.

Have fun !

Matthieu

Oliver Bandel

unread,
Dec 20, 2008, 12:23:51 PM12/20/08
to caml...@inria.fr
Zitat von Matthieu Wipliez <mwip...@yahoo.fr>:

> > Heheh, both URLs are the equal. :)
>
> >
> > Can you explain the difference? ;-)
> >
> > (Or do you have a second URL?)
>
> lol
>
> The documentation of the current Camlp4 can be found on the Wiki:
> http://brion.inria.fr/gallium/index.php/Camlp4
>
> There is a couple of tutorials there.
>
> Have fun !

[...]

Yes, I try...


===========================================
oliver@siouxsie:~/Programmierung/camlp4-versuche$ ocaml
Objective Caml version 3.10.2

Camlp4 Parsing version 3.10.2

# Grammar.make;;
Unbound value Grammar.make
# let gram = Grammar.gcreate (Plexer.gmake ());;
Unbound value Grammar.gcreate
#
===========================================

Well, does not looks funny. :(

Oliver Bandel

unread,
Dec 20, 2008, 12:38:11 PM12/20/08
to caml...@inria.fr
Zitat von Matthieu Wipliez <mwip...@yahoo.fr>:

> > Heheh, both URLs are the equal. :)


>
> >
> > Can you explain the difference? ;-)
> >
> > (Or do you have a second URL?)
>
> lol
>
> The documentation of the current Camlp4 can be found on the Wiki:
> http://brion.inria.fr/gallium/index.php/Camlp4
>
> There is a couple of tutorials there.

[...]

Either I'm selectively blind, or providing this URL
was another nice joke...


"Wanted: Reference Manual"...
..

"Without such a manual, it is not possible to translate any non-trivial
syntax extension to Camlp4 3.10. It is not possible to write any
tutorial either"


Yes, and without a good tutorial and reference manual,
this all is bullshit.

I would urge to stop implementing any new features for OCaml,
until there is a good documentation that explains all features
that are already implemented. Adn a good documentation IMHO needs a
reference manual as well as introductional texts like tutorials...

Matthieu Wipliez

unread,
Dec 20, 2008, 1:00:26 PM12/20/08
to caml...@inria.fr
> Either I'm selectively blind, or providing this URL

> was another nice joke...

Sorry to disappoint you, but you actually were selectively blind ;-)

On the page
http://brion.inria.fr/gallium/index.php/Camlp4
is written:

* The using Camlp4 page describes how to use the various Camlp4 executables.
* The syntax extension tutorial is a must-see for the new Camlp4 user, as it explains how to create a basic syntax extension module.
* The OCaml code generation tutorial provides information on how to generate OCaml code in Camlp4.
* The full parser tutorial explains how to use Camlp4 as a complete parser for a given grammar.
* pa_float, a simple OCaml extension showing how to locally transform the AST. You can check by yourself, or access the tutorials directly below:

http://brion.inria.fr/gallium/index.php/Using_Camlp4
http://brion.inria.fr/gallium/index.php/Syntax_extension_tutorial
http://brion.inria.fr/gallium/index.php/OCaml_code_generation_tutorial
http://brion.inria.fr/gallium/index.php/Full_parser_tutorial
http://brion.inria.fr/gallium/index.php/Pa_float

>
>
> "Wanted: Reference Manual"...
> ...


>
> "Without such a manual, it is not possible to translate any non-trivial
> syntax extension to Camlp4 3.10. It is not possible to write any
> tutorial either"
>
>
> Yes, and without a good tutorial and reference manual,
> this all is bullshit.
>
> I would urge to stop implementing any new features for OCaml,
> until there is a good documentation that explains all features
> that are already implemented. Adn a good documentation IMHO needs a
> reference manual as well as introductional texts like tutorials...

I do agree. A student of mine and I wrote some of the tutorials mentioned myself after I learnt Camlp4 "the hard way", ie with no tutorials and the obsolete documentation of the previous version. But lack of time and motivation did not help me to write more documentation... I guess the same happened to Nicolas Pouillard, who is the developer of the current Camlp4. I will improve the Wiki when I have time, at the end of January.

In the meantime I wish you good luck, and hope the Wiki and tutorials will provide enough information.

Cheers,
Matthieu

blue storm

unread,
Dec 20, 2008, 5:49:29 PM12/20/08
to Oliver Bandel, caml-list
On 12/20/08, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> Yes, and without a good tutorial and reference manual,
> this all is bullshit.
>
> I would urge to stop implementing any new features for OCaml,
> until there is a good documentation that explains all features
> that are already implemented. And a good documentation IMHO needs a

> reference manual as well as introductional texts like tutorials...

I would urge you to write a good tutorial (and why not a reference
manual) on the wiki. If you're still in the learning stage, I'd be
more than happy to answer any question I can (I also learned (parts
of) camlp4 the "hard way"), or provide you with code samples and/or
pointers to relevant parts of the Camlp4 source code.

Sylvain Le Gall

unread,
Dec 21, 2008, 4:28:57 AM12/21/08
to caml...@inria.fr
On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> Zitat von Sylvain Le Gall <syl...@le-gall.net>:
>
>> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
>> > Zitat von Sylvain Le Gall <syl...@le-gall.net>:
>> >
>> >> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
>> >> > Hello,
>> >> >
> [...]
>
>
>> > 1) Where can I find the old tutorials?
>>
>> You already have the old tutorial:
>> http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html
>> (look at http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
>> this
>> tutorial is for camlp4 coming along ocaml 3.07)
>>
>> The new documentation:
>> http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> [...]
>
>
> Heheh, both URLs are the equal. :)
>
> Can you explain the difference? ;-)
>

Copy and paste error. The real reference is indeed on brion:
http://brion.inria.fr/gallium/index.php/Gallium

You can also take a look here:
http://ocaml-tutorial.org/camlp4_3.10

Regards
Sylvain Le Gall

Oliver Bandel

unread,
Dec 21, 2008, 8:56:38 AM12/21/08
to caml...@inria.fr
Zitat von Sylvain Le Gall <syl...@le-gall.net>:

> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> > Zitat von Sylvain Le Gall <syl...@le-gall.net>:
> >
> >> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> >> > Zitat von Sylvain Le Gall <syl...@le-gall.net>:
> >> >
> >> >> On 20-12-2008, Oliver Bandel <oli...@first.in-berlin.de> wrote:
> >> >> > Hello,
> >> >> >
> > [...]
> >
> >
> >> > 1) Where can I find the old tutorials?
> >>
> >> You already have the old tutorial:
> >> http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial001.html
> >> (look at http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> >> this
> >> tutorial is for camlp4 coming along ocaml 3.07)
> >>
> >> The new documentation:
> >> http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html
> > [...]
> >
> >
> > Heheh, both URLs are the equal. :)
> >
> > Can you explain the difference? ;-)
> >
>
> Copy and paste error. The real reference is indeed on brion:
> http://brion.inria.fr/gallium/index.php/Gallium
>
> You can also take a look here:
> http://ocaml-tutorial.org/camlp4_3.10

[...]

So many stuff, some up to date, some not,
different distributions.... what a mess!

In case of OCaml I'm an advocate for the cathedral.
OCaml is the only cathedral that I advocate.

But in the case of camlp4 it looks like the bazaar.
The regularity of the cathedral, as harsh as crisp as
OCaml's type system I miss in the case of Camlp4. :(

Better I have a closer look on camlp3l for today,
there is an up-to-date documentation...
..so camlp4 again must wait for me to be explored...

Ciao,
Oliver

Richard Jones

unread,
Dec 21, 2008, 12:00:04 PM12/21/08
to Oliver Bandel, caml...@inria.fr
On Sun, Dec 21, 2008 at 02:56:27PM +0100, Oliver Bandel wrote:
> But in the case of camlp4 it looks like the bazaar.
> The regularity of the cathedral, as harsh as crisp as
> OCaml's type system I miss in the case of Camlp4. :(

OCaml 3.09 OCaml 3.10 OCaml 3.11 .....
+ + +
camlp4 -----+---> camlp4 was -----> camlp4 development --> "new" camlp4
\ rewritten continues
\
\
\ not everyone agrees with
the rewrite, so old camlp4 -----> camlp5
development continues as
camlp5

All the distributions now ship OCaml, camlp4 and camlp5. This means
you can continue to compile and use pre-3.10 software which relies on
the old camlp4 (now called camlp5). Or you can use the new camlp4
which has some nice bits (like Reflective OCaml and the "scrap your
boilerplate" stuff).

The worst thing is the lack of good documentation for camlp4. The
wiki is a good start (http://brion.inria.fr/gallium/index.php/Camlp4).

I've said it before, there's a good book's worth of material in this
subject.

If you prefer looking at code, then take a look at:

http://code.google.com/p/bitstring/ (camlp4)
http://merjis.com/developers/pgocaml (camlp4)
http://alain.frisch.fr/soft#openin (camlp4 & camlp5)
http://martin.jambon.free.fr/micmatch.html (camlp5 & camlp4)
http://martin.jambon.free.fr/extend-ocaml-syntax.html (camlp5)

Actually, there's loads more projects here ...
http://caml.inria.fr/cgi-bin/hump.en.cgi?sort=0&browse=92

Rich.

--
Richard Jones
Red Hat

Oliver Bandel

unread,
Dec 21, 2008, 6:13:34 PM12/21/08
to Richard Jones, caml...@inria.fr
Zitat von Richard Jones <ri...@annexia.org>:

> On Sun, Dec 21, 2008 at 02:56:27PM +0100, Oliver Bandel wrote:
> > But in the case of camlp4 it looks like the bazaar.
> > The regularity of the cathedral, as harsh as crisp as
> > OCaml's type system I miss in the case of Camlp4. :(
>
> OCaml 3.09 OCaml 3.10 OCaml 3.11 .....
> + + +
> camlp4 -----+---> camlp4 was -----> camlp4 development --> "new"
> camlp4
> \ rewritten continues
> \
> \
> \ not everyone agrees with
> the rewrite, so old camlp4 -----> camlp5
> development continues as
> camlp5

[...]


Oh, wonderful!

Thank you!


Ciao,
Oliver

0 new messages