[Caml-list] Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt
2025-07-29T09:36:32Z

[-- Attachment #1: Type: text/plain, Size: 14173 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of July 22 to 29,
2025.

Table of Contents
─────────────────

opam 2.4.1
new tools to keep your projects clean (after AI, or just after yourself)
First beta release for OCaml 5.4.0
Encoding SAT in OCaml GADTs
Other OCaml News
Old CWN

opam 2.4.1
══════════

Archive: <https://discuss.ocaml.org/t/ann-opam-2-4-1/17002/1>

Kate announced
──────────────

Hi everyone,

Following up the regression [reported a couple of days ago] affecting
some users of `pin-depends', we are releasing 2.4.1.

You can read our [blog post] for relevant links and details.

[reported a couple of days ago]
<https://discuss.ocaml.org/t/ann-opam-2-4-0-is-out/16989/3>

[blog post] <https://opam.ocaml.org/blog/opam-2-4-1/>

Try it!
╌╌╌╌╌╌╌

The upgrade instructions are unchanged:

For Unix systems
┌────
│ bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.4.1"
└────
or from PowerShell for Windows systems
┌────
│ Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.4.1"
└────
Please report any issues to the [bug-tracker].

Happy hacking, <> <> The opam team <> <> :camel:

[bug-tracker] <https://github.com/ocaml/opam/issues>

new tools to keep your projects clean (after AI, or just after yourself)
════════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-new-tools-to-keep-your-projects-clean-after-ai-or-just-after-yourself/17004/1>

Thomas Gazagnaire announced
───────────────────────────

Hi all,

I’ve been experimenting with AI code assistants lately. They’re
surprisingly good at generating new code but it's not very good at
remembering things: it's like having a steady stream of good interns
spending a few months on a project to expand it in one direction and
then just disappearing. They produce a lot of code quickly, but that
also means they leave a lot behind: unused definitions, inconsistent
style, and half-finished refactorings.

Since I couldn’t keep up with reviewing code at the speed these AI
assistants generate it, I ended up writing (with their help) a couple
of tools to clean things up.

• [`prune']: removes top-level definitions (values, types,
constructors, etc.) that are exposed in `.mli' files but unused
elsewhere in the codebase. It relies on `merlin occurrences' to find
unused identifiers and parses compiler warnings to clean up any
breakage (see [warning.mli] for the full list of handled cases).

