I've been interested in the implementation of a template system for Ocaml. The main goal is to enable a programmer to automatically generate code from type informations. An article (in french) to explain the conception and use of the system has been submitted.
A pre-prototype which should
compile both under Ocaml 3.06 and
3.07
(with the two official patches) is already available.
It has been successfully tested under ocaml-3.06 (linux, cygwin) and
ocaml-3.07 patchlevel 2 (linux).
It has also been tested both under freebsd and Mac OS X ocaml-3.06 and
ocaml-3.07:
the installation complains but works well (this is due to a small bug in the
script mkcamlp4). In the case of freebsd, it
requires gmake instead of make.
wget http://www.pps.jussieu.fr/~maurel/programmation/ocamltemplates-0.00.tgzTo install:
tar zxvf ocamltemplates-0.00.tgz cd ocamltemplates-0.00 ./configure make make installOne may also wish to compile ocamldoc documentation.
make docsIt is then generated in doc/ocamldoc.
For the moment, the install phase installs binairies :
bin/ocamlt : the toplevel bin/ocamltp4 : the pre-processor-pretty-printer with normal syntax bin/ocamltsp4 : the pre-processor-pretty-printer with standard templates and normal syntax. bin/ocamltdp4 : the pre-processor for template definitions with normal syntax (not mandatory) bin/ocamltdc : a script which calls ocamltdp4 to compile a templateand some libraries
admin : the module Templates which manages templates and some other files.The license is the LGPL one with the standard modification for Ocaml. The distribution is composed from
Makefile, configure, LICENSE, INSTALL : as usual admin : principal files. code_ref : a syntax extension used in the specific syntax to define templates. templates : some templates. test : test files and examples.
Bug reports and ideas are most welcome...
Francois Maurel
Equipe PPS, case 7014
Bureau 6C12,
175, rue du Chevaleret,
75013 PARIS,
FRANCE.
Tel : (+33) (1) 44 27 28 38
E-mail : francois.maurel AT pps.jussieu.fr
Pour revenir à PPS : http://www.pps.jussieu.fr/