Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Bug in ocamlyacc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-25 (01:03)
From: skaller <skaller@u...>
Subject: Re: new+old Camlp4 (was Re: [Caml-list] Bug in ocamlyacc)
On Tue, 2007-04-24 at 13:17 -0700, Martin Jambon wrote:
> On Wed, 25 Apr 2007, skaller wrote:

> I wanted to start this as dedicated thread, but let's do it now.
> The current situation with camlp4 3.10-beta is terrible. Not
> because the new camlp4 is not good or anything, but because it is not
> compatible with the old one and yet replaces it. Replacing the old one by
> the new one in the next release of OCaml is practically unmanageable
> because:
> 1) Source duplication is unavoidable
> 2) Upgrading to the new camlp4 is not automatic

Curious, but can't you run camlp4 (old) to generate pure Ocaml text?
Then, you have no macros and can re-introduce them. 

> A smooth transition would be much preferrable. I acknowledge that I don't
> know how make it possible to use syntax extensions using the old and the
> new camlp4 on a same ocaml source file, but for those using only one
> extension or several extensions using the same version of camlp4, it would
> be convenient if it just works.

An alternative is a translator from old to new syntax, I guess that
would be HARD otherwise it would have been done?

> * It means two versions of camlp4 would be distributed and installed with
>   ocaml 3.10.
> * Command names for the new camlp4 would be distinct from the old camlp4.
> * Old programs would still compile and work without having to patch
>   makefiles.
> * Upgraded programs could add new features only to the 3.10 version, while
>   maintaining minimal support (bug fixes) for the 3.09 version, without
>   forcing the camlp4 programmer to use ocaml 3.09 for testing.
> * New programs could support only the new camlp4.
> Does that make sense?

I wonder if a pipeline would work, so you can multi-stage

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: