
How to Leverage Pattern Matching (8th June 2007)
"Compared to conventional programming languages, OCaml takes dynamic dispatch to a whole new level using an approach called pattern matching. This article guides the reader through the fundamental concepts that underpin pattern matching before providing some examples demonstrating the power of pattern matching in general programming..."

The Essence of Functional Programming (23rd June 2007)
"OCaml is fundamentally a functional programming language and the use of functions instead of objects often leads to shorter and clearer code. Indeed, many of the benefits of functional programming are already known to OO programmers in the form of design patterns..."

GUI Programming: A Sudoku solver (10th July 2007)
"Powerful crossplatform GUI applications can be developed quickly and easily in the OCaml programming language. This article describes the design and implementation of a crossplatform GUI application for solving sudoku puzzles..."

Data structures in the Standard Library (24th July 2007)
"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..."

Exploiting Tail Recursion (9th August 2007)
"Recursion is essential to functional programming and practical use of functional programming languages and a functional style requires the ability to write recursive functions that do not consume stack space. Function calls that require no stack space are called tail calls. This article describes the use of tail calls to write robust and efficient tail recursive functions in OCaml..."

Optimizing a simple bytecode interpreter (23rd August 2007)
"As a highperformance functional programming language, OCaml is perfect for writing interpreters. These programs involve a wide variety of different techniques from lexing and parsing to various methods of evaluation, compilation, simplification and rewriting. All of these techniques will be described in future OCaml Journal articles and this article describes the implementation of three progressively optimized interpreters for a minimal byte code language..."

Combinator Heaven (8th September 2007)
"The ability to write higherorder functions that compose other functions in interesting ways is one of the most powerful forms of abstraction provided by the functional programming paradigm. Such functions are known as combinators . This article describes the basic concepts behind combinators with a variety of examples to demonstrate how practically useful this form of functional abstraction can be..."

Using lex and yacc (24th September 2007)
"The tool stack bundled with the OCaml distribution provides some awesome functionality. The ocamllex and ocamlyacc tools provide a mainstream approach to the parsing of data. This article introduces the concepts of lex and yaccbased parsing and describes the use of these tools in implementing robust and efficient parsers quickly and easily..."

A simple FFT implementation (8th October 2007)
"Writing an implementation of the Fourier transform is an excellent lesson in algorithm design and optimization. Moreover, the Fourier transform is one of the most essential tools in numerical computing, with applications ranging from spectral analysis in science to the multiplication of large integers in mathematics. This article describes the design, implementation and optimization of a highperformance FFT implementation in OCaml..."

Balanced binary search trees (23rd October 2007)
"Immutable data structures are a core concept in functional programming and balanced binary trees are the single most important such data structure. The OCaml programming language allows balanced binary tree implementations to be written clearly and efficiently. This article describes the design and implementation of a basic balanced binary search tree data structure similar to that of the builtin Set module..."

Introduction to OpenGL (12th November 2007)
"OpenGL is the defactostandard crossplatform graphics API and provides an efficient way to leverage the highperformance hardware accelerators found in almost all modern computers. The OCaml programming language has unusually good support for OpenGL with the LablGL library providing an elegant interface to OpenGL on all three major platforms. This article introduces OpenGL programming using OCaml, demonstrating how functional programming can be leveraged to produce visualization software that is simple and efficient..."

Camlp4 3.10: parsers and macros (23rd November 2007)
"The latest OCaml tool stack includes a revamped preprocessor called camlp4 that serves several purposes including providing extensions to the OCaml language that allow parsers to be embedded in ordinary OCaml code as well as the ability to extend the syntax of OCaml itself by writing macros. This article explains how camlp4 can be used to write general parsers and OCaml syntax extensions..."

Festive Fun with OpenGL and GTK+ (12th December 2007)
"This article marries the ability to render highquality graphics in realtime using OpenGL with the ability to build GUI applications using GTK+. Specifically, a small program is developed that builds upon functionality encountered in previous articles to render a decorated christmas tree with snow in real time..."

