B0caml 3eeea5b

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.

Quick start

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))
> chmod +x ./echo
> ./echo grunt
> b0caml ./echo grunt  # for Windows compatible invocations

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.