Sunday, 22 March 2009

Building a Virtual Machine with LLVM: part 3

The OCaml Journal just published an article about the HLVM project:

"This is the third and final article in the series about the design and construction of the high-level 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 run-time representations of values in OCaml and HLVM is described in detail and the GC implementation described is partially generated at run-time and JIT compiled..."

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

Thursday, 19 March 2009

OCaml at Cilk Arts Ltd.

Cilk is an award-winning language for multithreaded parallel programming based on ANSI C and is the culmination of 15 years of research at MIT in preparation for the shared memory multicore computers that are now ubiquitous. An open source implementation of Cilk is freely available.

We have tried Cilk ourselves and found the solution it provides to be both easy and extremely efficient and it is certainly preferable to cumbersome alternatives like OpenMP. In fact, we were so impressed that we are not only using Cilk to write an experimental parallel garbage collector for our HLVM project but we are also drawing upon the design of Cilk to provide high-level parallel constructs as well.

The group responsible for Cilk founded a spin-off company Cilk Arts Ltd. in 2006 using venture capital. Cilk Arts released their first commercial product, Cilk++, in 2008. The company is now rapidly asserting itself as a major player for shared memory parallel programming.

Interestingly, although the open source implementation of Cilk is written in C, Cilk Arts have been hiring OCaml programmers since 2007 because a "major part" of their code base is written in OCaml.

Saturday, 7 March 2009

Low-level optimization tips and tricks: part 3

The OCaml Journal just published an article about optimization:

"The OCaml programming language is unusually well suited to high-performance computing among functional programming languages because it provides a highly efficient code generator with a performant run-time and garbage collector. This makes it feasible to write high performance programs entirely in OCaml without having to drop to lower-level languages like C and Fortran for performance-critical 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..."

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