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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: ls-ocaml-developer-2006@m...
Subject: Re: [Caml-list] Ocaml compiler features

Martin Jambon <martin.jambon@ens-lyon.org> writes:

> On Mon, 15 Jan 2007, Nicolas Pouillard wrote:
>
>> On 1/14/07, Vincent Hanquez <tab@snarc.org> wrote:
>> > and create lots of different syntax which make the code unsharable at
>> > the end (each one using different syntaxes).
>> >
>> > I think camlp4 is the not the proper way to extends the language, and is
>> > definitevely *NOT* going to improve the world of OCaml.
>> >
>>
>> Although remind you that a property of camlp4 syntaxes is that you can
>> trivially convert an input source in plain (indented) OCaml code. This
>> is done using the Pr_o module, an OCaml pretty printer.
>>
>> Thus, you can share it.
>>
>> $ camlp4 some_strange_syntax.cmo pr_o.cmo foo.ml -o foo_ocaml.ml
>
> Getting standard OCaml code doesn't guarantee that you can do something
> with it: in the case of syntax extensions, the result will be most likely
> unreadable. But the real problem is that there is no way of reverting
> back to the original source code. So if you write your programs in the
> revised syntax, all patches must be written in the revised syntax.

Yes.

And the worst thing is, that your "original" source will only be
usable as long as the syntax extension is being maintained by
someone. You might even have to take over maintenance yourself at the
end. That might be a big cost for a bit of syntactic sugar in the long
run.

Regards -- Markus