Platform Newsletter: September 2024 - January 2025

Welcome to the thirteenth edition of the OCaml Platform newsletter!

In this September 2024 - January 2025 edition, we are excited to bring you the latest on the OCaml Platform, continuing our tradition of highlighting recent developments as seen in previous editions. To understand the direction we're headed, especially regarding development workflows and user experience improvements, check out our roadmap.

Highlights:

  • Dune Enables Cache By Default, Adds WebAssembly Support The latest Dune releases mark significant progress in build performance and language support. Version 3.17.0 enables the Dune cache by default for known-safe operations, improving build times for common tasks. The addition of Wasm_of_ocaml support opens new possibilities for OCaml projects targeting the web or other WebAssembly runtimes. In addition, Dune now supports adding Codeberg and GitLab repositories via the (source) stanza.
  • opam 2.3.0 As announced with opam 2.2, opam releases are now time-based with a cadence of 6 months. Opam 2.3 has been released last November. It contains a major breaking change regarding extra-files handling: extra-files are now ignored when they are not present in the opam file. Previously they were silently added. This release adds also some new commands like opam list --latest-only or opam install foo --verbose-on bar, among other fixes and enhancements.
  • Improved Editor Workflows with OCaml-LSP and Merlin A major milestone for project-wide features has been reached with the release of OCaml 5.3: LSP's renaming feature now renames symbols in the entire project if the index is built. Additionally,all of the classic merlin-server commands are now available as LSP custom requests: this enabled the addition of many new features to the Visual Studio Code plugin. Finally a brand new Emacs mode, based on LSP and the new custom queries is now available on Melpa.
  • Performance and Security Enhancements Recent updates across the platform focus on performance and reliability. Dune optimized its handling of .cmxs files, while opam implemented stricter git submodule error checking. OCaml-LSP resolved file descriptor leaks, contributing to a more stable development environment.

Feature Guides & Announcements:

Releases:

Dune

Roadmap: Develop / (W4) Build a Project

Dune 3.17 was released with significant improvements to package management. Key features include binary distribution support, better error messages for missing packages, and Windows support without requiring OPAM.

The Dune Developer Preview website now provides editor setup instructions and package management tutorials.

Dune's package management features were tested across hundreds of packages in the opam repository, and a coverage tool was developed to track build success rates. For local development, Dune added support for building dependencies via @pkg-install, caching for package builds, and automated binary builds of development tools. The system supports both monorepo and polyrepo workflows, with options for installing individual dependencies or complete development environments.

The addition of Wasm_of_ocaml support in Dune opens new possibilities for OCaml projects targeting the web or other WebAssembly runtimes.

Activities:

Maintained by: Rudi Grinberg (@rgrinberg, Jane Street), Nicolás Ojeda Bär (@nojb, LexiFi), Marek Kubica (@Leonidas-from-XIV, Tarides), Etienne Millon (@emillon, Tarides), Stephen Sherratt (@gridbugs, Tarides), Antonio Nuno Monteiro (@anmonteiro), Étienne Marais (@maiste, Tarides)

Editor Tools

Roadmap: Edit / (W19) Navigate Code, Edit / (W20) Refactor Code

Developer tooling received substantial upgrades during the end of last year and the beginning 2025. A major milestone for project-wide features has been reached with the release of OCaml 5.3: LSP's renaming feature now renames symbols in the entire project if the index is built. Additionally, all of the classic merlin-server commands are now available as LSP custom requests: this enabled the addition of many new features to the Visual Studio Code plugin and the creation of a brand new Emacs mode, based on LSP, now available on Melpa.

These features bring OCaml editor support closer to modern IDE capabilities, with implementations available across multiple editors.

Merlin and OCaml LSP Server

Support for project wide renaming, search-by-type, and ocaml-lsp-server now exposes all Merlin features via LSP custom queries.

Notable Activity

