• en

OCaml Planet

The OCaml Planet aggregates various blogs from the OCaml community. If you would like to be added, read the Planet syndication HOWTO.

940 blog posts are available. You can read the 30 more recent ones below or view older ones.

Software Engineer (Haskell, Full Stack) at Capital Match (Full-time) — Functional Jobs (FunctionalJobs.com), Nov 24, 2017

About Us: Capital Match is a leading P2P lending platform based in Singapore, founded in 2014, backed by alternative investment management firm with more than US$ 5 bn AUM. We are looking for experienced developers to lead our tech growth in the Fintech space, expand into surrounding countries and develop new products on the platform.

Job Description: We are inviting developers with a minimum of 5 years coding experience. The candidate should have functional programming experience as well as…


Eighteenth OCaml compiler hacking evening at Pembroke, Cambridge — OCaml Labs compiler hacking, Nov 21, 2017

Our next OCaml Compiler Hacking event will be on Thursday 7th December in The Thomas Gray Room at Pembroke College, Cambridge.

If you're planning to come along, it'd be helpful if you could indicate interest via Doodle and sign up to the mailing list to receive updates.

When: Thursday 7 December 2017, 19:00 - 22:30

Where: The Thomas Gray Room, Pembroke College, Cambridge CB2 1RF

Who: anyone interested in improving OCaml. Knowledge of OCaml programming will obviously be helpful, but p…


Migration to GitHub is complete — Coq, Nov 21, 2017

After several years of using GitHub specifically for its pull request system, the Coq development team has migrated the Coq bug tracker and Cocorico, the Coq wiki to GitHub as well.

More information about the migration of the Coq bug tracker may be found in this blog post.

More information about the migration of Cocorico, the Coq wiki, may be found on this wiki page.

Finally, the GitHub repository is now the repository we push to (as opposed to a mirror). Make sure that your git clone is tra…


PhD Thesis: Tierless Web programming in ML | Drup's thingies — Gabriel Radanne, Nov 15, 2017

I’m happy to announce that I successfully defended my PhD Thesis!

Towers of Hanoi — Shayne Fletcher, Nov 11, 2017

Towers of Hanoi

The "towers of Hanoi" problem is stated like this. There are three pegs labelled a, b and c. On peg a there is a stack of n disks of increasing size, the largest at the bottom, each with a hole in the middle to accomodate the peg. The problem is to transfer the stack of disks to peg c, one disk at a time, in such a way as to ensure that no disk is ever placed on top of a smaller disk.

The problem is amenable to a divide and conquer strategy : "Move the top n - 1 disk…


OCaml 4.06.0 released — Caml INRIA, Nov 03, 2017

Windows Unicode Support - A Bug-Fix 12 Years in the Making — OCaml Labs, Oct 30, 2017

(Only) 12 years after the initial Mantis issues - and with thanks to a huge community effort - we now have Windows support in the OCaml 4.06.0 release candidate! Read more in David’s detailed blog post and follow the conversation on our Discuss forum.

Nesting quoted strings in OCaml — Shayne Fletcher, Oct 28, 2017


According to the lexical conventions of OCaml, characters different from \ and " can be enclosed in single quotes and appear in strings. The special characters \ and " are represented in these contexts by their escape sequences. The escape sequence \\ denotes the character \ and \" denotes the character ".

Here we print the string "Hello world!". The quotes delimit the string and are not themselves part of the string.

utop[0]> Caml.Printf.printf "Hello world!";;

Fuzzing for CI Workflows — OCaml Labs, Oct 24, 2017

Stephen Dolan recently presented crowbar at the 2017 OCaml Workshop. Crowbar bridges a gap between property-based testing frameworks and instrumentation-based automated testing techniques. Tests written in Crowbar can be executed by the wildly popular and successful American Fuzzy Lop fuzzer. (For more on testing OCaml code with AFL, see the afl-persistent README, Crowbar’s examples, or a user’s DHCP library tests.)

American Fuzzy Lop provides a command-line tool for running tests, afl-fu…


Pearl No.4 - Kth Smallest in the Union of 2 Sorted Collections — Xinuo Chen, Oct 19, 2017


Here is the Pearl No.4:

