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

[Caml-list] stupid q: camlp4

2 views
Skip to first unread message

Anastasia Gornostaeva

unread,
Nov 8, 2008, 3:00:53 PM11/8/08
to caml...@inria.fr
Hello.

How can I learn modern Camlp4?

thx.
ermine

_______________________________________________
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

Jon Harrop

unread,
Nov 8, 2008, 3:22:05 PM11/8/08
to caml...@yquem.inria.fr
On Saturday 08 November 2008 20:00:44 Anastasia Gornostaeva wrote:
> Hello.
>
> How can I learn modern Camlp4?

The new Camlp4 is not yet fully documented. The official documentation is on a
wiki here:

http://brion.inria.fr/gallium/index.php/Camlp4

Richard Jones' OCaml tutorial site has a simple "foreach" example:

http://www.ocaml-tutorial.org/camlp4_3.10/

Our OCaml Journal published an article about parsers and macros using the new
Camlp4 on 23rd November 2007:

http://www.ffconsultancy.com/products/ocaml_journal/?ol

I once posted a simple compiler for the "Minim" language that was written
using Camlp4:

http://caml.inria.fr/pub/ml-archives/caml-list/2007/08/c92bb15c444511674faf0c898d2e9986.en.html

--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

Anastasia Gornostaeva

unread,
Nov 8, 2008, 4:03:43 PM11/8/08
to caml...@yquem.inria.fr
On Sat, Nov 08, 2008 at 09:24:05PM +0000, Jon Harrop wrote:
> On Saturday 08 November 2008 20:00:44 Anastasia Gornostaeva wrote:
> > Hello.
> >
> > How can I learn modern Camlp4?
>
> The new Camlp4 is not yet fully documented. The official documentation is on a
> wiki here:
>
> http://brion.inria.fr/gallium/index.php/Camlp4
>
> Richard Jones' OCaml tutorial site has a simple "foreach" example:
>
> http://www.ocaml-tutorial.org/camlp4_3.10/
>
> Our OCaml Journal published an article about parsers and macros using the new
> Camlp4 on 23rd November 2007:
>
> http://www.ffconsultancy.com/products/ocaml_journal/?ol
>
> I once posted a simple compiler for the "Minim" language that was written
> using Camlp4:
>
> http://caml.inria.fr/pub/ml-archives/caml-list/2007/08/c92bb15c444511674faf0c898d2e9986.en.html
>
Oh, how many useful links! I spent some time on ocaml.org site
to figure out something interesting for new camlp4, but it was not always clear
if the article is about new or old camlp4.

Jon Harrop

unread,
Nov 8, 2008, 4:09:45 PM11/8/08
to caml...@yquem.inria.fr
On Saturday 08 November 2008 21:03:33 Anastasia Gornostaeva wrote:
> On Sat, Nov 08, 2008 at 09:24:05PM +0000, Jon Harrop wrote:
> > Richard Jones' OCaml tutorial site has a simple "foreach" example:
> >
> > http://www.ocaml-tutorial.org/camlp4_3.10/
> >
> > Our OCaml Journal published an article about parsers and macros using the
> > new Camlp4 on 23rd November 2007:
> >
> > http://www.ffconsultancy.com/products/ocaml_journal/?ol
>
> Oh, how many useful links! I spent some time on ocaml.org site
> to figure out something interesting for new camlp4, but it was not always
> clear if the article is about new or old camlp4.

Well, you get what you pay for. ;-)

--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

_______________________________________________

Richard Jones

unread,
Nov 9, 2008, 10:39:52 AM11/9/08
to Anastasia Gornostaeva, caml...@inria.fr
On Sat, Nov 08, 2008 at 11:00:44PM +0300, Anastasia Gornostaeva wrote:
> How can I learn modern Camlp4?

With difficulty. That's sad because it's very powerful.

I would suggest starting with Martin's Jambon's tutorial. Even though
it refers to the "old" camlp4 / camlp5, it's still useful to
understand the concepts:

http://martin.jambon.free.fr/extend-ocaml-syntax.html

Then take a look at Martin's example of what changed between the two
versions:

http://martin.jambon.free.fr/examples/pa_json_static_3100beta.html

The camlp4 wiki has already been mentioned, and is very useful. This
is probably the most useful reference page of all:

http://brion.inria.fr/gallium/index.php/AST

Finally take a look at some real examples:

http://caml.inria.fr/cgi-bin/hump.en.cgi?sort=0&browse=92

Rich.

--
Richard Jones
Red Hat

0 new messages