Code Tools
Editor Tools
For an OCaml beginner, the recommended editor of choice is Visual Studio code with the ReasonML plugin. See editor setup.
Visual Studio Code
- VSCode-Reason: The Reason/OCaml plugin for Visual Studio Code. Allows for all the advantages provided by Merlin with the convenience of the VSCode IDE.
- VSCode-OCaml-platform: in-development. OCaml extension for Visual Studio Code.
Emacs
- tuareg: OCaml mode for Emacs that can run the toplevel and the debugger within Emacs.
Sublime Text
- Sublime better ocaml: better OCaml mode for Sublime Text.
Vim
- Vim only really needs
merlin
, and optionally,ocp-indent
orocamlformat.
Neovim
General
- user-setup:
automatically configures several editors to use merlin, ocp-indent, and ocp-index if they are installed.
Run
opam install user-setup
to install it, and then follow the instructions, which tell you to runopam user-setup install
. - merlin: the main tool used to provide information to editors about OCaml codebases. Note that to provide information, the code must first be compiled. Dune is able to automatically create /.merlin/ files, which are needed to help merlin find the compiled files.
- ocp-index:
Easy access to the interface information of installed OCaml libraries.
Contains a few standalone tools:
- ocp-browser: Excellent, easily accessible ncurses-based API and documentation browser. Available independently on OPAM.
- ocp-index-top: toplevel directive for looking up documentation using ocp-index.
- ocp-indent is a coding style formatting tool that relies on heuristics and partial parsing rather than a full end-to-end parsing and printing approach, like ocamlformat below. The advantage of ocp-indent’s approach is that even partially-compiling files can be indented, as can code fragments.
- ocamlformat is a comprehensive coding style formatting tool that parses the code
and prints it out again. This follows the example of the
refmt
tool for Reason. While new,ocamlformat
may eventually overtakeocp-indent
.
Development Tools
- utop: Very powerful toplevel for OCaml, that is far better than the default one. A must-install for every OCaml programmer.
- sketch.sh: Online tool for playing around with OCaml (most up-to-date version).
- odoc: An automatic documentation generator for OCaml that creates beautiful html.
- Try OCaml: Try OCaml in your web browser.
- codingground: Compile and execute OCaml code online.
- mdx: Tool for executing code or shell snippets inside markdown files.
- iocaml: An OCaml kernel for the IPython notebook.
- ghim: A command-line tool to manage Github Issues.
- OCaml Yeoman Generator: Yeoman generator to scaffold OCaml modules.
- Dead Code Analyzer: OCaml dead code analysis.
Code Coverage
- Bisect_ppx: A coverage tool for OCaml.