OCaml Weekly News

Previous Week Up Next Week


Here is the latest OCaml Weekly News, for the week of January 30 to February 06, 2024.

Table of Contents

OCaml meetups at different places

Xavier Van de Woestyne announced

In Lille, from 2016 to 2021, we organised LambdaLille: https://github.com/lambdalille/talks

Even if the event wasn’t 100% dedicated to OCaml, it was mainly general. There were several presentations dedicated to OCaml or by members of the OCaml community (13 talks related to OCaml/Reason).

The event was pretty cool and survived the online meetup pandemic just fine. And yes, we were using Meetup (and Twitter for communication) with a big presence at other events for publicity. Looking back, I think it was probably one of the biggest regular events dedicated to functional programming in French, outside the academic world.

In 2021, I moved to Nantes and we were able to launch LambdaNantes : https://mobilizon.fr/@lambdanantes

(yeah, the logo is … weird)

The event is, for the moment, less ambitious (but we’ve already had 2 events dedicated to OCaml, we also sponsored an OUPS!). Another change is the switch to Mobilizon, a free Meetup implementation based on ActivityPub. It’s not crazy, and as we like to reinvent the wheel, we’ll probably write our version in OCaml.

We’re always on the lookout for speakers and presentations, so we’d be delighted to host any. If you’re close to Nantes! For 2024, we’re going to try, after the ScalaIO 2024 conference (the 10th anniversary, in Nantes, where I’ll be giving the opening keynote) to create a more regular event, and to have better communication so that, why not, we end up with a real annual conference.

Tutorials on Modules, Functors and Libraries

Cuihtlauac Alvarado announced

Dear OCamlers,

OCaml.org tutorial updates continue. We’ve just published the three tutorials on the module system announced in December:

  1. Modules — Based on the previous version
  2. Functors — Mostly rewritten
  3. Libraries with Dune — New

The target audience is developers learning OCaml. No functional programming knowledge is assumed. However, it comes after the “Get Started” and “Language” series.

Thanks to @ostera, @yawaramin, @jbe, and @lindig for their feedback. Share yours on GitHub, here, or use the “Open an Issue” and “Contribute” links at the bottom of the pages. We’ve recently received and merged many contributions; we’d be happy to add even more.

Hope it helps

opam 101: the first steps, by OCamlPro

OCamlPro announced

Greetings Cameleers,

Here’s a quick heads up about our latest blog post: opam 101: the first steps

We believe this short tutorial could be useful to anybody who is looking into getting acquainted with our beloved package manager, be they new or simply unaware about how opam interacts with your system at `init` time!

Hoping that it may serve as a reference for all newcomers to the ecosystem,

Kind regards, The OCamlPro Team

Bogue tutorials 0.1.0

Continuing this thread, sanette announced

More will come when time permits!

I’m happy to announce 2 more tutorials:

Layouts : a tree structure

Widgets and connections : a graph structure

The latter even has a small reversi-like game where all squares are actually widgets talking to each other, demonstrating the use of “connections”.


Announcing validate 1.0.0 - Enhanced Data Validation in OCaml!

Mateusz Ledwoń announced

Hey everyone, it’s me again with more good news from the validate world!

I’m thrilled to announce that validate has just leveled up to version 1.1.0! This update packs a bunch of new features and annotations that I’m sure you’ll find useful.

What’s New:

  • New String Annotations: @ulid for ULID strings, @ipv4 and @ipv6 for IP addresses, @phone for E.164 phone numbers, and @mac_address for MAC addresses. These will help ensure your data formats are spot on.
  • Option Type Annotations: Introducing @some and @none to assert presence or absence of values in option types.
  • Advanced Annotations:
    • @custom: Create your own validation logic! It’s super flexible and allows you to define validations that suit your unique needs.
    • @ignore_if: Skip validations conditionally. Really handy for those complex data structures.
    • @some_if and @none_if: Control the requirements of Some and None in option types based on conditions.

