OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of September 19 to 26, 2023.

Table of Contents

maintenance release mirage-crypto

Hannes Mehnert announced

it is my pleasure to announce the just released mirage-crypto 0.11.2 library. This includes a workaround for miscompilation that happens on macOS/arm64 with clang 14.0.3 (which lead to various issues (https://github.com/ulrikstrid/ocaml-jose/issues/63, https://github.com/mirleft/ocaml-tls/issues/478) – initially reported and bisected by @samoht. The fix is to not run the LLVM instcombine pass (–instcombine-max-iterations=0) - or have apple fix their software chain eventually (e.g. clang 14.0.4 contains a fix) – but it looks like it is a long path how they push updates to customers.

So, if you end up on a macOS system where the elliptic curve test cases fail, please upgrade to this release.

There are other minor bugfixes, support for the newly released eio in version 0.12 (now using partially variants and less objects), support for DragonFlyBSD and GNU/Hurd.

Thanks to all old and especially the new contributors (take a look at https://github.com/mirage/mirage-crypto/releases/tag/v0.11.2 if interested, there is as well the full list of changes), and those of you who won’t observe any changes please excuse me for wasting your CPU cycles to recompile mirage-crypto itself and its reverse dependencies.

End-of-Internship Demo Session

Aryan Godara announced

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

It’s my pleasure to inform everyone that the demo session is now up on the above link! So in case you missed the live demo, please go and watch it here, and leave a like :D

Ppxlib dev meetings

Sonja Heinze announced

Here’re today’s meeting notes: https://github.com/ocaml-ppx/ppxlib/wiki/Dev-meeting-19-09-2023. It has been @panglesd , @ceastlund, @Burnley and me in the meeting.

Also, as a side-note: If anyone thinks that two posts about the Ppxlib meetings per month -one with the agenda and the meeting link and one with the link to the notes- is too much spamming, do let me know.

OCaml Platform Newsletter: August 2023

Thibaut Mattio announced

Welcome to the fifth edition of the OCaml Platform newsletter!

Dive into the latest updates from August and discover how the OCaml Platform is evolving. Just like our previous newsletters, we’ll spotlight the recent developments and enhancements to the OCaml development workflows.

In August, we unveiled the initial draft of the OCaml Platform roadmap, following the recently adopted Guiding Principles and User Personas. The thread has seen a lot of activity, and we’re thrilled to see so much engagement to discuss the direction of OCaml developer tooling. A warm thank you for actively joining the conversation and sharing your feedback! This has prompted numerous discussions with the Platform maintainers, and we’re considering all your feedback as we’re working on revisions to the roadmap.

Another headline from August was initiating the integration of wasm_of_ocaml into Dune in order to compile OCaml programs to WebAssembly (Wasm). This follows the recent announcement of the ocaml-wasm organisation. This is an exciting time! Compiling OCaml programs to WebAssembly is becoming a reality!

But more on that below. Let’s delve into all the progress that happened last month.

  • Building Packages
    • [Dune] Exploring Package Management in Dune
    • [opam] Native Support for Windows in opam 2.2
    • [Dune] Compile to WebAssembly with wasm_of_ocaml
    • [Dune] dune monitor: Connect to a Running Dune build
    • [Dune] Dune Terminal User Interface
  • Generating Documentation
    • [odoc] Add Search Capabilities to odoc
    • [odoc] Syntax for Images and Assets in odoc
  • Editing and Refactoring Code
    • [Merlin] Support for Project-Wide References in Merlin

Releases

Here are all the new versions of Platform tools that were released this month:

For detailed release notes and announcements, explore the OCaml Changelog.

Building Packages

  • [Dune] Exploring Package Management in Dune

    Contributors: @rgrinberg (Tarides), @Leonidas-from-XIV (Tarides), @gridbugs (Tarides), @kit-ty-kate (Tarides), @Alizter

    This month saw good progress on supporting lock directory generation for more opam packages by adding support for various opam features. Notably, the team implemented a new when action to support opam’s conditional build steps and the accompanying PR to convert opam filters to when actions.

    Work also started on initialising Dune’s context from the lock file. This is the last missing piece that ties all the implemented features together (source fetching, opam-repository management, lock directory generation, etc.). This makes it possible to run dune build to build a project that has opam dependencies.

    The work on the above – extending coverage of opam packages when generating the lock directory and initialisation of Dune’s context from the lock directory – should continue next month. The team also started tracking missing features in Dune’s backlog more thoroughly. You can have a look at the list of issues on GitHub.

    Activities:

  • [opam] Native Support for Windows in opam 2.2

    Contributors: @rjbou (OCamlPro), @kit-ty-kate (Tarides), @dra27 (Tarides), @AltGr (OCamlPro)

    Following the release of the second alpha of opam 2.2 last month, the opam team started working on the third alpha and merged numerous bug fixes and improvements.

    They also started working on generating static binaries for Windows.

    The next step, in anticipation to the first beta release of opam 2.2, is to make the opam-repository compatible with Windows by upstreaming patches from ocaml-opam/opam-repository-mingw and dra27/opam-repository.

    The work on this will continue next month, but in the meantime, don’t hesitate to install opam 2.2~alpha2 and report any issue you have!

  • [Dune] Compile to WebAssembly with wasm_of_ocaml

    Contributors: @vouillon (Tarides), @hhugo

    Following the recent announcement of the ocaml-wasm organisation, the wasm_of_ocaml team landed a PR on Dune that brings support for compiling OCaml programs to WebAssembly (Wasm)!

    The target user experience will be similar to the JavaScript compilation on Dune; that is, you’ll be able to add wasm as a mode to Dune executables:

    (executable (name foo) (modes wasm))
    

    And running dune build will produce a Wasm binary.

    The PR is in the early stage and is in active review, but given the impressive progress of the wasm_of_ocaml team on the runtime implementation, do stay tuned for more updates on this in the coming weeks and months.

    Activities:

  • [Dune] dune monitor: Connect to a Running Dune build

    Contributors: @Alizter

    In July, @Alizter started work on a new dune monitor command to connect to a running Dune build.

    This work continued this month, and as part it, lots of improvements were made to Dune RPC, including reports of failed jobs and better error messages.

    The PR has been merged and the new command will be available in the upcoming Dune 3.11, scheduled for September.

    Activities:

  • [Dune] Dune Terminal User Interface

    Contributors: @Alizter, @rgrinberg (Tarides)

    Back in April, Dune introduced a new tui display mode, contributed by @Alizter, which was a meant as a foundation to bring a GUI-like experience to Dune.

    The saga continued in August, and @Alizter ported the TUI to Nottui, a terminal-based user interface library, to add more interactivity to the tui mode. In particular, the error messages are now scrollable, and they can be expanded/minimised.

    https://user-images.githubusercontent.com/8614547/262112028-a367f7ca-023f-4470-a02a-a19617aa35f6.webm

    These features will be available in the upcoming Dune 3.11. Do try the new TUI and let the Dune team know if you have any feedback!

    Activities:

Generating Documentation

  • [odoc] Add Search Capabilities to odoc

    Contributors: @panglesd (Tarides), @EmileTrotignon (Tarides), @julow (Tarides), @jonludlam (Tarides)

    After fixing some of the issues identified last month, the odoc team started actively reviewing the Pull Request to add a search bar to odoc’s HTML output.

    As a result of the reviews, a few related issues were identified and have been addressed as a prerequisite to move forward on the search feature. Notably, improvements were needed on the stability of link to source code by implementing semantic anchors.

    Next month, the odoc team plans to continue reviewing the different Pull Requests, with the aim to cut a major release of odoc with support for search the following weeks.

    Activities:

  • [~odoc~] Syntax for Images and Assets in odoc

    Contributors: @panglesd (Tarides)

    Following the discussion started in July, the odoc team started the implementation work to add support for images and assets in odoc.

    Work is ongoing to implement a syntax to reference arbitrary assets, as a requirement to both the search feature and the support for images.

    We’re getting closer and closer to having images on OCaml.org’s centralised package documentation!

Editing and Refactoring Code

  • [Merlin] Support for Project-Wide References in Merlin

    Contributors: @voodoos (Tarides), @trefis (Tarides), @Ekdohibs (OcamlPro)

    As announced last month, the focus in August was on upstreaming the necessary changes to the compiler. A PR on the compiler was opened and is currently under active review. The Merlin team is hopeful that it will be merged in time for the next release of OCaml 5.2.

    The team is also considering backporting the patches on previous versions of the compiler and making them available on opam. This would allow people to start testing the feature early, without having to wait for the release of OCaml 5.2.

    Activities:

Melange 2.0

Antonio Nuno Monteiro announced

the Melange team is proud to announce the release of Melange 2.0.

Melange is a backend for the OCaml compiler that emits JavaScript. It strives to provide the best integration with both the OCaml and JavaScript ecosystems, enabling modern JS workflows and compiling OCaml / Reason to performant, readable JavaScript.

Lots of work went into this release. One of the highlights is its compatibility with OCaml 5.1, released just last week.

I wrote a more comprehensive release announcement in the following post. As always, feedback is very much appreciated.

https://anmonteiro.substack.com/p/introducing-melange-20

This release of Melange is sponsored by [Ahrefs](ahrefs.com) and the OCaml Software Foundation.

Clickable plot example using Js_of_ocaml, Brr, and Vg

Ryan Moore announced

I made a small, clickable canvas chart example for the browser using Js_of_ocaml, Brr, and Vg. The code is on GitHub, and you can check out a live demo as well. Perhaps the code may prove useful as another example for anyone wanting to try out the Brr or Vg packages.

It was actually fairly quick to make as Vg provides some pretty powerful drawing primitives, and Brr really simplifies interacting with the DOM and JavaScript values.

Here a screenshot of the demo:

bd80746f96dd69dd1c3830648e73e7fb747cdb63_2_308x500.jpeg

Forester 2.4

Jon Sterling announced

I am pleased to announce the release of Forester 2.4 on opam, which is an OCaml utility to develop “Forests”, which are densely interlinked mathematical websites / Zettelkästen similar to the Stacks project or Kerodon. You can see the changelog on my own Forest.

This release adds support for wikilinks, among other things. There are some breaking changes to the XML format, so to upgrade an existing forest, make sure to copy in the XSLT and CSS resources from the latest version of the forest template.

Package: opam - forester

List your open OCaml positions on the OCaml.org job board

Bertrand Jeannet announced

Here is a job offer I would like to publish in the site:

Tanks a lot !

OUPS meetup october 2023

zapashcanon announced

The next OUPS meetup will take place on Thursday, 5th of October 2023. It will start at 7pm at the 4 place Jussieu in Paris.

:warning: :trumpet: It will be in the in the Astier amphitheater in the Esclangon building. :trumpet: :warning:

Please, register on meetup as soon as possible to let us know how many pizza we should order.

For more details, you may check the OUPS’ website .

This month will feature the following talks :

Chamelon : un minimiseur de programmes pour et en OCaml – Milla Valnet

Modern DSL compiler architecture in OCaml our experience with Catala – Louis Gesbert (@AltGr) In this presentation, we intend to show a state-of-the-art DSL implementation in OCaml, with concrete examples and experience reports. In particular, we found that some advanced practices, while accepted among the hardcore OCaml developers (e.g. use of row type variables through object types), lacked visibility and documentation: some of them deserve to be better known. Our experience is based on the Catala compiler, a DSL for the implementation of algorithms defined in law.

Fmlib 0.5.5 with emphasis on combinator parsing with lexers

Helmut announced

I am pleased to annouce version 0.5.5 of the functional library fmlib. The main part of version 0.5.5 is the sublibrary Fmlib_parse which has now support for combinator parsing with the separation of parsing and lexing. The new version is available via opam.

Combinator parsers usually do not separate the parser from the lexer. This is a disadvantage in parsing languages which have keywords which look like identifiers. A combinator parser usually needs a lot of backtracking (which costs sperformance) when parsing such a language.

In order to improve the situation Fmlib_parse allows the separation of parsing and lexing. The lexer usually needs very little or no backtracking to parse the lexical tokens. Any backtracking in the parser does not pushback larges sequences of characters to the input stream, it just pushes back already correctly parsed lexical tokens (which is cheaper) and does not need to rescan the pushed back lexical tokens character by character. See https://hbr.github.io/fmlib/odoc/fmlib_parse/parse_lex.html for details.

Furthermore the sublibrary Fmlib_browse supports the function map on virtual doms and attributes of the virtual dom and allows subscriptions on_animation. Look into https://hbr.github.io/fmlib/odoc/fmlib_browser/doc.html to see how Fmlib_browser supports web applications written in ocaml.

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 online.