Parser Combinators (28th December 2007)
"Certain applications are extremely well suited to functional programming and parsing is one of them. Specifically, the ability to write functional combinators that allow parsers for everything from integers up to symbolic expressions to be composed is more general and provides more opportunity for code reuse than the use of conventional parser generators such as ocamllex and ocamlyacc. This article explains how parser combinators may be designed and implemented in OCaml, using the standard example of a calculator..."

Implementing a simple ray tracer (10th January 2007)
"Ray tracing is a simple but powerful approach to photorealistic rendering and implementing a ray tracer is an excellent way to learn a programming language and, in particular, to learn about graphics and optimization in the context of numerical algorithms. This article walks through the design and implementation of a basic ray tracer that provides realtime visualization a scene using OpenGL in a GUI application that provides the user with rendering options using a GTK+ menu..."

Factoring numerical methods using combinators and functors (24th January 2007)
"The same concepts that make functional programming a powerful paradigm for symbolic manipulation can also be applied to numerical methods. This article describes the basic concepts of factoring using higherorder functions and functors in the context of numerical algorithms such as function minimization..."

Languageoriented programming: The Termlevel Interpreter (9th February 2008)
"Modern software is using a wider variety of languages than ever before. The ability to parse and interpret these languages is of growing importance. Fortunately, OCaml inherits incredibly powerful language features (algebraic data types and pattern matching) for program manipulation from its predecessors and augments these with an excellent suite of tools and libraries. This article explains how OCaml can be harnessed to write a complete termlevel interpreter for a programming language in only a tiny amount of code..."

Highfidelity graphics with OpenGL 2 (25th February 2008)
"The single most important advancement made in consumerlevel graphics accelerators in recent years was the advent of the programmable graphics pipeline. OpenGL 2 introduces the highlevel GLSL shader language as a way to program the graphics pipeline. This article describes how the latest version of the GLCaml bindings for OCaml allow GLSL shaders to be used to improve the fidelity of highperformance graphics using perpixel Phong shading..."

Runtime compilation with LLVM (8th March 2008)
"The LowLevel Virtual Machine (LLVM) project brings highperformance static and JIT compilation to code generators written in the OCaml programming language. This article describes the basic use of LLVM from OCaml including both static and JIT compilation, argument passing, control flow and the compilation of expression trees..."

Getting the most out of Static Typing (26th March 2008)
"The OCaml language arms programmers with one of the most sophisticated static type systems of any generalpurpose programming language. This static type system can be used to remove large classes of common bugs that are otherwise tedious or impossible to track down. The benefits in terms of programmer productivity and program reliability are tremendous. However, leveraging such a type system is an art that requires significant effort to learn. This article describes idiomatic OCaml style and a variety of techniques that can be used to leverage the static type system in order to catch errors earlier and more easily..."

Labeled and Optional arguments (10th April 2008)
"The OCaml programming language provides a variety of useful features that are not found in many other functional programming languages. This is why OCaml is widely accepted as a functional language for practical use. Labeled and optional function arguments are two related features that can be used to great effect in simplifying interfaces. This article introduces the syntax required to define and use both labeled and optional arguments in OCaml and describes some pedagogical uses of these features, with references to existing libraries, as well as examining some of the problems often encountered by programmers using these features..."

Language oriented programming: Term Rewriting (25th April 2008)
"An interesting and powerful alternative to the conventional termlevel interpreter is called term rewriting. Rather than reducing expressions down to values, term rewriting simply evaluates expressions by performing substitutions and the result is another expression. This approach is particularly well suited to computer algebra systems such as Mathematica but is also an underappreciated alternative to dynamicallytyped programming languages that can integrate useful features like pattern matching and make techniques like partial specialization far easier. This article describes how a simple term rewriter can be constructed and introduces the concept of private variant type constructors in the process..."

Porting and optimizing the SciMark2 benchmark (10th May 2008)
"The SciMark2 benchmark is a suite of numerical algorithms that were originally collated into a benchmark for scientific computing on the Java platform. Porting this benchmark to OCaml provides an excellent tutorial on the implementation of efficient numerical algorithms using the current OCaml implementation. The results illustrate the strengths and weaknesses of the current OCaml implementation in terms of performance..."

