Thursday, 26 July 2007

Data Structures in the Standard Library

The OCaml Journal just published its fourth article, covering the List, Array, Set, Map, Hash table, Stack, Queue, String and Weak hash table data structures in detail:

"The OCaml standard library includes a wealth of mutable and immutable data structures that cover a wide variety of needs. This article introduces all of the data structures provided by the OCaml standard library and describes when and how to use each of them..."

To read this article and more, subscribe to The OCaml Journal today!

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.

Tuesday, 10 July 2007

GUI programming: Sudoku Solver

The latest article in the OCaml Journal describes the design and implementation of a complete GUI application for solving Sudoku puzzles:

"Powerful cross-platform GUI applications can be developed quickly and easily in the OCaml programming language. This article describes the design and implementation of a cross-platform GUI application for solving sudoku puzzles..."

To read this article and more, subscribe to the OCaml Journal today!