byob
is a shell script that makes OCaml backtraces prettier… or at least
tries to do so!
TL;DR ocamlc -g test.ml -o test && OCAMLRUNPARAM=b ./test 2>&1 | ./byob
- Compile the OCaml program with debugging information (
ocamlc/ocamlopt -g
) - Enable backtraces with the environment variable:
OCAMLRUNPARAM=b
- Pipe the stderr of the crashing program into
byob
- Print a small portion of the files where the exceptions are raised
- Use colors
and that's pretty much it for the moment