OCaml Software

Contents


A lot of my personal projects are about improving the developer experience when working with the OCaml programming language. Or to diversify the kind of applications that can be developed with it.

The project I spent the most time on is Merlin, a “Language Server” before this term was coined. It grew in scope and is now developed by Tarides.

I am interested in multimedia applications – GUI, audio processing, video games. In particular, I want to explore alternatives to the popular object-oriented software architectures in these domains.

Beside, I enjoy logic, programming language theory, algorithmic and data structures. You will find developments related to these topics below.

GUI and interactive applications

A few personal projects where I wander in the design space of graphical applications.

Lwd – “Lightweight documents”, a functional DOM

Website: def/lwd

Mixing reactive, functional and procedural programmings.

Nottui – A terminal UI library

Website: def/lwd/nottui

It is built on top of Lwd and Notty.

Wall – OpenGL-based 2d vector graphics renderer

Website: def/wall

Wall is a small rendering library. It targets OpenGL but represents the scene as pure data. It is a functional port of NanoVG.

Cuite – tentative bindings to Qt 5

Qt is one of the two major UI toolkit used by free operating systems. The other, Gtk, can already be accessed from OCaml with LablGtk.

However, Qt has better support for proprietary platforms and covers a larger spectrum of desktop UI idioms. It is one of the best library for developing traditional “productivity” applications (Ultimatepp and Lazarus are interesting alternatives).

Cuite brings Qt Gui library to OCaml and provides foundations to bind other Qt libraries. Most of the code is generated from an (E)DSL that describes Qt object hierarchies:

This design permits to reuse the description to connect to other programming languages, by porting the runtime support and adding a new backend to the compiler. The main benefit is that this work is independent of the size of the QObject hierarchy, which constitutes the majority of Qt.

Ibutsu – OCaml bindings to some self-contained media libraries

Ibutsu (foreign body in Japanese) is an OCaml package to decode and sometimes encode:

It also provides a few image processing and resizing filters as well as efficient perlin noise implementation.

The core processing is done by C code, most coming from Sean Barret‘s Stb libraries and also from Minimp3. These are reasonably fast implementations. Even more important, they are self-contained, portable C files. Therefore this package has no system dependency. It uses the same C compiler as used by OCaml installation and behaves like a portable OCaml package.

Other libraries

Ztl – a typed interface to Z3 prover

Z3 API is tricky to use. Most of the work is done by manipulating values of type Z3.Expr.expr, while these values denote expressions of different, often incompatible, sorts.

The main benefit of Ztl is leveraging the type system to enforce well-sorted manipulations. If OCaml types, Z3 term is well-sorted.

Ztl also offers a simplified, purely functional, interface to Z3 solvers and contexts. For a moderate overhead, it will take care of snapshotting and backtracking for you. No need to bother with global state anymore.

Grenier – a collection of algorithms and data structures

Grenier regroups implementations of self-contained algorithms – too small to justify the overhead of having a separate package, IMHO.

There are implementations of algorithms for manipulating binary trees, solving order maintenance, bin packing, minimizing automata, etc.