Bug Fixes

  • Fixed completion range issues with polymorphic variants (ocaml-lsp#1427)
  • Fixed various issues with jump code actions and added customization options (ocaml-lsp#1376)
  • Various fixes and improvements have been made to signature help and inlay hints

Visual Studio Code plugin

Added support for most of the Merlin features historically availbale to Emacs and Vim users, via the new LSP custom requests.

Notable Activity

  • Improved typed-of-selection feature, with ability to grow or shrink the selection and increase verbosity (#1675).
  • Improved jump navigation (#1654), search-by-type (#1626)
  • Improved typed holes navigation (#1666).
  • New search-by-type command (#1626).

OCaml LSP Server maintained by: Ulysse Gérard (@voodoos, Tarides), Xavier Van de Woestyne (@xvw, Tarides), Rudi Grinberg (@rgrinberg, Jane Street)

Merlin maintained by: Ulysse Gérard (@voodoos, Tarides), Xavier Van de Woestyne (@xvw, Tarides)

Emacs support

A brand new Emacs plugin based on the Eglot LSP client is now ready for daily usage: https://github.com/tarides/ocaml-eglot.

Documentation Tools

Roadmap: Share / (W25) Generate Documentation

Odoc

Maintained by: Jon Ludlam (@jonludlam, Tarides), Daniel Bünzli (@dbuenzli), Jules Aguillon (@julow, Tarides), Paul-Elliot Anglès d'Auriac (@panglesd, Tarides), Emile Trotignon (@EmileTrotignon, Tarides, then Ahrefs)

There is now a beta release for odoc 3 that you can try out and give feedback on!

During the quarter, odoc has been making steady progress toward its 3.0 release with several notable improvements:

  • Enhanced Navigation: The sidebar and breadcrumbs navigation has been unified and improved (#1251), making the documentation hierarchy more consistent and flexible. This allows better organization of modules, pages, and source files in the documentation.
  • Documentation Features: New features have been added to Odoc 3 (#1264), including:
    • Support for images with embedded assets
    • Cross-package linking (linking to modules from external libraries)
  • Search Integration: Sherlodoc, the search functionality, has been merged into the main odoc codebase (#1263), ensuring better maintenance and synchronized releases.

Notable Activity

Mdx upgraded to OCaml 5.3

Maintained by: Marek Kubica (@Leonidas-from-XIV, Tarides), Thomas Gazagnaire (@samoht, Tarides)

With OCaml 5.3, some compiler error messages changed, so MDX was updated to use a more expressive tag system to choose which version of the compiler can run which code block. This effort uncovered a bug in the current handling of skipped blocks for mli files, which was fixed.

Notable Activity

  • OCaml 5.3 support (#457), ensuring the tool remains compatible with the latest OCaml releases.
  • Fixed error handling for skipped blocks in mli files (#462)
  • Improved syntax highlighting (#461)
  • Added support for multiple version labels (#458), improving the ability to test code across different OCaml versions.

Package Management

Opam

Opam 2.3.0 was released in November. We are now working towards the 2.4 release, with some new sub commands (admin, source, switch, etc.), fixes (pinning, switch, software heritage fallback, UI) and enhancements.

Notable Activity

  • Add several checksum, extra-files and extra-source lints - #5561
  • Add options opam source --require-checksums and --no-checksums to harmonise with opam install - #5563
  • Add the current VCS revision information to opam pin list - #6274 - fix #5533
  • Make opamfile parsing more robust for future changes - #6199 - fix #6188
  • Fix opam switch remove <dir> failure when it is a linked switch - #6276 - fix #6275
  • Fix opam switch list-available when given several arguments - #6318
  • Correctly handle pkg.version pattern in opam switch list-available - #6186 - fix #6152
  • Fix sandbox for NixOS #6333, and DUNE_CACHE_ROOT environment variabale usage - #6326
  • Add opam admin compare-versions to ease version comparison for sanity checks #6197 and fix opam admin check in the presence of some undefined variables - #6331 - fix #6329
  • When loading a repository, don’t automatically populate extra-files: field with found files in files/ - #5564
  • Update and fix Software Heritage fallback - #6036 - fix #5721
  • Warn if a repository to remove doesn’t exist - #5014 - fix #5012
  • Silently mark packages requiring an unsupported version of opam as unavailable - #5665 - fix #5631
  • Display switch invariant with the same syntax that it is written in file (no pretty printing) - #5619 - fix #5491
  • Fix output display regarding terminal size #6244 - fix #6243
  • Change default answer display - #6289 - fix #6288
  • Add a warning when setting a variable with opam var if an option is shadowed - #4904 - fix #4730
  • Improve the error message when a directory is not available while fetching using rsync - #6027
  • Fix install.exe search path on Windows - #6190
  • Add ALTLinux support for external dependencies - #6207
  • Make uname information more robust accros ditributions - #6127

Maintained by: Raja Boujbel (@rjbou - OCamlPro), Kate Deplaix (@kit-ty-kate, Ahrefs), David Allsopp (@dra27, Tarides)

Dune-release

Roadmap: Share / (W26) Package Publication

Dune-release has been improved to better handle publishing packages from custom repositories and private Git repositories.

Notable Activity

  • Support for overwriting the dev-repo field when creating GitHub tags/releases (#494), which a useful for private projects

Maintained by: Thomas Gazagnaire (@samoht, Tarides), Etienne Millon (@emillon, Tarides), Marek Kubica (@Leonidas-from-XIV, Tarides)

Opam-publish

Notable Activity

  • Integration of Opam CI Lint functionality into opam-publish (#166, #165) to validate packages before submission
  • A new --pre-release argument added to handle pre-release packages correctly (#164)

Maintained by: Raja Boujbel (@rjbou - OCamlPro), Kate Deplaix (@kit-ty-kate, Ahrefs)