caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Camlp4] Beta-release
@ 2006-05-15 11:41 Nicolas Pouillard
  2006-05-16 14:55 ` [Caml-list] " Alain Frisch
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nicolas Pouillard @ 2006-05-15 11:41 UTC (permalink / raw)
  To: OCaml Mailing List

Hi,

The last four months, I have been working on the Camlp4 renovation
with Michel Mauny.

We are glad to announce the beta-release of a new version of Camlp4,
that contains a lot of major changes.

*** This version is not backward compatible. Use it at your own risk.***

Major changes are described at:
http://gallium.inria.fr/~pouillar/camlp4-changes.html

This release comes as a full OCaml package, that includes the new
version of Camlp4.
It is available at:
http://gallium.inria.fr/~pouillar/ocaml-3.10+dev6-and-camlp4-beta-r23518.tar.bz2


The build and installation process is the OCaml one (./configure &&
make world && ...). Be careful with `make install': it could damage
your current installation of OCaml and Camlp4, you can use --prefix
at configure to avoid it.

Since my internship ends on June, the 30th, we advise you to update
your extensions soon and take advantage of this period asking
questions and report bugs. This will ensure a smooth transition to a
future official release of OCaml including this version of Camlp4.

Best regards,

-- 
Nicolas Pouillard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-15 11:41 [Camlp4] Beta-release Nicolas Pouillard
@ 2006-05-16 14:55 ` Alain Frisch
  2006-05-16 20:16 ` Aleksey Nogin
  2006-05-18 14:36 ` Stefano Zacchiroli
  2 siblings, 0 replies; 7+ messages in thread
From: Alain Frisch @ 2006-05-16 14:55 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml Mailing List

Nicolas Pouillard wrote:
> The last four months, I have been working on the Camlp4 renovation
> with Michel Mauny.
> 
> We are glad to announce the beta-release of a new version of Camlp4,
> that contains a lot of major changes.
> 
> *** This version is not backward compatible. Use it at your own risk.***
> 
> Major changes are described at:
> http://gallium.inria.fr/~pouillar/camlp4-changes.html

Wow, that's a major renovation indeed. Great news, good job.

I've been able to upgrade two of my syntax extensions [1][2] without any
problem and the code is now cleaner than before. Some people might want
to look at them for examples of simple syntax extensions working with
the new Camlp4.

Thanks Nicolas!

-- Alain

[1] openin: http://www.eleves.ens.fr/home/frisch/soft.html#openin
[2] ulex: http://www.cduce.org/download.html#side


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-15 11:41 [Camlp4] Beta-release Nicolas Pouillard
  2006-05-16 14:55 ` [Caml-list] " Alain Frisch
@ 2006-05-16 20:16 ` Aleksey Nogin
  2006-05-17  7:52   ` Nicolas Pouillard
  2006-05-18 14:36 ` Stefano Zacchiroli
  2 siblings, 1 reply; 7+ messages in thread
From: Aleksey Nogin @ 2006-05-16 20:16 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml Mailing List, MetaPRL Developers

I have a question/feature request.

For our camlp4 usage (in MetaPRL theorem prover - http://metaprl.org/ ), 
we need to:
- extend the OCaml grammar
- refer to a "state" when parsing the extensions.

Currently we have to put the state in a global ref (yuck!), which causes 
all kinds of difficulties.

Is this something that can be done better in your reimplementation? Can 
something like this be added to your reimplementation?

Basically, I would really like to see camlp4 help with the following:

1) Defining parsers that depend on a shared state that is passed around.

Currently one can either
a) use a global pointer ref, or
b) manually define the productions of "state -> ..." type and manually 
pass the state around.

(a) is obviously bad, but even (b) is not only a lot of extra typing, 
but also means that the execution of productions will be delayed until 
the whole thing is parsed, which would mean that when something goes 
wrong, you would often get a campl4 parsing error instead of a (usually 
more meaningful) error generated by the production code.

2) Allow passing shared state even for grammars that extend things like 
OCaml grammar.

3) (completely unrelated) I wish there was a way to tell camlp4 to 
detect and report conflicts!

P.S. The bulk of our camlp4 code is in 
http://svn.metaprl.org/viewcvs/mojave/metaprl/filter/filter/term_grammar.ml 
(the shared state is hidden in a way here - the grammar is created in a 
functor where the input module provides functions like mk_opname; when 
the functor will be instantiated, the functions would be made dependent 
on a number of global refs) and in 
http://svn.metaprl.org/viewcvs/mojave/metaprl/filter/filter/filter_parse.ml 
(here we actually extend the OCaml grammar, using some of the stuff from 
term_grammar.ml in that extension).

If you are interested in downloading MetaPRL sources to look at this 
stuff in more detail, please see the download instructions at 
http://metaprl.org/install.html

-- 
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Moore 04, tel: (626) 395-2200


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-16 20:16 ` Aleksey Nogin
@ 2006-05-17  7:52   ` Nicolas Pouillard
  2006-05-22 22:39     ` Aleksey Nogin
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Pouillard @ 2006-05-17  7:52 UTC (permalink / raw)
  To: MetaPRL Developers, OCaml Mailing List

