Special Offers
Buy 6 month subscriptions to both the OCaml and F#.NET Journals and get over 20% off! |
 |
+ |
 |
= |
|
|
-
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 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..."
-
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 high-performance 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 higher-order 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 yacc-based 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 high-performance 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 built-in Set module..."
-
Introduction to OpenGL (12th November 2007)
"OpenGL is the defacto-standard cross-platform graphics API and provides an efficient way to leverage the high-performance 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 high-quality graphics in real-time 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 real-time 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 higher-order functions and functors in the context of numerical algorithms such as function minimization..."
-
Language-oriented programming: The Term-level 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 term-level interpreter for a programming language in only a tiny amount of code..."
-
High-fidelity graphics with OpenGL 2 (25th February 2008)
"The single most important advancement made in consumer-level graphics accelerators in recent years was the advent of the programmable graphics pipeline. OpenGL 2 introduces the high-level 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 high-performance graphics using per-pixel Phong shading..."
-
Run-time compilation with LLVM (8th March 2008)
"The Low-Level Virtual Machine (LLVM) project brings high-performance 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 general-purpose 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 term-level 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 dynamically-typed 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..."