b0caml
runs OCaml scripts like ocaml
. However it provides direct support for using third-party modules and compiles scripts transparently to a cache of native (or bytecode) executables.
Consult the manual and its tutorial introduction.
A few invocations to get you started.
cat > echo <<EOCAML
#!/usr/bin/env b0caml
let echo oc ss = output_string oc (String.concat " " ss ^ "\n")
let () = echo stdout (List.tl (Array.to_list Sys.argv))
EOCAML
> chmod +x ./echo
> ./echo grunt
grunt
> b0caml ./echo grunt # for Windows compatible invocations
grunt
Read how to use third-party modules and more in the tutorial introduction.
This is an unstable API subject to change even between minor versions of the tool. Use at your own risk.
B0caml_opam
opam
support, move to B00_kit
.B0caml_ocamlpath
OCAMLPATH
support move to B0_care.B0caml_resolver
Library resolverB0caml
b0caml
support.B0caml_cli
b0caml
cmdliner command.B0caml_script
OCaml scripts