From: "David MENTRE" <david.mentre@gmail.com>
To: caml-list@yquem.inria.fr
Subject: [ANN] ocamlscript 1.99
Date: Thu, 8 Jun 2006 08:42:17 +0200 [thread overview]
Message-ID: <3d13dcfc0606072342p80e1f28w8bb874eb85b35930@mail.gmail.com> (raw)
[ 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 require
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 could
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
reply other threads:[~2006-06-08 6:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d13dcfc0606072342p80e1f28w8bb874eb85b35930@mail.gmail.com \
--to=david.mentre@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).