caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlscript 2.0.0
@ 2007-03-05 21:46 Martin Jambon
  0 siblings, 0 replies; only message in thread
From: Martin Jambon @ 2007-03-05 21:46 UTC (permalink / raw)
  To: caml-list; +Cc: David MENTRE

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-05 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-05 21:46 ocamlscript 2.0.0 Martin Jambon

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).