OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of March 12 to 19, 2024.

Table of Contents

dune 3.14

Marek Kubica announced

We're happy to announce that Dune 3.14.2 is now available.

Note that due to a regression that was detected before publishing to opam version 3.14.1 should not be used. The fix for the regression is part of this release.

This feature brings some small bugfixes around the handling of Coq as well as solves an issue where Dune is running on Windows in a path that contains Unicode characters. This affected e.g. users with diacritics or non-latin script in their name when running Dune within their home directory.

  • When a directory is changed to a file, correctly remove it in subsequent dune build runs. (#9327, fix #6575, @emillon)
  • Fix a problem with the doc-new target where transitive dependencies were missed during compile. This leads to missing expansions in the output docs. (#9955, @jonludlam)
  • coq: fix performance regression in coqdep unescaping (#10115, fixes #10088, @ejgallego, thanks to Dan Christensen for the report)
  • coq: memoize coqdep parsing, this will reduce build times for Coq users, in particular for those with many .v files (#10116, @ejgallego, see also #10088)
  • on Windows, use an unicode-aware version of CreateProcess to avoid crashes when paths contains non-ascii characters. (#10212, fixes #10180, @emillon)
  • fix compilation on non-glibc systems due to signal.h not being pulled in spawn stubs. (#10256, @emillon)

Announcing OCaml Manila Meetups

Thibaut Mattio announced

I'm thrilled to announce the OCaml Manila Meetup!

Seeing that OCaml doesn't seem to have reached the Philippines just yet (I wasn't able to find existing OCaml or FP communities), the goal is to build one, starting small, with a few people meeting every month in a coffee to hack on fun projects, and letting it grow organically.

The inaugural event is scheduled for the 4th of April: https://www.meetup.com/ocaml-manila/events/299786391/

If you're living in Manila, or if you know anyone who would be interested in joining, please don't hesitate to reach out!

I would also greatly appreciate retweets if you happen to be on Twitter: https://twitter.com/tmattio_/status/1768169167004577997

Happy hacking!

Outreachy internship demo session

Continuing this thread, Patrick Ferris announced

The recording from the demo session is now live on watch.ocaml.org :camel:

https://watch.ocaml.org/w/b7sv1LQSVZQH6trf4xpwFX

OCaml 4.14.2 released

octachron announced

We have the pleasure of celebrating the birthday of Grace Chisholm Young by announcing the release of OCaml version 4.14.2.

This release is a collection of safe bug fixes, cherry-picked from the OCaml 5 branch. If you are still using OCaml 4.14 and cannot yet upgrade to OCaml 5, this release is for you.

The 4.14 branch is expected to receive updates for at least one year, while the OCaml 5 branch is stabilising.

Thus don't hesitate to report any bugs on the OCaml issue tracker (at https://github.com/ocaml/ocaml/issues).

See the list of changes below for more details.

Installation Instructions

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

opam update
opam switch create 4.14.2

The source code for the release candidate is also directly available on:

Changes since OCaml 4.14.1

  • Runtime system:
    • #11764, #12577: Add prototypes to old-style C function definitions and declarations. (Antonin Décimo, review by Xavier Leroy and Nick Barnes)
    • #11763, #11759, #11861, #12509, #12577: Use strict prototypes on primitives. (Antonin Décimo, review by Xavier Leroy, David Allsopp, Sébastien Hinderer and Nick Barnes)
    • (breaking change) #10723: do not use -flat-namespace linking for macOS. (Carlo Cabrera, review by Damien Doligez)
    • #11332, #12702: make sure Bool_val(v) has type bool in C++ (Xavier Leroy, report by ygrek, review by Gabriel Scherer)

Build system:

  • #11590: Allow installing to a destination path containing spaces. (Élie Brami, review by Sébastien Hinderer and David Allsopp)
  • #12372: Pass option -no-execute-only to the linker for OpenBSD >= 7.3 so that code sections remain readable, as needed for closure marshaling. (Xavier Leroy and Anil Madhavapeddy, review by Anil Madhavapeddy and Sébastien Hinderer)
  • #12903: Disable control flow integrity on OpenBSD >= 7.4 to avoid illegal instruction errors on certain CPUs. (Michael Hendricks, review by Miod Vallat)

Bug fixes:

  • #12061, #12063: don't add inconsistent equalities when computing high-level error messages for functor applications and inclusions. (Florian Angeletti, review by Gabriel Scherer)
  • #12878: fix incorrect treatment of injectivity for private recursive types. (Jeremy Yallop, review by Gabriel Scherer and Jacques Garrigue)
  • #12971, #12974: fix an uncaught Ctype.Escape exception on some invalid programs forming recursive types. (Gabriel Scherer, review by Florian Angeletti, report by Neven Villani)
  • #12264, #12289: Fix compact_allocate to avoid a pathological case that causes very slow compaction. (Damien Doligez, report by Arseniy Alekseyev, review by Sadiq Jaffer)
  • #12513, #12518: Automatically enable emulated fma for Visual Studio 2019+ to allow configuration with either pre-Haswell/pre-Piledriver CPUs or running in VirtualBox. Restores parity with the other Windows ports, which don't require explicit --enable-imprecise-c99-float-ops. (David Allsopp, report by Jonah Beckford and Kate Deplaix, review by Sébastien Hinderer)
  • #11633, #11636: bugfix in caml_unregister_frametable (Frédéric Recoules, review by Gabriel Scherer)
  • #12636, #12646: More prudent reinitialization of I/O mutexes after a fork() (Xavier Leroy, report by Zach Baylin, review by Enguerrand Decorne)
  • (breaking change) #10845 Emit frametable size on amd64 BSD (OpenBSD, FreeBSD, NetBSD) systems (emitted for Linux in #8805) (Hannes Mehnert, review by Nicolás Ojeda Bär)
  • #12958: Fix tail-modulo-cons compilation of try-with, && and || expressions. (Gabriel Scherer and Nicolás Ojeda Bär, report by Sylvain Boilard, review by Gabriel Scherer)
  • #12116, #12993: explicitly build non PIE executables on x86 32bits architectures (Florian Angeletti, review by David Allsopp)
  • #13018: Don't pass duplicate libraries to the linker when compiling ocamlc.opt and when using systhreads (new versions of lld emit a warning). (David Allsopp, review by Nicolás Ojeda Bär)

Docfd 3.0.0: TUI multiline fuzzy document finder

Darren announced

Hi all, I am happy to announce Docfd 3.0.0, which adds a non-interactive search mode and support of DOCXs and other file formats via pandoc, as well as many polishes.

Repo

Think interactive grep for text files, PDFs, DOCXs, etc, but word/token based instead of regex and line based, so you can search across lines easily.

Docfd aims to provide good UX via integration with common text editors and PDF viewers, so you can jump directly to a search result with a single key press.

Demos

Navigating repo:

repo.gif

Quick search with non-interactive mode:

repo-non-interactive.gif

PDF navigation:

pdf-viewer-integration.jpg

Shape with us the New OCaml.org Community Area!

Claire Vandenberghe announced

I’m reaching out to request a few minutes of your time to review the wireframe for the OCaml community area. Following user interviews with those unfamiliar with OCaml, we gathered insights on what would be helpful for you landing on the community page.

As a result, we’re restructuring aspects of the pages and content on the landing page. This is a wireframe, so the focus is on checking the navigation, layout, and content, not the User Interface (UI).

Your feedback are needed at this stage, and please feel free to leave comments directly on Figma, via email, or let’s schedule a quick call. Thank you for participating in this review. Have a great day and week ahead.

Link: https://www.figma.com/file/7hmoWkQP9PgLTfZCqiZMWa/OCaml-Community-Pages?type=design&node-id=152%3A386&mode=design&t=jzXnvmUyoQth2558-1

Page: “Wireframe”

Opam-repository: Updated documentation, retirement and call for maintainers

Kate announced

After having been maintainer of opam-repository for the past 6 and half years, I'm publicly announcing my retirement from it, to focus on opam itself. This change has been more or less already in effect since September last year (following a burnout) and I have since been working on writing enough documentation so that my move away from opam-repository can be as smooth as possible.

This documentation is now live in:

  • CONTRIBUTING.md: documentation at destination of package maintainers. This document has been rewritten in hopes of being more helpful for beginner and well as experimented publishers.
  • the opam-repository wiki, which now also includes:
    • a FAQ
    • informations about the infrastructure
    • a governance / points of contacts document
    • a helper on How To deal with CI
    • a list of all the current policies i could think of, as well as their reasoning and exceptions. These policies were previously mostly passed down orally, most of them have been in place since the very beginning
    • several documents at destination of current opam-repository maintainers and opam-repository maintainers in training, all freely accessible for the curious eyes (although rereading them now, i will admit those documents are not my finest work, as they were the first ones i wrote in the past 6 months 🙈)

Any improvements to these documents are also welcome. To contribute simply open a PR on opam-repository, or a ticket on the opam-repository bugtracker to contribute to the wiki.

Hopefully, all these documents are a solid enough base so that they get updated as time goes on, by current and future opam-repository maintainers.

I'm also writing this post to call for said future opam-repository maintainers: if you want to become a maintainer, feel free to contact @mseri and @raphael-proust. I do recommend the experience of working with them on opam-repository 😊

DkCoder 0.1.0

jbeckford announced

I wrote an article DkCoder: Intro to Scripting that describes a very early cut of OCaml-ified scripting:

Hello Builder! Scripting is a small, free and important piece of DkSDK. Walk with me as we use the DkSDK tool "DkCoder" to write little scripts that become full-fledged programs. My hope is that within minutes you feel like your dev experience is as productive as in Python, but enhanced so you:

  1. have nothing to install except Git and optionally Visual Studio Code
  2. have safe and understandable code ("static typing")

DkCoder is a transparently installed OCaml 4.14 environment with one API: run a script. It shouldn't be confused with conventional OCaml distributions, although underneath DkCoder has the conventional bytecode binaries¹, and dune and ocamllsp.

No C compiler, Cygwin/MSYS2, Homebrew or MacPorts are needed. Please skim the article for the exact Windows/macOS/Linux requirements.

It grew out of two things:

  1. My frustrations sharing scripts with others. It was easy for inter-dependencies between scripts to break POSIX shell scripts (the basis of the DkML installer) and CMake scripts (most of my tools).
  2. My need to have a good delivery vehicle for my own software.

Please don't do anything major with DkCoder yet. In fact, if you think you'll be using DkCoder for your own scripts or your own software, please send me a message so I can prioritize/deprioritize.

I'd like to thank @octachron for the codept analyzer. It is lightly used now but as hinted in the Security section of the article it will become much more important. And also thanks to the projects that have fixed their newly discovered bytecode-only bugs over the past two months.

¹: Actually, I bundle a new binary called ocamlrunx which is a DT_NEEDED/LC_LOAD_DYLIB re-linking of ocamlrun against all the C libraries (ffi, SDL2* and their deps today) to get macOS and Linux bytecode working.

A Versatile OCaml Library for Git Interaction - Seeking Community Feedback

Continuing this thread, Mathieu Barbin announced

I've recently pushed updates to the vcs public repo with most of the contents of my early draft. For those interested in early experimentation, I've created a release on my custom opam-repository.

The interface is still very a work in progress, but you can already see how the pieces fit together. In particular, the provider component, which is crucial for the dynamic dispatch implementation of vcs, is now available on opam. The vcs project serves as a good real-world example of the capabilities this provides.

Please feel free to open issues on GitHub with general feedback, requests, or to start a discussion.

@kopecs, I don't have a precise timeline for an initial publication on opam yet. I've created this milestone if you'd like to follow the progress or leave a comment. Thank you for your interest!

@paurkedal: Your setup has been a great source of inspiration for me, and I've found it incredibly helpful. Thank you so much!

@samoht: I chose the approach that felt most comfortable for this particular project, but I greatly appreciate your input. I'll definitely keep your suggestions in mind for future projects. Thanks!

Other OCaml News

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.