# OCaml 5.0, first normal alpha release

**URL:** <https://discuss.ocaml.org/t/ocaml-5-0-first-normal-alpha-release/10216>\
**Category:** Ecosystem\
**Created:** [July 22, 2022, 8:41am UTC](https://discuss.ocaml.org/t/ocaml-5-0-first-normal-alpha-release/10216 "2022-07-22T08:41:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [July 22, 2022, 8:41am UTC](https://discuss.ocaml.org/t/ocaml-5-0-first-normal-alpha-release/10216/1 "2022-07-22T08:41:12Z")

</div>

The stabilisation of OCaml 5.0 has been progressing well during the last month.  
We have thus released a first normal alpha release of OCaml 5.0.0 to help  
fellow hackers join us early in our bug hunting and opam ecosystem fixing fun  
(see below for the installation instructions).

You can follow the progress in stabilising the opam ecosystem on

[OCaml 5.0 Release Readiness · Issue #21526 · ocaml/opam-repository · GitHub](https://github.com/ocaml/opam-repository/issues/21526)

If you find any bugs, please report them here:

[GitHub · Where software is built](https://github.com/ocaml/ocaml/issues)

Compared to the zeroth alpha release, this alpha release restores the support  
for the bytecode debugger, and integrates a change of type in the FFI API that  
might trigger some warnings in FFI code.

We also have a change in the installed files: the compiler distributes now its  
own META files rather than relying on either findlib or dune to provide those  
files. This should simplify the tasks of both tools in future version.

Note there are still some changes expected in the Effect module before the next  
candidate release. Generally, both the Effect and Domain modules are still  
experimental and might change API even during the beta releases.

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](https://github.com/ocaml/ocaml/blob/5.0/Changes)

A short summary of the changes since the zeroth alpha release is also available  
below.

## Installation instructions

The base compiler can be installed as an opam switch with the following commands  
on opam 2.1:

```auto
opam update
opam switch create 5.0.0~alpha1

```

For previous version of opam, the switch creation command line is slightly more verbose:

```auto
opam update
opam switch create 5.0.0~alpha1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

```

If you want to test this version, it is strongly advised to install the alpha  
opam repository

> **[GitHub - kit-ty-kate/opam-alpha-repository: A test opam overlay containing packages compatible...](https://github.com/kit-ty-kate/opam-alpha-repository)**
>
> A test opam overlay containing packages compatible with the next release of the OCaml compiler

with

```auto
opam repo add alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git

```

You can check that the alpha repository has been correctly installed with

```auto
$ opam repo

```

```auto
<><> Repository configuration for switch 5.0.0~alpha1 <><><><><><><><><><><><><>
 1 alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git
 2 default https://opam.ocaml.org

```

This alpha repository contains various fixes in the process of being upstreamed which  
vastly increases the number of opam packages currently compatible with OCaml 5.0.0 .

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

```auto
opam update
opam switch create <switch_name> ocaml-variants.5.0.0~alpha1+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:

```auto
opam switch create 5.0.0~alpha1+flambda+nffa ocaml-variants.5.0.0~alpha1+options ocaml-option-flambda ocaml-option-no-flat-float-array

```

The command line above is slightly more complicated for opam version anterior to 2.1:

```auto
opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~alpha1+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`.

The source code for the alpha is also available at these addresses:

[https://github.com/ocaml/ocaml/archive/5.0.0-alpha1.tar.gz](https://github.com/ocaml/ocaml/archive/5.0.0-alpha1.tar.gz)  
[https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~alpha1.tar.gz](https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~alpha1.tar.gz)

## Changes since the zeroth alpha release:

### Runtime system:

- [#11400](https://github.com/ocaml/ocaml/issues/11400): Runtime events counters fixes  
Fixes mismatch between OCaml and C APIs, removes events from 4.x that  
are not present in the 5.0 GC and adds some missing probes.  
(Sadiq Jaffer, review by Gabriel Scherer, Florian Angeletti)

- [#11368](https://github.com/ocaml/ocaml/issues/11368): Runtime events buffer size OCAMLRUNPARAMS fix  
The runtime events buffer size can now be set via the ‘e’ OCAMLRUNPARAM.  
This is previously mistakenly enabled/disabled tracing instead.  
(Sadiq Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien Doligez)

- [#11304](https://github.com/ocaml/ocaml/issues/11304): Fix data race on Windows file descriptors  
(Olivier Nicole and Xavier Leroy, review by Xavier Leroy, David Allsopp,  
and Sadiq Jaffer)

- (_breaking change_) [#11337](https://github.com/ocaml/ocaml/issues/11337): pass ‘flags’ metadata to root scanners, to optimize stack  
scanning in the bytecode interpreter.  
Changes the interface of user-provided root-scanning hooks.  
(Gabriel Scherer, review by Xavier Leroy,  
Guillaume Munch-Maccagnoni, Sadiq Jaffer and Tom Kelly)

- [#11144](https://github.com/ocaml/ocaml/issues/11144): Restore frame-pointers support for amd64  
(Fabrice Buoro, review by Frederic Bour and KC Sivaramakrishnan)

- (_breaking change_) [#11255](https://github.com/ocaml/ocaml/issues/11255): in the C interface, `&Field(v, i)` now has type `volatile value *`  
instead of `value *` in OCaml 4. This makes the memory model  
for mixed OCaml/C code better defined, but can cause warnings or type  
errors in user C code.  
(KC Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and  
Guillaume Munch-Maccagnoni, additional discussions with Stephen  
Dolan and Luc Maranget)

### Standard library:

- [#10867](https://github.com/ocaml/ocaml/issues/10867), +[#11345](https://github.com/ocaml/ocaml/issues/11345): Remove deprecated values:  
…, the infix operator (.[]\<-).  
(Nicolás Ojeda Bär, review by Damien Doligez)

- [#11309](https://github.com/ocaml/ocaml/issues/11309), [#11424](https://github.com/ocaml/ocaml/issues/11424), [#11427](https://github.com/ocaml/ocaml/issues/11427): Add Domain.recommended\_domain\_count.  
(Christiano Haesbaert, Konstantin Belousov, review by David Allsopp,  
KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar)

### Tools:

- [#11065](https://github.com/ocaml/ocaml/issues/11065): Port the bytecode debugger to 5.0, adding support for effect handlers.  
(Damien Doligez and fabbing, review by fabbing and Xavier Leroy)

- [#11382](https://github.com/ocaml/ocaml/issues/11382): OCamlmktop use a new initialization module “OCamlmktop\_init” to  
preserve backward-compatibility with user-module provided modules that install  
toplevel printers.  
(Florian Angeletti, review by Gabriel Scherer and David Allsopp)

### Installation:

- [#11007](https://github.com/ocaml/ocaml/issues/11007), [#11399](https://github.com/ocaml/ocaml/issues/11399): META files for the stdlib, compiler-libs and other libraries  
(unix, dynlink, str, runtime\_events, threads, ocamldoc) are now installed  
along with the compiler.  
(David Allsopp, Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer,  
review by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel Scherer)

### Bug fixes:

- [#10768](https://github.com/ocaml/ocaml/issues/10768), [#11340](https://github.com/ocaml/ocaml/issues/11340): Fix typechecking regression when combining first class  
modules and GADTs.  
(Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

- [#10790](https://github.com/ocaml/ocaml/issues/10790): don’t drop variance and injectivity annotations when pretty printing  
`with` constraints (for example, `with type +!'a t = ...`).  
(Florian Angeletti, report by Luke Maurer, review by Matthew Ryan and  
Gabriel Scherer)

- [#11289](https://github.com/ocaml/ocaml/issues/11289), [#11405](https://github.com/ocaml/ocaml/issues/11405): fix some leaks on systhread termination  
(Fabrice Buoro, Enguerrand Decorne, Gabriel Scherer,  
review by Xavier Leroy and Florian Angeletti, report by Romain Beauxis)

- [#11314](https://github.com/ocaml/ocaml/issues/11314), [#11416](https://github.com/ocaml/ocaml/issues/11416): fix non-informative error message for module inclusion  
(Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)

- [#11358](https://github.com/ocaml/ocaml/issues/11358), [#11379](https://github.com/ocaml/ocaml/issues/11379): Refactor the initialization of bytecode threading,  
This avoids a “dangling pointer” warning of GCC 12.1.  
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)

- [#11387](https://github.com/ocaml/ocaml/issues/11387), module type with constraints no longer crash the compiler in presence  
of both shadowing warnings and the `-bin-annot` compiler flag.  
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)

---

_[View the full topic](https://discuss.ocaml.org/t/ocaml-5-0-first-normal-alpha-release/10216)._