Dive into the Examples:

  • @custom
    let custom_validator str =
      if String.length str > 1 then Ok ()
      else Error (Validate.BaseError { code = "custom_validator"; params = [] })
    type custom_validator_record = {
      custom_validator : string; [@custom custom_validator]
    [@@deriving validate]
  • @ignore_if
    type temperature_record = {
      unit : string;
      temperature : int; [@greater_than_or_equal 0] [@ignore_if fun r -> r.unit <> "K"]
    [@@deriving validate]
  • @some_if and @none_if
    type contact_info = {
      username : string option; [@some_if fun r -> r.email = None]
      email : string option; [@none_if fun r -> Option.is_some r.username]
    [@@deriving validate]

    These new features add so much more depth and flexibility to validate. I’m really excited to see how you all use them in your projects.

    Check out all the details: GitHub - Axot017/validate.

MirageOS hack retreat 2024 edition (April 22nd - 28th)

Hannes Mehnert announced

Dear valued OCaml enthusiast,

it is my pleasure to distribute the news that there will be a next face-to-face meeting of MirageOS people in sunny Marrakesh, Morocco.

This time it is in late April, and we’re keen to say hi to new faces and to people we already know.

Everyone is welcome - you should be nice and also be interested in MirageOS (to a certain degree). :D But if you’re mostly joining for the sunshine and delicious food, that is fine as well.

Further information and registration instructions on https://retreat.mirage.io

Hope to see you there!

Fmlib 0.5.8 with unicode parsers

Helmut announced

I have the pleasure to announce version 0.5.8 of fmlib. fmlib is a functional monadic library which features combinator parsing, elm like browser applications, and pretty printing. This release focuses mainly combinator parsing. The added functionality is:

Furthermore the library Fmlib_browser (https://hbr.github.io/fmlib/odoc/fmlib_browser/doc.html) has added functionality to make parallel http requests (in general parallel tasks).

The main features of Fmlib_parse are:

  • Indentation sensitive parsing: The parsers can parse indentiation sensitive languages like Python, Haskell, Yaml, etc. (https://hbr.github.io/fmlib/odoc/fmlib_parse/parse_indentation.html)
  • Incremental parsing: The parsers have inversion of control. I.e. they do not read from streams. The user can push characters or tokens into the parsers. The parsing process can be interrupted and resumed at any time.
  • Immutable: The parser can therefore be used in live editors. The parsers can e.g. be stored at the beginning of each line. After editing a line the parser can be restarted by feeding it the current line an following.
  • Nicely formatted error messages (https://hbr.github.io/fmlib/odoc/fmlib_parse/parse_format.html)

Learn Lambda Calculus in 10 minutes with OCaml

Dmitrii Kovanikov announced

Hi everyone :wave:

I wrote a short blog post about teaching the fundamentals of Lambda Calculus with some OCaml code:


Nothing really knew if you’re already familiar with the subject but it’s nice reminder how easy and elegant a Lambda Calculus code can be in an FP language :slightly_smiling_face:

ppx_minidebug 1.0.0: explore logs of type-annotated let-bindings, code branches

Lukasz Stafiniak announced

I’m happy to announce version 1.0 of ppx_minidebug. It is inspired by dariusf/ppx_debug: Tools for record-and-replay debugging, but rather than parsing .cmt files it relies on user-provided type annotations.

  • It can highlight paths to a regular expression-based search term.
  • It has options to trim down the size of generated logs and split logs into multiple files.
  • It uses c-cube/printbox as a backend (plus a minimal, flushing backend) – offering HTML and Markdown output with foldable trees.
  • It supports both deriving.show and deriving sexp “frontends” – in the latter case, it can turn large values into foldable trees.
  • It can log control flow structures (match / function branches, loops, anonymous functions).
  • It propagates types top-down, merges types and decomposes patterns, making it easier to provide types for desired values.

ppx_minidebug: Formatted logs of type-annotated let-bound values, function arguments and results, if and match branches taken. Optionally, as collapsible HTML or Markdown trees with highlights. (github.com)

Inline test examples: ppx_minidebug/test/test_expect_test.ml

OCaml Retreat at Auroville, India (March 10th - March 15th)

Sudha Parimala announced

Dear fellow Caml-ers,

We are running an OCaml retreat (inspired by Mirage Retreats) at Auroville, India (located ~3hrs drive from Chennai). We are looking forward to hacking on a variety of OCaml projects throughout the week and participating in external activities in the evenings. Folks interested to attend the retreat, please register here - https://forms.gle/K8VFJyWf4mcoEn5q6

Please don’t hesitate to contact us in case you have questions. Hoping to see some of you there!

OUPS meetup february 2024

zapashcanon announced

The next OUPS meetup will take place on Thursday, 29th of February 2024. It will start at 7pm at the 4 place Jussieu in Paris.

:warning: :trumpet: It will be in the in the Esclangon building (amphi Astier). :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 :

Correct, Fast LR(1) Unparsing – François Pottier

We describe an extension of the LR(1) parser generator Menhir with new features that aim to facilitate unparsing, that is, transforming abstract syntax trees back into text. Our method supports non-LR(1) grammars decorated with precedence declarations and guarantees correct unparsing, by which we mean that parentheses or other disambiguation symbols are inserted where necessary. Furthermore, it allows the user to control other aspects of the unparsing process, such as layout. Our contributions include a novel view of unparsing as a composition of several successive transformations; the novel concept of disjunctive concrete syntax trees (DCSTs); a fast algorithm that converts DCSTs to ordinary concrete syntax trees (CSTs), thereby deciding where disambiguation symbols must be inserted; and the automated generation of safe APIs for the construction of DCSTs and deconstruction of CSTs.

Ocsigen/Be Sport: Implémenter un réseau social en OCaml – Vincent Balat

Lancer un réseau social en 2015 est un projet très ambitieux pour une start-up : outre la difficulté de capter une masse d’utilisateurs suffisante, il faut réussir à implémenter rapidement et avec peu de moyen des applications Web et mobiles avec un niveau de qualité comparable aux grands réseaux concurrents. Be Sport est le réseau social du sport, développé en collaboration avec le comité national olympique et plusieurs fédérations. Il recense plus de 650000 équipes françaises dans tous les sports et tous leurs matchs, aux niveaux amateur et professionnel. Il propose des fonctionnalités similaires à Facebook : pages personnelles, groupes, événements, flux d’actualité, etc. Dans cet exposé je montrerai comment le choix d’OCaml pour l’implémentation s’est avéré gagnant. L’utilisation poussée du typage permet de réduire considérablement le temps de débogage et le framework Ocsigen permet de simplifier beaucoup la communication client-serveur et de développer avec un seul et même code les applications Web et mobile pour Android et iOS. Je vous donnerai les bases de ce style de programmation précurseur et vous montrerai comment faire rapidement votre première application.

After the talks there will be some pizzas offered by the OCaml Software Foundation and later on we’ll move to a pub nearby as usual.

Other OCaml News


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.