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.
B0caml is distributed under the ISC license and depends on b0
and cmdliner
. It is pronounced /bokamɛl/ with a thick
french accent.
Homepage: https://erratique.ch/software/b0caml
b0caml can be installed with opam
:
opam install b0caml
If you don't use opam
consult the opam
file for build
instructions.
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 Hello world
Hello world
For more information on how to use third-party modules see the
tutorial introduction of the manual (also available via
odig doc b0caml
).
The documentation can be consulted online or via odig doc b0caml
.
Questions are welcome but better asked on the OCaml forum than on the issue tracker.
A few examples can be found in the test
directory.