• [`merlint']: runs a set of small static checks using Merlin,
`ppxlib', and some basic Dune file parsing. It looks for things like
code complexity, documentation style, test organisation, etc. This
is all very specific to my own style of writing OCaml code but can
be made configurable (a bit). See [here] for the full list of rules
(suggestions welcome to add/change some of them).

I originally wrote these to deal with AI-generated code, but they’ve
been useful on more conventional OCaml projects too, especially older
ones or ones with many contributors or the ones that I wrote a long
time ago.

Both are still evolving but they’ve made my workflow a bit smoother
already. Feedback and suggestions welcome. I'm still undecided if I
should publish those to `opam' or not.

Thomas

[`prune'] <https://github.com/samoht/prune>

[warning.mli]
<https://github.com/samoht/prune/blob/main/lib/warning.mli>

[`merlint'] <https://github.com/samoht/merlint>

[here] <https://samoht.github.io/merlint/>

First beta release for OCaml 5.4.0
══════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/first-beta-release-for-ocaml-5-4-0/17009/1>

octachron announced
───────────────────

Two months after the release of the first alpha for OCaml 5.4.0, the
release of OCaml 5.4.0 is drawing near.

The internal API of the compiler libraries has been frozen, and most
core developer tools support (or will support soon) the new version of
the compiler.

We have thus released a first beta version of OCaml 5.4.0 to help you
update your softwares and libraries ahead of the release (see below
for the installation instructions) [^1].

Compared to the first alpha release, this beta release brings two
notable changes. First, this beta partially reverts the changes of
symbol names in executable (in order to keep current version of `perf'
working with OCaml executable). Second, this beta fixes a significant
performance issue on Apple Silicon macOS.

Beyond these two changes, this first beta release contains a dozen of
small bug fixes (from the runtime to the error messages) which is
usual for the stage of the release. We are expecting the release
candidate to follow this beta release soon in the beginning of August.

The progresses on stabilising the ecosystem are tracked on the [opam
readiness for 5.4.0 meta-issue].

The full release is expected in the middle of August, see the [new
prospective calendar] for more information.

If you find any bugs, please report them on [OCaml's issue tracker].

If you are interested in full list of features and bug fixes of the
new OCaml version, the updated change log for OCaml 5.4.0 is available
[on GitHub].

Happy hacking, Florian Angeletti for the OCaml team

[opam readiness for 5.4.0 meta-issue]
<https://github.com/ocaml/opam-repository/issues/27916>

[new prospective calendar]
<https://github.com/ocaml/ocaml/blob/trunk/release-info/calendar.md>

[OCaml's issue tracker] <https://github.com/ocaml/ocaml/issues>

[on GitHub] <https://github.com/ocaml/ocaml/blob/5.4/Changes>

Installation Instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

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

┌────
│ opam update
│ opam switch create 5.4.0~beta1
└────

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

• [GitHub]
• [OCaml archives at Inria]

[GitHub] <https://github.com/ocaml/ocaml/archive/5.4.0-beta1.tar.gz>

[OCaml archives at Inria]
<https://caml.inria.fr/pub/distrib/ocaml-5.4/ocaml-5.4.0~beta1.tar.gz>

◊ Fine-Tuned Compiler Configuration

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.4.0~beta1+options <option_list>
└────

where `option_list' is a space separated list of `ocaml-option-*'
packages. For instance, for a flambda and no-flat-float-array switch:

┌────
│ opam switch create 5.4.0~beta1+flambda+nffa ocaml-variants.5.4.0~beta1+options ocaml-option-flambda ocaml-option-no-flat-float-array
└────

All available options can be listed with `opam search ocaml-option'.

Changes since the first alpha
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

◊ Code generation fixes

• (*breaking change*) [#13050], [#14104], +[#14143]: Use '$' instead
of '.' to separate module names in symbol names on macOS and Windows
(including the Cygwin backend). This changes mangling of OCaml
identifiers on those operating systems from `camlModule.name_NNN' to
`camlModule$name_NNN'. Additionally it changes the encoding of
special characters from $xx (two hex digits) to $$xx (two dollar
signs followed by two hex digits). (Tim McGilchrist, with
contributions from Xavier Leroy, reviewed by Xavier Leroy, Miod
Vallat, Gabriel Scherer, Nick Barnes and Hugo Heuzard)

• [#14088], [#14091]: fix non-deterministic code generation in
matching.ml (backport of rescript-lang/rescript[#7557]) (Christiano
Calgano, review by Gabriel Scherer and Vincent Laviron)

[#13050] <https://github.com/ocaml/ocaml/issues/13050>

[#14104] <https://github.com/ocaml/ocaml/issues/14104>

[#14143] <https://github.com/ocaml/ocaml/issues/14143>

[#14088] <https://github.com/ocaml/ocaml/issues/14088>

[#14091] <https://github.com/ocaml/ocaml/issues/14091>

[#7557] <https://github.com/ocaml/ocaml/issues/7557>

◊ Performance fix

• [#13262], [#14074]: fix performance issue on Apple Silicon macOS by
emitting `stlr' instead of `dmb ishld; str'. (KC Sivaramakrishnan,
report by François Pottier, analysis by Frédéric Bour, Xavier Leroy,
Miod Vallat, Gabriel Scherer and Stephen Dolan, review by Miod
Vallat, Vincent Laviron and Xavier Leroy)

[#13262] <https://github.com/ocaml/ocaml/issues/13262>

[#14074] <https://github.com/ocaml/ocaml/issues/14074>

◊ Standard library fix:

• (*breaking change*) [#14124]: Do not raise Invalid_argument on
negative List.{drop,take}. (Daniel Bünzli, review by Gabriel
Scherer, Nicolás Ojeda Bär)

[#14124] <https://github.com/ocaml/ocaml/issues/14124>

◊ Runtime fix

• [#14057]: Don't update memprof too early at the end of a minor GC.
(Nick Barnes, review by Damien Doligez).

• [#13586], [#14093]: Fix closing an out_channel during flush (Stephen
Dolan, report by Jan Midtgaard, investigation by Nick Roberts,
review by Antonin Décimo and Miod Vallat)

[#14057] <https://github.com/ocaml/ocaml/issues/14057>

[#13586] <https://github.com/ocaml/ocaml/issues/13586>

[#14093] <https://github.com/ocaml/ocaml/issues/14093>

◊ Error message fixes

• [#13956] Fix a regression introduced in [#13308] triggering wrong
unused warnings. (Ulysse Gérard, review by Florian Angeletti)

• [#14070]: also point to label mismatches in error messages for
labelled tuples (Florian Angeletti, review by Gabriel Scherer)

• [#14135]: Fix a rare internal typechecker error when combining
recursive modules, polymorphic fields or methods, and constrained
type parameters. (Florian Angeletti, review by Gabriel Scherer)

[#13956] <https://github.com/ocaml/ocaml/issues/13956>

[#13308] <https://github.com/ocaml/ocaml/issues/13308>

[#14070] <https://github.com/ocaml/ocaml/issues/14070>

[#14135] <https://github.com/ocaml/ocaml/issues/14135>

◊ Compilerlibs fixes

• [#14105]: Fix a loop in Pprintast that could result in a hang when
printing constructor `(::)' in isolation. (Ulysse Gérard, review by
Nicolás Ojeda Bär and Florian Angeletti)

• [#14108]: toplevel, fix a typo in directive type mismatch (Florian
Angeletti, review by Gabriel Scherer)

• [#14101], [#14139]: define atomic helper types inside `caml/misc.h'
to improve header compatibility with C++ (Florian Angeletti, report
by Kate Deplaix, review by Gabriel Scherer)

[#14105] <https://github.com/ocaml/ocaml/issues/14105>

[#14108] <https://github.com/ocaml/ocaml/issues/14108>

[#14101] <https://github.com/ocaml/ocaml/issues/14101>

[#14139] <https://github.com/ocaml/ocaml/issues/14139>

◊ OCamldoc fix

• [#13896], [#14098]: ocamldoc, do not wrap module description in a
paragraph tag inside the table of modules (Florian Angeletti, report
by John Whitington, review by Gabriel Scherer)

[^1]:More information about the whole release process is now available
in the [compiler repository]

[#13896] <https://github.com/ocaml/ocaml/issues/13896>

[#14098] <https://github.com/ocaml/ocaml/issues/14098>

[compiler repository]
<https://github.com/ocaml/ocaml/blob/trunk/release-info/introduction.md>

Encoding SAT in OCaml GADTs
═══════════════════════════

Archive:
<https://discuss.ocaml.org/t/encoding-sat-in-ocaml-gadts/17020/1>

Nathan Farlow announced
───────────────────────

I had some fun and wrote a post about a SAT -> GADT encoding. Hope you
enjoy!

<https://farlow.dev/2025/07/27/encoding-sat-in-ocaml-gadts>

Other OCaml News
════════════════

From the ocaml.org blog
───────────────────────

Here are links from many OCaml blogs aggregated at [the ocaml.org
blog].

• [Add Your Own Recipes to the OCaml Cookbook!]
• [The Saga of Multicore OCaml]
• [opam 2.4 release]

[the ocaml.org blog] <https://ocaml.org/blog/>

[Add Your Own Recipes to the OCaml Cookbook!]
<https://tarides.com/blog/2025-07-25-add-your-own-recipes-to-the-ocaml-cookbook>

[The Saga of Multicore OCaml]
<https://www.youtube.com/watch/XGGSPpk1IB0?version=3>

[opam 2.4 release]
<https://ocamlpro.com/blog/2025_07_23_opam_2_4_release>

Old CWN
═══════

If you happen to miss a CWN, you can [send me a message] and I'll mail
it to you, or go take a look at [the archive] or the [RSS feed of the
archives].

If you also wish to receive it every week by mail, you may subscribe
to the [caml-list].

[Alan Schmitt]

[send me a message] <mailto:alan.schmitt@polytechnique.org>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[caml-list] <https://sympa.inria.fr/sympa/info/caml-list>

[Alan Schmitt] <https://alan.petitepomme.net/>

[-- Attachment #2: Type: text/html, Size: 25237 bytes --]