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
OSR - "Batteries included" - Standardizing syntax extensions and extra libraries
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-04 (20:27)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: OSR - "Batteries included" - Standardizing syntax extensions and extra libraries
On 04-03-2008, Hezekiah M. Carty <hcarty@atmos.umd.edu> wrote:
> On Tue, Mar 4, 2008 at 12:12 PM, Berke Durak <berke.durak@exalead.com> wrote:
>> Hello all,
>>  David Teller suggested that I launch a thread on my suggestion at the end of the
>>  "different records, same field name?" thread.
>>  The idea is to define, as part of the OSR process, a list of
>>  "standard" syntax extensions and libraries.  A meta-distribution of Ocaml would
>>  then include, for every element of the ocaml toolchain, a version that has
>>  access to those extensions and libraries.  The name of the extended tool would
>>  be obtained by adding an "s" to the original name.
>>  Hence, assuming that we agree that Alain Frisch's openin and, say, Pcre should
>>  be part of the standard, then
>>    ocamlcs (resp. ocamlopts)
>>  would be a script calling ocamlc (resp. ocamlopt) with options
>>   -I +pcre -pp pa_openin
>>  Then we'd tell people new to Ocaml to use those instead; the existing users
>>  will be told to just add an "s".
> I like this idea, and think that it would make getting started with
> OCaml and its libraries much easier for new users.
>>  A few switches such as -only unix,pcre should be added to ocamlcs to prevent it
>>  from linking it everything if this is a concern.
> If ocamlfind were included as a standard part of the community OCaml
> distribution, then I think it would ease this process significantly.
> The standard set of libraries and syntax extensions could be checked
> against the proposed extra switches (-onlylibs/-exceptlibs/-libs) and
> used accordingly.  The user would only need to know the ocamlfind name
> of the library they wish to include/exclude.  The script would not
> have to keep track of including or excluding the proper directories
> for each new library which comes along in the ocaml(c|opt) search path
> since ocamlfind takes care of this.  I think ocamlfind/findlib
> supports syntax extension packages as well - if it does then these
> could be handled in the same way.

And ocamlfind also supports camlp4(o|r) and any other syntax extension
through the camlp4:

Extract from the manpage of ocamlfind:

-syntax pred-name-list

 These predicates are assumed to be true in addition  to the standard
 preprocessor predicates. See below for a list.



 This predicate is set if there is a -syntax option. It is set both for
 the preprocessor and the compiler/linker stage,  and it can be used to
 find out whether the preprocessor is enabled or not.

I.e. ocamlcs = ocamlfind ocaml -syntax openin! Just have to define
package name. The OSR can list the minimum syntax extension to be found
on a system...

Sylvain Le Gall