IOCaml is an OCaml kernel for the IPython notebook. This provides a REPL within a web browser with a nice user interface including markdown based comments/documentation, mathjax formula and the possibility of generating all manner of HTML based output media from your code.

The project has three components;

The kernels are the components that run the OCaml REPL. The server runs the user interface and controls the kernels.

There are two different kernels provided. IOCaml kernel runs as standard byte code and is basically the standard OCaml REPL with some extra functionality to receive commands and produce results over a network connection.

The IOCamlJS kernel uses the wonderful js_of_ocaml tool to compile the OCaml REPL fully into javascript. This is then embedded along with the notebook interface into a webpage.

Using IOCaml

IOCaml is installed with OPAM using

$ opam install iocaml

This will install both kernels and the server.

It can be run simply with

$ iocaml

This will bring up the dashboard user interface in the webbrowser. From here you can create new notebooks or open an existing notebook.

After opening a notebook you are presented with the main IOCaml user interface. It consists of a vertically stacked list of cells. Each cell can be either code or documentation and the type can be changed at any time using the menu bar or through various keyboard shortcuts (type CTRL+m-h).

In the future

IOCaml works pretty well at the moment so development is now mainly about bug fixes and keeping it working when its various dependencies are updated.

That said some thought is going into new features for version 0.5. Here are a few thoughts.

  • Update to the IPython 2.0+ interface. We currently use 1.1. This should not be a huge job but I am personally not 100% keen on its new modal way of working. This will probably get done but I will likely try to make it compatibly with both 1.1 and 2.0 if possible.
  • Clean up statically served IOCamlJS notebooks. I have used this feature for online tutorials for some projects but there are some issues like being unable to save work.
  • Load/save notebooks to the cloud.
  • Have a look at the beaker notebook. It is supposed to be compatible with IPython kernels and does look rather nice but is not well documented at the moment.
  • A native code kernel would be very interesting, but that depends on OCaml support which seems a bit lacking at the moment.

Longer term I am seriously considering if it is worth rewriting the notebook interface in js_of_ocaml. Getting full control of the interface and underlying communications protocols would simplify a lot of stuff. BIG job though.