OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of February 25 to March 04, 2025.

Table of Contents

Bytecode debugging in OCaml 5.3

Continuing this thread, Henry Till said

Chet Murthy also said

For those who (like me) have always been perplexed when they try to use ocamldebug, b/c it just doesn't seem to work like gdb or perl's debugger, or any other debugger I've tried, this video was immensely helpful.

https://www.youtube.com/watch?v=DGvJk14sfi8&t=724s

Specifically, I learned that at the beginning of the program, to set a breakpoint in the main program file, I need to do something like (for a file "extract_environments.ml", and line 79):

break @extract_environments 79

That was blocking me FOREVER, b/c holy cow there's a ton of initialization, and I just didn't know how to run thru all that and get to the first meaningful line of my main program.

Now I do. I can move forward from here with ocamldebug. Finally!

Zanuda – OCaml linter experiment

Kakadu announced

I'm using this linter for teaching for two years, and I'm very happy that I implemented it. Student's code is much less annoying to read :slight_smile:

Release 1.1.0

  • #22: Add 'reviewer' tool to report lint's a Github review.
  • #13: Discourage matching a tuple using 'match' expression with single branch

    match x with (a,b) -> ...
    
  • #18: Warn about unneeded mutually recursive types
  • #23: Implement a trial version of the Fix module for auto-correction of lints. It produces a diff that could be applied later. Dune support is lacking
  • Add command line switch '-skip-level-allow <bool>' to enable/disable lints with level=Allow. False has higher priority than per-lint command line switch (for example, -no-string_concat)
  • #28: Warn about too many nested if expressions.
  • #32: Warn about constructor names that hide default constructor names
  • #35: Detect manual implementations of List.map/fold functions
  • #50: Propose eta reduction when available
  • #51: Warn about pattern matching on boolean values
  • #53: Warn about "%s" in formatted strings
  • #54: Detection of unused public declarations in .mli file.
  • #56: Simplify lint about missing license. We look for required doc-comments anywhere in the file, not only in the beginning.
  • #60: Skip some checks for some source files (configured via '.zanuda' config file).
  • #15: Split 'string_concat' lint to check separately patterns 'a^b^c' (level=Allow) and 'List.fold_left (^)' (level=Warn).

QCheck 0.24

Jan Midtgaard announced

I'm happy to announce the 0.24 release of qcheck, qcheck-core, qcheck-alcotest, and qcheck-ounit, along with a 0.6 release of ppx_deriving_qcheck :tada:

QCheck is a library for randomized property-based testing, inspired by Haskell's seminal QuickCheck library. The 0.24 release contains a range of improvements to the integrated shrinking of QCheck2, initially introduced in the 0.18 release. As a consequence, its shrinking algorithms should act more predictably, reduce faster, and report smaller counterexamples. In essence, the 0.24 release is what we hoped 0.18 would be. The release also adds missing result, int32, and int64 combinators, as well as more documentation.

If you've previously given QCheck2's integrated shrinking a spin, I encourage you to try it again with the patched 0.24 release. For new users, the 0.24 release is also a good candidate to check out! :smiley: Please share any problems you encounter on the qcheck repo: https://github.com/c-cube/qcheck

Full change log:

  • [qcheck-alcotest] Add an optional speed_level parameter to to_alcotest
  • Adjust the QCheck2.Gen.list shrinker to produce minimal counterexamples at size 3 too
  • Replace the QCheck2 OCaml 4 Random.State.split hack with a faster one
  • Improve the QCheck2.Gen.list shrinker heuristic and utilize the improved shrinker in other QCheck2 {list,array,bytes,string,function}* shrinkers
  • Use split and copy in Random.State underlying QCheck2 to avoid non-deterministic shrinking behaviour
  • Add missing documentation strings for QCheck.{Print,Iter,Shrink,Gen} and QCheck2.Gen.
  • Add result combinators to QCheck, QCheck.{Gen,Print,Shrink,Observable}, and QCheck2.{Gen,Print,Observable}.
  • Add missing combinators QCheck{,2}.Print.int{32,64}, QCheck.Gen.int{32,64}, QCheck{,2}.Observable.int{32,64}, and deprecate QCheck.Gen.{ui32,ui64}
  • Document dune usage in README

Happy testing! :smiley: :keyboard:

Bogue, the OCaml GUI

sanette announced

Dear all,

I’m happy to announce a new version of Bogue, version 20250224, now availble on opam.

The main novelty is a brand new File dialog. It will open a new window (or popup) which will let the user navigate the file system and select one or more files or directories.

This corresponds to the new File module.

You might also be interested in the Monitor submodule, which implements a file monitoring API based on fswatch (if available) or Unix.stat.

If you are curious, here is a graphical summary of the current functionalities of Bogue's file dialog (I hope that more will be added soon; I'm open to suggestions)

b6efbe5eb40237db0fc4b5f036b1637a79de7875.png

PS: @Sachindra_Ragul, yes we did it finally ;) better late than never

Opam repository archival - next phase

Hannes Mehnert announced

Dear everyone,

sorry for the silence – the phase 3 of the opam repository archival (taking the x-maintenance-intent into account) has to be delayed by (tentatively) one month. The reason is that our tooling is not ready - the task, given an opam repository and maintenance-intent on packages, which can be safely archived, is harder than it seems:

  • we've to take compiler versions into account
  • there may be a package X in version 1 and 2, both supporting OCaml 4.08, but depend on package Y (where X.1 depends on Y >= 1, and X.2 depends on Y >= 2) – now Y.1 could support OCaml 4.08, and Y.2 only OCaml 4.12 – so it is not safe to archive X.1 (since on OCaml 4.08 there won't be any X installable). And this may be deeply nested in the dependency chain

It is useful if you mark your packages with x-maintenance-intent (as mentioned in https://discuss.ocaml.org/t/opam-repository-archive-clarification-of-the-opam-fields).

We'll let you know once we have tooling in place to cope with the task described above (development is happening here: https://github.com/hannesm/maintenance-intent-filter).

Upcoming Cmdliner 2.0 changes that need your attention

Daniel Bünzli announced

If you are a user of cmdliner note that cmdliner 2.0 – in exchange for auto-completion support – will remove the ability to specify command and options names by unambiguous prefixes according to this plan of action.

If you are horrified by it please chime in on the issue.

OCaml Editors Plugins Survey

PizieDust announced

Hello, we are conducting a short survey to better understand how you use the different editor plugins available for OCaml. Please take a few minutes (ideally 5) to fill out the form.

https://docs.google.com/forms/d/e/1FAIpQLSfGGFZBiw4PF7L0yt2DBX8443G5_7aFL5v6wvo6p5MwL-DW8Q/viewform?usp=pp_url&entry.454013858=Discuss

Thank you :) :camel:

Dune dev meeting

Etienne Marais announced

Hi everyone :camel:

The next Dune Dev Meeting will be on Wednesday, March, 5th at 9:00 CET. This is going to be a one-hour-long meeting.

Whether you are a maintainer, a regular contributor, a new joiner or just curious, you are welcome to join: these discussions are opened! The goal of these meetings is to provide a place to discuss the ongoing work together and synchronize with the Dune developers :smile:

The agenda is available on the meeting dedicated page. Feel free to add more items in it.

Platform Newsletter: September - December 2024

Sabine Schmaltz announced

Welcome to the thirteenth edition of the OCaml Platform newsletter!

In this September-December 2024 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)

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).git push –set-upstream origin publish_platform_newsletter_q4_24
    • 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

  • 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)

Other OCaml News

From the ocaml.org blog

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

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.