Implementing a simple XMLRPC client and server (23rd May 2008)
"XMLRPC is a protocol for remote procedure calls that is built upon the XML format. Method calls are packaged up by the client as an XML request sent via HTTP to the server whereupon action is taken and a response is packaged up and returned in the same way. This article describes how a complete clientserver pair using XMLRPC can be designed and built from scratch in OCaml using only the XMLLight and OcamlNet libraries..."

Realtime Finite Element Materials simulation (10th June 2008)
"Finite Element Materials simulations (FEMs) model a continuous volume of material by breaking it down into a discrete representation with many finite parts. This article describes a simple but fun program that simulates the dynamics of a 2D system of particles and springs in realtime. The program visualizes the results using OpenGL..."

Tricks with recursion: knots, modules and polymorphism (22nd June 2008)
"This article introduces some of the design patterns found in functional programming. The phrase "untying the recursive knot" refers to the ability to remove direct recursion from value and type definitions through the use of parameterization. OCaml's recursive modules allow recursion to cross module boundaries. Polymorphic recursion allows functions to call themselves with different type parameters. This article introduces all of these functional design patterns with illustrations and worked examples..."

Foreign Function Interfaces: Calling C from OCaml (10th July 2008)
"Although the OCaml programming language offers many improvements over older languages such as C, C++ and Fortran the need to interoperate with native code can still arise. The two most important uses for native code interoperability are performance and legacy. This article describes how native code can be invoked from OCaml programs using both the conventional OCaml approach of writing stub functions in C and also a new approach using LLVM to generate the necessary interface code at runtime..."

Metaprogramming with MetaOCaml (27th July 2008)
"Metaprogramming is a term used to describe programs that generate or manipulate other programs. The ML family of languages were bred specifically for this purpose and, indeed, that is where their name MetaLanguage is derived from. Runtime compilation and execution of programs is a notable feature once present in Lisp as EVAL but sacrificed in the design of ML. The MetaOCaml language is a prototype OCaml derivative that is designed to bring staticallytyped metaprogramming to the OCaml family of languages. This article examines the use of MetaOCaml for metaprogramming including some of the practical applications of this technology and the challenges faced by users of this technology..."

Forkbased Parallelism (10th August 2008)
"As the world transitions to multicore desktop computers over the next few years it is essential that software evolves to take advantage of this new dimension in processing power by exposing parallelism. Although the current OCaml implementation has a serial runtime that limits multithreaded OCaml programs to serial concurrency, it is actually entirely possible to use separate processes to create parallel OCaml programs that do exploit multicores. This article examines a simple but powerful approach to parallelism using Unix process forking..."

Writing a bytecode compiler using LLVM (27th August 2008)
"The LowLevel Virtual Machine (LLVM) provides the machinery to generate highperformance native code programmatically and ondemand. One of the most important applications of this technology is the Just In Time (JIT) compilation of bytecode intermediate representations into native code, as found in Sun's Java Virtual Machine (JVM) and Microsoft's Common Language Runtime (CLR). This article describes how a simple bytecode interpreter can be developed into a JIT compiler using LLVM with relatively little effort..."

Building a 2D vector graphics library (10th September 2008)
"Vector graphics represent images in terms of lines and curves on a fictional canvas. This resolutionindependent representation is ideal for high resolution output devices such as printers but the inevitable march of technology has ossified vector graphics on the desktop as a fundamental component of both Apple's and Microsoft's latest operating systems. This article describes the design and implementation of a simple library for 2D vector graphics written in OCaml and using OpenGL for visualization..."

Concurrent web crawling (23rd September 2008)
"Webenabled technology is now ubiquitous and of huge commercial value. These kinds of programs share two common characteristics: they send information over the internet and they perform tasks concurrently. This article is the first in a series to examine the use of the OCaml programming language and its relatives in the growing area of concurrent web programming..."

Triangulated Irregular Networks (TINs) (11th October 2008)
"Adaptive subdivision is a hot topic in computer graphics and forms the foundation of many stateoftheart algorithms for large scale visualization used for everything from scientific visualization of huge data sets to game graphics that immerse players in expansive virtual worlds. This article describes one of the most popular approaches for the adaptive subdivision of 3D meshes and implements a capable plotting algorithm with realtime OpenGLbased visualization showcasing how this simple algorithm works and can be used to solve many different problems..."

