Version française
Home     About     Download     Resources     Contact us    
Browse thread
Camlp4s 4.02
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Camlp4s 4.02
On Mon, 2007-07-09 at 10:58 +0100, Joel Reymont wrote:
> This is most awesome, I think. With all due respect to the developers  
> of the "new" camlp4, I wonder if it will now join the revised  
> syntax :-).
> 
> What do you think?

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