Thursday, 24 September 2009

The Graphics module: Pythagoras Tree

The OCaml Journal just published an article about the built-in Graphics module:

"The OCaml distribution includes a Graphics module that provides a set of easy-to-use 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..."

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

OCaml finally goes multicore

Philippe Wang made the exciting announcement recently that the first working version of oc4mc, OCaml with a new parallel garbage collector, has been released. This revolutionary development allows threads in OCaml programs to be executed in parallel for the first time, making it possible to leverage multicores efficiently in OCaml programs.

We can confirm that oc4mc is working on one of our 8-core machines and shows excellent speedups for simple multithreaded numerical computations.

The next major developments in this area will doubtless be better libraries for parallel programming in OCaml, the adoption of oc4mc in the major apt repositories used by the majority of Linux programmers and finally the creation of literature describing the design and characteristics of this implementation.

Congratulations to the team (Mathias Bourgoin, Adrien Jonquet, Emmanuel Chailloux, Benjamin Canou and Philippe Wang) for making this happen and thanks to Jane St. Capital for making the project possible!

Stanford Bunny

The OCaml Journal just published an article about mesh visualization:

"The Stanford bunny is a 3D mesh of triangles commonly used as a benchmark for computer graphics applications. This article presents an 85-line 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..."

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

Traversing networks: the nth-nearest neighbor

The OCaml Journal just published an article about graph theory:

"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 nth-nearest neighbors of a given vertex in an infinite graph. This problem is of interest in the context of atomic structures..."

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