I would like to evaluate an OCaml program in a step by step manner, in order to check if it satisfies the requirements (and also to know where exactly I suck at writing this program! This is a good way for learning faster).
There is the good old ocamldebug that requires to compile the program with ocamlc -g
, that lets add some breakpoints and examine values. From CLI (or CLI within Emacs, with apparently no more support).
https://caml.inria.fr/pub/docs/manual-ocaml/debugger.html
https://ocaml.org/learn/tutorials/debug.html
What are the tools for OCaml:
- that don’t require to first compile the program
- that look like Matlab or javascript integrated debuggers where you can put breakpoints in the source code, do a step-by-step evaluation, define/register a set of values to watch, peek the value by putting the mouse over a word in the source code
And how do you proceed to locate your non syntactic errors and non type errors, and to fine-tune your OCaml program?