caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin Jambon <martin.jambon@ens-lyon.org>
To: caml-list@inria.fr
Cc: David MENTRE <david.mentre@gmail.com>
Subject: ocamlscript 2.0.0
Date: Mon, 5 Mar 2007 13:46:11 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0703051324040.24553@localhost> (raw)

ocamlscript version 2.0.0 was just released. It is considered stable, and
there is no big change since the previous release 1.99.5 except for the
packaging and the web page:

  http://martin.jambon.free.fr/ocamlscript.html

Ocamlscript 2 derives from David Mentre's original implementation and adds
support for findlib packages, camlp4 syntax extensions, ocamllex,
ocamllyacc, input from stdin, script on the command-line, and some support
for compilation and linking with other source files. In theory it can also
be configured to support any compiled programming language other than
OCaml.


Description:
===========

ocamlscript compiles scripts, i.e. one-file programs, into
natively-compiled binaries, and executes them.

Basically, a script named alpha is compiled into alpha.exe. If alpha.exe
is more recent than alpha, then alpha.exe is executed directly, otherwise
alpha is recompiled first.

Compilation commands reside in the first section of the script. They are
written in OCaml and consist normally in setting one or two variables.


Example:
========

The following "getpage" script fetches a web page using the HTTP client
provided by the netclient library/findlib package:

#! /usr/bin/env ocamlscript
Ocaml.packs := [ "netclient" ]
--
match Sys.argv with
    [| _; url |] -> print_string (Http_client.Convenience.http_get url)
  | _ -> prerr_string "Usage: getpage URL\n"; exit 1

For instance, executing "getpage http://caml.inria.fr" creates a
getpage.exe file in the same directory as "getpage", runs it and prints
the web page that was requested.



Martin

--
Martin Jambon
http://martin.jambon.free.fr


                 reply	other threads:[~2007-03-05 21:47 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=Pine.LNX.4.58.0703051324040.24553@localhost \
    --to=martin.jambon@ens-lyon.org \
    --cc=caml-list@inria.fr \
    --cc=david.mentre@gmail.com \
    /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).