On 5/16/06, Aleksey Nogin <nogin@cs.caltech.edu> wrote:
> I have a question/feature request.
>
> For our camlp4 usage (in MetaPRL theorem prover - http://metaprl.org/ ),
> we need to:
> - extend the OCaml grammar
> - refer to a "state" when parsing the extensions.
>
> Currently we have to put the state in a global ref (yuck!), which causes
> all kinds of difficulties.
>
> Is this something that can be done better in your reimplementation? Can
Not yet.
> something like this be added to your reimplementation?
Why not, it depends on the difficulty.

>
> Basically, I would really like to see camlp4 help with the following:
>
> 1) Defining parsers that depend on a shared state that is passed around.
I don't know what you mean by shared state: a mutable data, a purely
functional data structure? And what will be the kind of this state,
because that state must be extensible by any extension.

> 3) (completely unrelated) I wish there was a way to tell camlp4 to
> detect and report conflicts!
There is no way to detect more conflicts than by default. Sorry.
But concerning errors the new token system helps by reporting errors
at compile time for example a typo in LIDENT will be get by the OCaml
typing system.

-- 
Nicolas Pouillard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-15 11:41 [Camlp4] Beta-release Nicolas Pouillard
  2006-05-16 14:55 ` [Caml-list] " Alain Frisch
  2006-05-16 20:16 ` Aleksey Nogin
@ 2006-05-18 14:36 ` Stefano Zacchiroli
  2006-05-18 14:41   ` Nicolas Pouillard
  2 siblings, 1 reply; 7+ messages in thread
From: Stefano Zacchiroli @ 2006-05-18 14:36 UTC (permalink / raw)
  To: caml-list

On Mon, May 15, 2006 at 01:41:32PM +0200, Nicolas Pouillard wrote:
> We are glad to announce the beta-release of a new version of Camlp4,
> that contains a lot of major changes.

What are the plans for the future of camlp4, and especially for the
changes you made? Are them going to be integrated in the "official"
camlp4 release and thus integrated in future releases of ocaml? Will
camlp4 be distributed separately in the future?

Many thanks for your work,
Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-18 14:36 ` Stefano Zacchiroli
@ 2006-05-18 14:41   ` Nicolas Pouillard
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Pouillard @ 2006-05-18 14:41 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list

On 5/18/06, Stefano Zacchiroli <zack@bononia.it> wrote:
> On Mon, May 15, 2006 at 01:41:32PM +0200, Nicolas Pouillard wrote:
> > We are glad to announce the beta-release of a new version of Camlp4,
> > that contains a lot of major changes.
>
> What are the plans for the future of camlp4, and especially for the
> changes you made? Are them going to be integrated in the "official"
> camlp4 release and thus integrated in future releases of ocaml? Will
> camlp4 be distributed separately in the future?
>
> Many thanks for your work,
> Cheers.
>

It's planned to be integrated in the future releases of OCaml.

-- 
Nicolas Pouillard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] [Camlp4] Beta-release
  2006-05-17  7:52   ` Nicolas Pouillard
@ 2006-05-22 22:39     ` Aleksey Nogin
  0 siblings, 0 replies; 7+ messages in thread
From: Aleksey Nogin @ 2006-05-22 22:39 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: MetaPRL Developers, OCaml Mailing List, Jason Hickey

On 17.05.2006 00:52, Nicolas Pouillard wrote:

>> Basically, I would really like to see camlp4 help with the following:
>>
>> 1) Defining parsers that depend on a shared state that is passed around.
> 
> I don't know what you mean by shared state: a mutable data, a purely
> functional data structure?

It should probably up to the end-users. The idea then would be to have 
the parser thread (in fold-style) the state through the productions and 
it would be up to the individual productions to decide whether to modify 
it in place or to return a different value functionally.

> And what will be the kind of this state,
> because that state must be extensible by any extension.

The grammar type should probably be polymorphic in the type of the state.

BTW, in some of our code Jason Hickey have implemented an extensible LR1 
parser generator with such a polymorphic "fold-style" state handling 
(where the state is threaded both through the lexer and through all the 
productions). See the lm_parser and lm_lexer modules at 
http://svn.metaprl.org/viewcvs/mojave/libmojave/util/ (can also be 
checked out via Subversion from svn://svn.metaprl.org/libmojave/util/ ).

>> 3) (completely unrelated) I wish there was a way to tell camlp4 to
>> detect and report conflicts!
> 
> There is no way to detect more conflicts than by default. Sorry.

Would it be possible to add such detection? Possibly in the form of a 
camlp4 module that processes the grammar extension directives 
differently, retaining more information as needed for such analysis?

-- 
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Moore 04, tel: (626) 395-2200


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-22 22:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-15 11:41 [Camlp4] Beta-release Nicolas Pouillard
2006-05-16 14:55 ` [Caml-list] " Alain Frisch
2006-05-16 20:16 ` Aleksey Nogin
2006-05-17  7:52   ` Nicolas Pouillard
2006-05-22 22:39     ` Aleksey Nogin
2006-05-18 14:36 ` Stefano Zacchiroli
2006-05-18 14:41   ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).