As we’ve been working on the various OCaml Platform tools such as opam, dune, odoc, merlin, ocamlformat and so on, a common question we have is the range of OCaml compiler versions that need to be supported. Often, the minimum OCaml compiler version is the minimum one that is packaged up in common OCaml distributions – for example, 4.01.0 has just last week rotated out of support (it was the default OCaml compiler in Ubuntu 14.04 which has just reached EOL on Apr 30th 2019). This was a compiler we released over five and a half years ago, so you can hopefully appreciate the depth of the support burden this is creating for the tooling developers.
In recent years, we’ve been putting significant effort into making it easier to separate the tasks of upgrading your codebases to newer versions of the compiler, by making it easier to cherry pick some features to older compilers. For example:
- stdlib-shims provides newer modules in the stdlib for older compilers to help you migrate codebases
- the ppx ecosystem has abstraction layers such as ppxlib and omp to cushion the AST changes for preprocessors
- dune supports future syntax since 1.8 which applies shiny new syntax (e.g.
let+) to older compilers, again to make it easier to separate the adoption of new features from upgrading compiler versions.
In the longer term, for tools such as
dune we would really like to be able to support (e.g.) just the last three major revisions of the compiler, and perhaps have one version that is in something like Debian Stable as an LTS version that we support for longer. The data we need from you, and especially from users who use old versions of the compiler, is what is holding you back from upgrading.
Some examples of why some communities hold back have been:
- Bucklescript has long used 4.02 as its base, although there are newer versions for 4.06 now.
- MirageOS has had to manually upgrade some cross-compiled “freestanding” libraries on every OCaml release. The lag here is dropping as the compiler gains better cross-compilation support steadily.
So if you are a user (large- or small-scale, it doesnt matter), and are using a version of the compiler that is OCaml 4.02.3 or lower, we’d love to hear the reasons why you are still there. Your input will help us figure out if there is missing tooling we need to develop from the compiler side to aid with transition, or otherwise improve documentation and processes.
Note that we are not planning any immediate changes to dune or opam. This is a data gathering exercise in preparation for having a support policy for these tools, and one in which we could really use your input. If you want to drop myself or @diml a private line for a non-public discussion, then please also feel free to do that.