Five months after the initial merge of the multicore branch into the mainline OCaml and three months after the release of OCaml 4.14.0, OCaml 5.0.0 is starting to take shape.
I am thus happy to announce an exceptional zeroth alpha release of OCaml 5.0.0 (see below for the installation instructions).
This alpha release is expected to be rougher than an usual alpha release, due to the full rewrite of the OCaml runtime. In particular, the bytecode debugger will only be available in the next alpha release. Similarly, there will be some changes to the internal C runtime API and to the files installed by the compiler package in the next alpha release.
Moreover, this zeroth alpha release is the occasion to remind everyone that OCaml 5.0 itself is expected to be a more experimental release than usual. Notably, the native compiler will only be available on the ARM64 and x86-64 architectures in this 5.0 release.
Nevertheless, this zeroth alpha version is already stable enough for fellow hackers eager to join us in our early bug hunting and opam ecosystem fixing fun, or to venture in the new era of parallelism and (experimental) effects.
You can follow the progresses in stabilising the opam ecosystem on
OCaml 5.0 Release Readiness ¡ Issue #21526 ¡ ocaml/opam-repository ¡ GitHub
A brief summary is that at least dune, merlin, ppxlib, utop, ocamlfind, and ocamlbuild work (potentially by using patches from the alpha opam repository).
If you find any bugs, please report them here:
Issues ¡ ocaml/ocaml ¡ GitHub
In particular, any sequential OCaml 4 library or program should be valid in OCaml 5 (except for deprecated modules and functions). Please donât hesitate to report any compatibility bugs!
If you are interested by the ongoing list of bug fixes, the updated change log for OCaml 5.0.0 is available at:
ocaml/Changes at 5.0 ¡ ocaml/ocaml ¡ GitHub
Installation instructions
The base compiler can be installed as an opam switch with the following commands
on opam 2.1:
opam update
opam switch create 5.0.0~alpha0
For previous version of opam, the switch creation command line is slightly more verbose:
opam update
opam switch create 5.0.0~alpha0 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
If you want to tweak the configuration of the compiler, you can switch to the option variant with:
opam update
opam switch create <switch_name> ocaml-variants.5.0.0~alpha0+options <option_list>
where <option_list>
is a comma separated list of ocaml-option-*
packages. For instance, for a flambda and no-flat-float-array switch:
opam switch create 5.0.0~alpha0+flambda+nffa ocaml-variants.5.0.0~alpha0+options ocaml-option-flambda ocaml-option-no-flat-float-array
The command line above is slightly more complicated for an opam version anterior to opam 2.1:
opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~alpha0+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
In both cases, all available options can be listed with opam search ocaml-option
.
If you want to test this version, it is strongly advised to install the alpha opam repository
with
opam repo add alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git
This alpha repository contains various fixes in the process of being upstreamed.
The source code for the alpha is also available at these addresses:
https://github.com/ocaml/ocaml/archive/5.0.0-alpha0.tar.gz
https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~alpha0.tar.gz