Lowlevel optimization tips and tricks: part 1 (23rd October 2008)
"The OCaml programming language is unusually well suited to highperformance computing among functional programming languages because it provides a highly efficient code generator with a performant runtime and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lowerlevel languages like C and Fortran for performancecritical sections of code. This article describes the lowlevel optimizations that underpin the ability to write performant OCaml programs by leveraging knowledge about the OCaml compiler..."

Huffman data compression (10th November 2008)
"Data compression algorithms are not only very useful in practice but are also extremely compelling pragmatic examples of programming theory. The popular Huffman data compression algorithm is from the family of entropy encoding compression algorithms. This article walks through the construction of a simple but efficient Huffman compression and decompressor written entirely in OCaml..."

Objectoriented programming in OCaml (23rd November 2008)
"The OCaml programming language is unique among member of the ML family because it provides not only the core ML features of variant types, pattern matching and functors but also two different features of the type system that provide subtyping: objects and polymorphic variants. Compared to conventional objectoriented languages, OCaml's objects are unusual because they are structurally typed, a characteristic that removed the need to declare class types but which can adversely affect developer productivity and runtime efficiency if used inappropriately. This article describes the design, implementation and use of OCaml's object system, giving references to examples of good design..."

Working with Regular Expressions (10th November 2008)
"Regular expressions are a domainspecific language for pattern matching over sequences of characters. This functionality provides a concise and efficient way to dissect strings and, consequently, is used in many forms of string processing including the definition of lexers. This article describes OCaml's builtin support for regular expressions..."

Lowlevel optimization tips and tricks: part 2 (23rd December 2008)
"The OCaml programming language is unusually well suited to highperformance computing among functional programming languages because it provides a highly efficient code generator with a performant runtime and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lowerlevel languages like C and Fortran for performancecritical sections of code. This article covers allocation and garbage collection and various forms of specialization including type, function and data structure specialization..."

Solving the Traveling Salesman problem using Simulated Annealing (10th January 2009)
"Finding global minima of an arbitrary function is a significantly more challenging problem than local function minimization and has many practical applications from the simulation of molecules to the design of printed circuit board layouts. Several different global function minimization algorithms exist, many of which make repeated use of local functionminimization algorithms. This article describes a simple and elegant solution to the traveling salesman problem that uses the simulated annealing approach to global function minimization. The results are visualized in real time using OpenGL. In particular, we use an efficient purely functional data structure to represent the path..."

Building a Virtual Machine using LLVM: part 1 (23rd January 2009)
"This article is the first in a series examining the design and construction of a simple highlevel virtual machine (HLVM) written in OCaml and building upon LLVM. Despite its simple design, the HLVM offers excellent performance, rich runtime types with reflection, tail calls, accurate garbage collection and an easytouse Ccompatible Foreign Function Interface (FFI). This article describes the first step in construction: JIT compilation of programs from a minimal language..."

Simulating smoke in realtime using fluid dynamics (10th February 2009)
"In scientific computing, the task of simulating fluid flow accurately by solving the NavierStokes equation is notoriously difficult. However, it is possible to compute numerical approximations quickly enough that fluids dynamics may be simulated in real time. This article describes a simple fluid dynamics simulator that uses OpenGL to visualize the results in real time..."

Building a Virtual Machine using LLVM: part 2 (23rd February 2009)
"This is the second article in the series about our highlevel virtual machine (HLVM) project. This article builds upon the foundations laid in the first article to create a much more practically useful language implementation by adding tail call elimination, firstclass structs, a foreign function interface (FFI) and firstclass function pointers..."

Lowlevel optimization tips and tricks: part 3 (8th March 2009)
"The OCaml programming language is unusually well suited to highperformance computing among functional programming languages because it provides a highly efficient code generator with a performant runtime and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lowerlevel languages like C and Fortran for performancecritical sections of code. This article gives a case study that covers many of the techniques described so far before describing how the performance of the FFI can be improved and some optimizations that often provide substantial performance improvements in OCaml..."

Building a Virtual Machine with LLVM: part 3 (23rd March 2009)
"This is the third and final article in the series about the design and construction of the highlevel virtual machine (HLVM). This article describes the design and implementation of boxed values for sum types and a simple garbage collector. In particular, the difference between the runtime representations of values in OCaml and HLVM is described in detail and the GC implementation described is partially generated at runtime and JIT compiled..."

