Thursday, 26 July 2007

Review: OcaIDE

The Visual Studio mode for F# has really shown what an IDE can do for a modern functional programming language. We recently took a look at OcaIDE for OCaml and were very impressed with the functionality it provides.

Throwback of inferred types is hugely important when developing programs in languages that support type inference. OcaIDE is on par with Visual Studio in this respect, displaying the inferred types of subexpressions when the mouse is hovered over one. However, this does not provide as much functionality as the type throwback in emacs, which allows the type of an arbitrary selected subexpression to be displayed.

OCamldoc-compatible documentation is parsed correctly and displayed whenever possible. Again, this is the same as the Visual Studio mode, although OcaIDE is slightly prettier and Visual Studio often has problems parsing comments correctly. Editing was always fluid in OcaIDE, with no perceivable stalls.

Interestingly, OcaIDE integrates support for OCaml's bytecode debugger. An usual feature of OCaml's debugger is the ability to step backwards as well as forwards through the execution of a program. However, there is no support for memory or performance profiling and OCaml's excellent design renders a debugger almost useless.

The build system is not so easy to use, mainly because it predates OCaml 3.10 and, consequently, lacks ocamlbuild support as well as support for camlp4. The lack of support for any non-standard parsers raises the question of whether it is worth trying to build an IDE on top of Eclipse in Java rather than writing one from scratch in OCaml.

We believe the OCaml community could benefit greatly from a good IDE and OCaIDE is definitely a step in the right direction. The main advantage of OCaIDE is that it makes it easier for beginners to get started with OCaml. The main disadvantages are lack of development because all tools for OcaIDE must be written in Java or interfaced to Java and there is a lack of tools as a consequence, such as memory and performance profiling.

We have expressed an interest in writing a cheap commercial IDE for OCaml in the past. Let us know if you'd be interested.


Roland Kaufmann said...

It seems that the Ocaml community got off with a false start with (now practically defunct) EclipseFP project. At the same time, it also seems that most new ideas are based on using Eclipse as a basis for the IDE.

I wasn't aware of the OcaIDE; I will definitely check it out. Thanks for the pointer. There is however, another project too for Ocaml integration, but I don't know if it is more or less extensive:

Jon Harrop said...

Fantasic. I'll check it out, thanks!

Tim Watson said...

I'd love to get involved. I'm from a mixed background (C/C++, Java, Erlang, Haskell) and recently decided to pick OCaml for various aspects of my work (currently in telecom) and have been very happy with the results.

It would certainly be nice to see support for the full tool set (ocamldoc, build, etc), a debugger is a nice to have I suppose, and yes - VS F# mode is very impressive and a good watermark to aim for.