English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2007-01-15 (22:17)
From: tab@s...
Subject: Re: [Caml-list] Ocaml compiler features
On Mon, Jan 15, 2007 at 12:23:32PM -0800, Martin Jambon wrote:
> OCaml is well-enough designed so that there is no "common" syntax
> extension.

There ARE common syntax extensions.
how many people miss a try-except-finally construct ?
how many people miss a return statement to break the flow of a function.
etc ..

I'm not talking about weird extensions that ease the life of grammar
writter or lambda calculus , etc .. but really the basic one.

I still think camlp4 is a good idea for limited use like this.

> The problem is that people use it for a variety of things, and
> each domain may benefit from particular enhancements of the syntax.
> Either you incorporate all those extensions into the standard syntax,
> which is totally insane, or you consider them just as libraries. Loading
> a library is no big deal, whether it provides more functions or more
> syntax.

I'm especially not talking about all extensions, but obviously the ones
that everybody can use, whatever they works on.

> IMHO the problem is more that writing camlp4 syntax extensions is very
> different from writing everyday OCaml code. In other words,
> it is inaccessible to beginners, and most other people think it's too
> complicated anyway. It requires too much expertise and only few people are
> able to maintain such code.

What about the beginners then ?
All what you suggest below doesn't really help making it more accessible
I think. 

> Here is a list of things that I suggest if one ever wants to have a
> standard and widely use way of extending the syntax in OCaml:
> [snip]

I like this special "macro" keyword and this should also be part of the
language. So does some specific construction like try-finally.

Vincent Hanquez