Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] [ANN] ocamlscript 1.99

1 view
Skip to first unread message

David MENTRE

unread,
Jun 8, 2006, 2:47:25 AM6/8/06
to caml...@yquem.inria.fr
[ On behalf of Martin Jambon which has some issues with caml-list@. ]

Dear caml-list,

We are pleased to announce a pre-release of the future ocamlscript 2.
Ocamlscript allows to write single-file programs that include their own
compilation options and run fast thanks to ocamlopt.

Ocamlscript is simply a command-line tool which takes a single input
file, compiles it and runs it.

1) Key concepts:
- one source file contains everything (no more tar.gz or makefiles);
- programs run fast (unlike scripts using the "ocaml" command);
- programs are recompiled when needed (based on last modification
dates).


2) Novelties

A script is now composed of two parts:
- a short header which is written in OCaml and that is used to set
compilation options (packages to use, compiler options, a special
preprocessing, or even a completely different compiler to use
instead of ocamlopt);
- the program itself.

By default, the program is compiled with ocamlopt and camlp4o as
preprocessor, but this can be changed.

This new version is not 100% compatible with the last release of
ocamlscript (1.1). It only concerns specific cases, i.e. scripts that requi
re
exactly one cmx or cmxa file with no other option.


3) A complete example

Real example: a CGI script which uses the PCRE-OCaml,
Ocamlnet (cgi package) and Micmatch_pcre libraries.

The syntax extension provided by Micmatch_pcre is automatically loaded.
PCRE-OCaml (pcre package) is automatically loaded as a dependency of
Ocamlnet and Micmatch_pcre. So the script simply needs to start like
this:

#!/usr/bin/env ocamlscript
Ocaml.packs := ["micmatch_pcre"; "cgi"]
--
..

The full source code is there:
http://martin.jambon.free.fr/examples/domains.ml.html

The resulting CGI executable is running as:
http://wikiomics.org/cgi-bin/cgi/domains

4) Development status

This is the pre-release 1.99.0 of the future ocamlscript 2. It is
provided without a true documentation, and some aspects of the interface co
uld
change until the 2.0 release.

User input will be greatly appreciated (see wiki below).


5) Distribution

OCamlscript was written by David Mentré (original version) and Martin
Jambon (latest features). It is distributed under the terms of the Boost
software license.

Source code:
http://martin.jambon.free.fr/ocaml.html#ocamlscript

Wiki page for comments, questions and more:
http://ocaml.pbwiki.com/Ocamlscript


Have fun!


The ocamlscript developers.
--
Martin Jambon, PhD
http://martin.jambon.free.fr

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

0 new messages