Let A and B be two disjoint ordered collections with distinct elements inside. Their combined size is greater than k.

  1. A and B are sorted, but the underlying data structures are not specified as they are collections.
  2. A and B do not have common elements, since they are disjoint
  3. All elements in A and B are distinct
  4. The total number of all elements is larger than k

Find the kth smallest element of A ∪ B.

By definition, the kth smallest elem…


Coq 8.7.0 is out — Coq, Oct 17, 2017

The final release of Coq 8.7.0 is available. Coq 8.7 includes:
  • A large amount of work on cleaning and speeding up the code base, notably the work of Pierre-Marie Pédrot on making the tactic-level system insensitive to existential variable expansion, providing a safer API to plugin writers and making the code more robust.
  • New tactics:
    • Variants of tactics supporting existential variables eassert, eenough, etc. by Hugo Herbelin;
    • Tactics extensionality i…

How to render trees like the Unix tree command — Shayne Fletcher, Oct 14, 2017

How to render trees like Unix 'tree'

The Unix tree utility produces a pretty rendering of a filesystem. Implementing an algorithm to produce output like tree is a little harder than one might expect! This short example program illustrates one way of doing it.

(* A type of non-empty trees of strings. *)
type tree = [
|`Node of string * tree list

(* [print_tree tree] prints a rendering of [tree]. *)
let rec print_tree
?(pad : (string * string)= ("", ""))
(tree :…

"More OCaml" updated to support OCaml 4.06 immutable strings — OCaml Book, Oct 14, 2017

OCaml 4.06 has, by default, immutable strings. This necessitates some changes to "More OCaml" ("OCaml from the Very Beginning" is unaffected).

The paper and kindle books (on Amazon), as well as the PDF e-book here, have been updated, together with the online resources. The new code works on any version of OCaml starting from 4.02.0.

If you are an existing customer, and have not received an update email, please contact the author using the form on this website.

Implementing the PowerPC backend for BAP - Part 0 — The BAP Blog, Oct 13, 2017

On this week we started to work on the PowerPC backend. We are planning a series of blog posts that will describe the process and probably will help others, who will pursue the task of implementing a backend for BAP, by either suggesting the right way or discouraging by showing an example of how one shouldn’t do this.

As you may know, BAP is a platform for program analysis that works with compiled binaries. In a sense, BAP is dual to a compiler, since we move in the opposite direction – we …


NAT your own packets — Mindy Preston, Oct 10, 2017

I’ve been talking about network address translation here for a while, including instructions on building your own NAT device with MirageOS. The library behind those posts, mirage-nat, went on to back talex5’s unikernel firewall for QubesOS, but was unreleased and essentially unmaintained between late 2015 and early 2017. At the March 2017 MirageOS hack retreat in Marrakesh, talex5 convinced me to do some much-needed maintenance on this library. After having let it age between March a…Read more...

Coq 8.7+beta2 is out — Coq, Oct 06, 2017

The second beta release of Coq 8.7 is available for testing. Coq 8.7 includes:
  • A large amount of work on cleaning and speeding up the code base, notably the work of Pierre-Marie Pédrot on making the tactic-level system insensitive to existential variable expansion, providing a safer API to plugin writers and making the code more robust.
  • New tactics:
    • Variants of tactics supporting existential variables eassert, eenough, etc. by Hugo Herbelin;
    • Tactics

The BAP Tutorial — The BAP Blog, Oct 03, 2017

It was a lasting issue that BAP didn’t have a tutorial. We have an extensive reference documentation that can even be considered as a manual, we have wiki and chats, but still it was necessary to read lots of stuff even for writing the simplest analysis. That’s why people kept asking us for the tutorial. So, today we are happy to announce the first true tutorial.

The target auditory of the tutorial is expected to be more or less advanced, as the tutorial will cover not only the basics, but …


Testing Your Own Fork With OCaml's GitHub CI — OCaml Labs, Sep 27, 2017

There are various Continuous Integration (CI) systems monitoring OCaml. The most publicly visible of these are the two which run on our GitHub repository: Travis, which tests GNU/Linux in 32-bit and 64-bit configurations and also performs a few sanity checks on pull requests, and AppVeyor which tests some of the native Windows ports.

Between branching and a new release of OCaml there is a large spike in activity, and our CI systems can become overloaded when running across many PRs and branches…


Revised Code Size Estimates for Examachine Releases — Eray Özkural, Sep 13, 2017

This post is in reference to Celestial Intellect Cybernetics's AGI (Artificial General Intelligence) Platform called Examachine. Examachine's core is a "parallel AGI kernel" which presents a generic programming API implementing parallel incremental general-purpose machine learning algorithms for heterogeneous supercomputers, and …

Coq 8.7 beta 1 is out — Coq, Sep 06, 2017

The first beta release of Coq 8.7 is available for testing. Coq 8.7 includes:
  • A large amount of work on cleaning and speeding up the code base, notably the work of Pierre-Marie Pédrot on making the tactic-level system insensitive to existential variable expansion, providing a safer API to plugin writers and making the code more robust.
  • New tactics:
    • Variants of tactics supporting existential variables eassert, eenough, etc. by Hugo Herbelin;
    • Tactics e…

Platforms, Packaging, Progress — OCaml Labs, Sep 04, 2017

Richard Mortier recently decided to refresh and update his ocal command-line calendaring package, and took the opportunity to use the new packaging and build features present in opam: topkg and jbuilder.

This post from Mort details the process of removing remnants of older features such as Oasis, creating new jbuild files and topkg skeletons, and finally preparing and publishing a release into opam.

Merlin 3.0.0 on Windows — OCaml Labs, Aug 25, 2017

David Allsopp has previously contributed patches for native Windows support to Merlin, and after the release of Merlin 3.0.0 back in July, he’s been working with Frédéric Bour to port the new features to Windows.

This post from David explores some of the challenges for cross-platform development between Windows and Unix systems.

Alleged "hack" of our site: just a spam — Coq, Aug 23, 2017

The alleged "hack" of coq.inria.fr that led to several days of downtime for investigations was nothing more than a spam bug report. More details here.

Batteries 2.7.0 released — OCamlCore Forge News (Gabriel Scherer), Aug 17, 2017

This minor release is the first to support OCaml 4.05.0. See the full release notes at https://github.com/ocaml-batteries-team/batteries-included/releases/tag/v2.7.0

Transpose — Shayne Fletcher, Aug 12, 2017


If we are to represent a row of a matrix as a list of numbers, then a matrix can naturally be represented as a list of lists of numbers.

The transpose of a matrix $\mathbf{A}$ is a new matrix denoted $\mathbf{A^{T}}$. The traditional mathematical definition of $\mathbf{A^{T}}$ is expressed as saying the $i$ th row, $j$ th column element of $\mathbf{A^{T}}$ is the $j$ th row, $i$ th column element of $\mathbf{A}$:


frama-clang 0.0.3, compatible with Frama-C 15 is out. Download ithere. — Frama-C, Aug 02, 2017

A New Implementation of Git — OCaml Labs, Jul 27, 2017

Displaying his own true sense of style, Romain Calascibetta added an incredibly detailed (and hilariously funny) PR for integrating his new Git implementation into ocaml-git - using the new implementation!

For the last ~6 months, Romain has been working hard to improve ocaml-git: decoding/encoding PACK files; implementing the git gc command; git push; and HTTP protocol.

He is currently integrating this work into the existing ocaml-git implementation using a bottom-to-top method, and as the new…


Coq 8.6.1 is out — Coq, Jul 25, 2017

Version 8.6.1 of Coq is available. It fixes several bugs of version 8.6. More information can be found in the CHANGES file. Feedback and bug reports are extremely welcome.

Major Releases of Cohttp, Conduit, DNS and TCP/IP Libraries — OCaml Labs, Jul 19, 2017

Whilst porting a large portion of Mirage libraries to use Jbuilder, the MirageOS core team realised it was also a great opportunity to reorganise the package structure of some specific libraries, update/remove old code and improve overall functionality.

Many of the new releases include popular libraries used by projects other than MirageOS, and the maintainers have helpfully provided details on what has changed, specific improvements and adjustments users will need to make in order to use them.…


OCaml EFL 1.19.0 released and migration to GitHub — OCamlCore Forge News (Alexis Bernadet), Jul 13, 2017

Moved to version 1.19 of the EFL. Like the previous version, only version 1.8 and higher of the EFL and Elementary are required to build this version of OCaml EFL. This is probably the last version of OCaml EFL released on OCaml Forge. This project will migrate to GitHub: https://github.com/axiles/ocaml-efl

View older blog posts.