13 Jun 2017
We recently published a paper on concurrent system programming with effect
handlers. In this paper, we show
that with the help of effect handlers, we could express in direct-style,
various interactions of a concurrent program with OS services that typically
require callbacks. The question is what do we do about legacy code that uses
monadic concurrency libraries such as Lwt and Async. Surely a wholesale rewrite
of all Lwt and Async code is a no go. This post is an exploration of some ideas
to make Lwt and Async compatible with direct-style code.
05 Mar 2017
One of the key indicators of maturity of a language ecosystem is the ease of
building, managing and publishing software packages in that language. OCaml
platform has made steady progress in the last few years to this end. While
OPAM simplified package (and compiler) management,
the developing and publishing packages remained a constant pain point. This
situation has remarkably improved recently with the
Topkg and
Carcass. This post provides a short
overview of my workflow for building and publishing an OCaml package using Topkg
and Carcass.
15 Feb 2017
Ezirmin is an easy interface over the
Irmin, a library database for building
persistent mergeable data structures based on the principles of Git. In this
post, I will primarily discuss the Ezirmin library, but also discuss some of the
finer technical details of mergeable data types implemented over Irmin.
30 Jun 2016
Behavioural types such as session types, contracts and choreography describe the
behaviour of a software entity as a sequence of operations on a resource such
as a communication channel, web service session or a file descriptor.
Behavioural types capture well-defined interactions, which are enforced
statically with the help of type system machinery. In this post, I will describe
a lightweight embedding of behavioural types in OCaml using polymorphic variants
through a series of examples. The complete source code for the examples is
available
here.
11 Jun 2016
Efficient concurrent programming libraries are essential for taking advantage of
fine-grained parallelism on multicore hardware. In this post, I will introduce
reagents, a composable, lock-free
concurrency library for expressing fine-grained parallel programs on Multicore
OCaml. Reagents offer a
high-level DSL for experts to specify efficient concurrency libraries, but also
allows the consumers of the libraries to extend them further without knowing the
details of the underlying implementation.
16 May 2016
This is a short tutorial on how to build
Reason apps for an ARM target with the help
of Docker. I am using Docker for
Mac, which is
still under beta program. Using Docker for development has two important
advantages over traditional cross-compilation. First, the Reason toolchain comes
packaged as a Docker image and hence no local installation is necessary.
Secondly, cross-compilers are often tricky to get right. Docker for Mac comes
with multiarch support and hence removes the need for traditional
cross-compilation.
27 Oct 2015
In the last
post,
I described a flat allocation profiler for OCaml 4.02 bytecode interpreter.
In this post, I’ll describe further developments which add support for call
stack information and better location information. Lets dive straight to the
usage:
23 Sep 2015
This post describes a simple flat allocation profiler for OCaml 4.02 bytecode
interpreter.
10 Sep 2015
I recently gave a talk on Algebraic Effects in OCaml at the OCaml Workshop
2015. The extended abstract and the
slides from the talk are available here. The slides
should provide a gentle introduction to programming with algebraic effects and
handlers in OCaml. The examples from the talk (and many more!) are available
here.
27 May 2015
In the previous
post, I
presented a simple cooperative multithreaded scheduler written using algebraic
effects and their handlers. Algebraic effects are of course useful for
expressing other forms of effectful computations. In this post, I will present
a series of simple examples to illustrate the utility of algebraic effects and
handlers in OCaml. Some of the examples presented here were borrowed from the
excellent paper on Eff programming language. All of the examples
presented below are available
here.