Emergent behaviour: flocking boids (8th April 2009)
"Artificial life became a popular topic in the 1980s. In particular, with the discovery that simple rules defining the behaviour of individuals could give rise to sophisticated behaviour of groups of individuals. This unexpected result was described as "emergent behaviour" and one of the most famous examples was a computer program called "Boids" that used only three simple rules to govern the dynamics of individuals but produced remarkably realistic flocking behaviour of the population as a whole. This article describes an interactive boids simulator with a graphical user interface implemented using GTK+..."

Purely functional data structures: streams, queues and catenable lists (23rd April 2009)
"This article is the first in a series describing the design and implementation of some very useful purely functional data structures. Lazy streams, batched and realtime queues and lists with O(1) concatenation are described in detail. In particular, functors are used extensively to provide elegant parameterization over data structures and some of the new features in OCaml 3.11 are used to improve both performance and clarity..."

LempelZivWelch data compression (8th May 2009)
"LZW is a simple and effective dictionarybased data compression algorithm originally published in 1984 and subsequently used in several prominent places including the GIF image format. This article describes simple purely functional implementations of the compression and corresponding decompression algorithms before examining the optimization of these implementations via the selective inclusion of mutable data structures..."

Pretty printing with the Format module and camlp4 stream parsers (23rd May 2009)
"The OCaml programming language has evolved a rich variety of libraries and tools over the past twelve years. The domain of metaprogramming is particularly well supplied. This article describes the basic design of OCaml's Format module which provides customizable formatting and, in particular, userextensible pretty printing for the toplevel as well as the stream parsers provided by camlp4..."

Visualizing the Singular Value Decomposition (8th June 2009)
"Singular Value Decomposition (SVD) is an important algorithm from linear algebra that decomposes a matrix into the product of three simpler matrices. The resulting decomposition has several applications. This article describes the design and implementation of an OCaml program that computes the SVD of an image and uses it to create a lossy compression algorithm with controllable quality. This involves numerical methods for computing the eigenvalues of real symmetric matrices and interactive visualization of the result as a GTK application using the camlimages library to load images from file..."

Compiler development: part 1 (23rd June 2009)
"This article is the first in a series describing the design and implementation of a complete compiler for a nontrivial language using the freelyavailable HLVM project described in previous articles. The representation of types, patterns and expressions, the lexer, parser and ReadEvaluatePrintLoop (REPL) with JIT compilation are described in this article..."

QR decomposition: a case study in profiling and optimization (10th July 2009)
"The challenge of finding the least squares best fit of a linear sum of functions is a common problem in regression. Linear algebra provides a powerful and general solution by expressing this problem in terms of matrices and then computing the QR decomposition in order to solve the matrix equation. This article describes a remarkably simple implementation of QR decomposition in OCaml and uses it as a case study for profiling and optimization..."

Optimizing the BurrowsWheeler Transform (23rd July 2009)
"The BurrowsWheeler Transform (BWT) is one of the few preconditioners used in data compression and, in particular, is the core of the popular bzip2 compression utility. This article describes a simple 19line implementation of the BWT in OCaml and progressively optimizes the implementation to use a customized quicksort then distributed forkbased parallelism and finally sharedmemory parallelism. On 8 cores, the final optimized implementation is over 65× faster than the original..."

Dynamic programming: Levenshtein edit distance (8th August 2009)
"Levenshtein distance is a metric used to measure the amount of difference between a pair of sequences in terms of the number of insertions, deletions and substitutions required to get from one sequence to the other. Computing the Levenshtein distance is an interesting problem in dynamic programming with many practical applications including spell checkers and the study of DNA in bioinformatics. This article describes how the basic algorithm may be implemented and then optimized, including the use of both generic and specialized memoization..."

Traversing networks: the nthnearest neighbor (23rd August 2009)
"Graph theory has a great many practical applications ranging from compiler internals to the study of the structural characteristics of materials. This article describes the design and implementation of a program that finds the n^{th}nearest neighbors of a given vertex in an infinite graph. This problem is of interest in the context of atomic structures..."

Stanford Bunny (8th September 2009)
"The Stanford bunny is a 3D mesh of triangles commonly used as a benchmark for computer graphics applications. This web page presents an 85line OCaml program that uses OpenGL to render the Stanford bunny in real time: the mesh is represented as a vertex array and an index array. The vertex array is a sequence of 3D vertex coordinates. The index array is a sequence of triples of indices into the vertex array referring to the three vertices of each triangle. Normals are generated independently for each vertex as the sum of the normals of every triangular face sharing each vertex, in order to provide smooth shading..."

The Graphics module: Pythagoras Tree (23rd September 2009)
"The OCaml distribution includes a Graphics module that provides a set of easytouse portable drawing primitives ideal for educational purposes and experimentation. This article describes the recursive construction of some digital art built around Pythagoras' triangle. The results are visualized interactively using the Graphics module..."

OCaml4Multicore (oc4mc) (10th October 2009)
"OCaml4Multicore is a modified OCaml compiler that allows POSIX threads to run in parallel. This is a major development that makes sharedmemory parallel programming much easier and also has the potential to make it far more efficient for many important appications. This article introduces the subject of threadbased parallel programming, explains why it is difficult to facilitate in OCamllike language implementations and examines the performance characteristics of oc4mc..."

LLVM 2.6 support and a new HLVM garbage collector (23rd October 2009)
"This article describes the changes required to bring HLVM up to date with respect to the new LLVM 2.6 release as well as a new garbage collector design. The previous collector mapped pointers onto their mark state via a hash table. This update uses the more conventional design of placing the mark state in the heap, using a marksweep garbage collector to reclaim unreachable values. The new collector is simpler and offers different performance characteristics..."

Logic programming: nqueens and knight's tour problems (8th November 2009)
"Logic programming is a paradigm often seen in problem solving and AI. This article introduces the subject of logic programming and explains why the OCaml language and implementation are ideally suited to these kinds of applications, using the familiar examples of solving the nqueens problem and finding a knights tour..."

Generating and visualizing 2D mazes (23rd November 2009)
"Maze generation is a remarkably complex and diverse subject that essentially falls into the category of network or graph theory but is most often seen in the context of games and puzzles. The characteristics that make a maze interesting for humans to try to navigate are subjective and not easily defined and, consequently, the design and implementation of an automatic maze generator is as much an art as it is a science. This article describes the design and implementation of a simple but effective maze generation algorithm including OpenGLbased visualization. The algorithm is elegantly expressed in terms of recursive functions and purely functional data structures..."

Parsing and visualizing binary Geographic Information System data (8th December 2009)
"Detailed vector descriptions of worldwide geographical data are freely available in the Shapefile format. This article describes how polygonal data can be parsed from the binary Shapefile format and visualized using OpenGL and GLU easily and efficiently with OCaml. The result is a simple program that can be used as the basis for a wide variety of Geographic Information System (GIS) applications from cartography to climatology..."

Garbage collecting multithreaded programs (23rd December 2009)
"Executing threads in parallel is the cornerstone of efficient parallel programming on sharedmemory machines including today's multicores. This article describes how a simple stoptheworld garbage collector can be implemented in HLVM, allowing code generated from an OCaml program to leverage multicores easily..."

Lowlevel optimization tips and tricks: part 4 (8th January 2010)
"The OCaml programming language is unusually well suited to highperformance computing among functional programming languages because it provides a highly efficient code generator with a performant runtime and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lowerlevel languages like C and Fortran for performancecritical sections of code. This article focuses on the internal representation of data structures. An overview of OCaml's data representation strategy is given. Tools to examine values in the heap, including OCaml's own Obj module, are described. Then several approaches to optimization that are related to data representations are covered, including closures, polymorphic variants, bounds checking, functors and integer arithmetic..."

Highperformance parallel programming with HLVM (23rd January 2010)
"This article describes how a global adjustment of the calling convention brings the performance of the multicorecapable HLVM within 17% of its original singlethreaded performance. A simple parallelization of the new ray tracer benchmark is then described that obtains a substantial 6.3× speedup on 8 cores, demonstrating the potential of the new design for highperformance parallel computing..."

Forcebased network visualization (8th Febuary 2010)
"Visualizing a graph or network of interconnected nodes is a fascinating and important challenge with a wide variety of practical applications. This article looks at a simple but effective forcebased approach to the visualization of networks and uses OpenGL to display the results in realtime as they emerge and GTK+ to provide interactive user control. The result is a compelling interactive animation of the layout algorithm as it progresses..."

Implementing HindleyMilner type inference (23rd Febuary 2010)
"This article walks through the design and implementation of the HindleyMilner type inference algorithm written in OCaml. This algorithm is the foundation of type inference most modern functional programming languages including OCaml. The algorithm acts upon expressions and types using type scheme, substitutions and type environments to infer the type of a given expression..."

Word games (8th March 2010)
"String manipulation is a common task in programming and, in particular, when scripting. Solving word puzzles is an excellent way to learn how these kinds of problems can be approached. This article uses the example of word games to develop a series of programs that manipulate strings using different techniques in OCaml, including sorting and searching..."

Compiler development: part 2 (23rd March 2010)
"This article is the second in a series describing the design and implementation of a complete compiler using the freelyavailable HLVM project described in previous articles. This article extends the compiler implemented in part 1 of the series with support for variant types and basic pattern matching. This requires changes to the representation of the compiler's input, the lexer, the parser, the compiler and the REPL. The language implemented by the resulting compiler is substantially more expressive than the previous version and allows monomorphic MLstyle programs to be compiled and executed..."

The A* algorithm (8th April 2010)
"The A* algorithm is often used for route finding in game AI and is a generalization of Dijkstra's shortestpath algorithm from graph theory. This article describes a simple implementation of the A* algorithm written in OCaml that makes extensive use of the module system including higherorder modules (functors) in order to provide a reusable implementation of this algorithm that is generic over the kinds of graphs that it can handle. Finally, an example application is provided that finds a route around a hill..."

Compiler development: part 3 (23rd April 2010)
"This article continues our series on compiler development using HLVM. An example is provided that breaks the current compiler. The bug is investigated using different techniques and a wellknown solution is implemented. The resulting compiler is then tested on a substantially more complicated symbolic computation and is found to obtain the correct result. Moreover, the time taken to perform this symbolic computation using HLVM is found to be very competitive despite the fact that HLVM was not at all designed for this purpose..."

Artificial Intelligence: Neural Networks (8th May 2010)
"Artificial neural networks are a relatively simple and early form of artificial intelligence modelled directly on the structure of an organic brain. A neural network is composed of many interconnected neurons. Each neuron acts as a simple linear classifier by summing its weighted inputs and firing an output accordingly. The functions involved are essentially adhoc but are usually modelled on those of real neurons. This article describes the design and implementation of a neural network that uses an unconventional functional approach to handle vectormatrix operations that allows temporary data structures to be avoided..."

Sliding Median (23rd May 2010)
"Sliding window algorithms are a class of algorithms that treat streams of data by computing a statistic across a window for each position of the window within the data stream. Moving averages are sliding window algorithms that compute an average over each window. This article examines the moving median algorithm that tracks the median value in a window as it slides across a stream of data. Several possible solutions are examined and their performance is studied on an example data set..."

Visualizing the 2D Fourier Transform (8th June 2010)
"The Fourier transform is one of the most important numerical methods and underpins most forms of spectral analysis. This article describes a simple image compression technique that uses the 2D Fast Fourier Transform (FFT) to remove the highfrequency components of an image, visualizing the result using GTK..."

Quicksort (23rd June 2010)
"The quicksort algorithm was invented by Tony Hoare in 1960 and remains one of the most celebrated algorithms and is still of great practical value. Implementing some of the many variations of the quicksort algorithm serves as an excellent introduction to programming in OCaml..."

The diff tool (8th July 2010)
"The unix program diff identifies differences between text files, line by line. This tool is most useful for comparing two versions of a program. This article develops a simple implementation of the diff tool based upon the longest common subsequence (LCS) algorithm and examines the output from it..."

Rigid body dynamics (23rd July 2010)
"A common technique to simulate the dynamics of objects is to model them as interacting rigid components. This article describes the design and implementation of a simple OCaml program that uses rigid body dynamics to simulate balls bouncing around in 2D, using OpenGL for 2D visualization..."