caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alan Schmitt <>
To: "lwn" <>, "cwn"  <>,
Subject: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
Date: Tue, 05 Jul 2022 09:42:40 +0200	[thread overview]
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 17974 bytes --]


Here is the latest OCaml Weekly News, for the week of June 28 to July
05, 2022.

Table of Contents

An amusing use of first-class modules: reading from plaintext and compressed files
TLS signature with opam:tls
Open Source tooling engineer at Jane Street
Dune how to define custom build task
Lwt.5.6.0 (and other Lwt packages)
Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
OCamlFormat Web Configurator
Release of optiml-transport

An amusing use of first-class modules: reading from plaintext and compressed files


Continuing this thread, Maëlan asked and Simon Cruanes replied

        You got me curious: what’s the reason for using a
        first-class module here instead of a record or an object?

  Of course!

  • compared to records, I find first-class modules to be a lot more
    convenient for this use case. I still use records for _data_, but a
    record-of-function is often less convenient. For example, modules
    allow you to use `include', they directly handle down-casting as a
    way to hide internal state (whereas for modules you need to close
    over values created before the record); module types are structural,
    so I don't need to worry about disambiguation, whereas records need
    more care there. In terms of performance both seem exactly the same,
    from my toy benchmarks.
  • compared to objects, first-class modules are a bit less convenient
    (no runtime-free cast, no true inheritance/mixin), but LSP and other
    tools are fragile. In addition, invoking an object method seems to
    be roughly twice as slow as a record/module field access — I suppose
    it's because the latter is just an access via offset. That's on a
    micro benchmark so in reality it might be worse.

TLS signature with opam:tls


Marcus Rohrmoser announced

  just implemented key generation

Open Source tooling engineer at Jane Street


Yaron Minsky announced

  We're looking to hire someone to join our build-systems team with a
  focus on open-source tooling. We currently release almost a million
  lines of code of our internal libraries and tools, including things
  like Sexplib, Base, Core, Async, Incremental, Bonsai, Hardcaml,
  memtrace-viewer, and patdiff.

  We have internal tooling for moving code from our internal
  repositories to Github and for publishing to opam, and for ferrying
  information back from Github to our internal tools, so that developers
  can more easily and promptly respond to PRs and issues coming from the

  We want to make open-sourcing our code better and faster, so it's
  easier for us to work with outside contributors, and improvements can
  get out to the community more quickly. Your work would be to make our
  releases delightfully easy and reliable!

  I wrote a bit more about it here:


  If you're interested, go ahead and make an [ordinary application] to
  our software engineering role, and mention that you're interested in
  "open-source tooling". We're happy to hire for this role in both
  London and New York.

[ordinary application]

Dune how to define custom build task


cnmade explained

  dune has very powerful extensions, but the documentation doesn't tell
  you directly. Today I'll share a specific example of how we can make
  dune do many things with a dune configuration.

  For example

  • Publish compiled documents to our documentation server
  • Sending email notifications to email groups
  • Sending SMS notifications to administrators
  • Build a document and open a browser to preview the document page

  Let's start with an example, we create a dune file in the root
  directory of our project, which you may not have originally, you have
  to create a new one, we enter the following

  │ ; now we tell you how to define a custom rule
  │ ; rule start with (rule )
  │ (rule
  │ ; (alias is point  the command name , so you can run this rule by call  dune build @docopen
  │  (alias docopen)
  │  ; following line is very important, it tell dune do not cache this build command, so it will running every call
  │ without any cache
  │  (deps (universe))
  │  ; action  (system  to told system run command by `sh` in your Linux/MacOS, windows user may running cmd.exe
  │  ; cd ../.. is change the base directory of the running command ,or the default directory will be _build/default
  │  (action (system "cd ../.. && pwd &&  dune build @doc && open _build/default/_doc/_html/index.html" ))
  │ )
  │ ; end of one piece of rule
  │ ; and we define more and more rule as we want
  │ (rule
  │   (alias whoami)
  │   (deps (universe))
  │   (action (system "uname -a;whoami"))
  │ )

  In this example, we define two rules, the rules are the tasks that
  dune can recognize, in dune, it is called rules

  Because it is a custom build command, we use alias to take a unique
  and non-repeating alias.

  The first build command is to build the document and open the browser

  Our alias is docopen

  Then deps we add universe to tell dune that you don't want to cache
  and give me a new build every time. If you don't add this line, dune
  will only give you one build, and then because of the cache, you won't
  be able to execute it later.

  action following by system here, action is the command to start,
  system means to use the system shell (windows is cmd, linux macos is
  sh) to give you the execution of the code you specify.

  You can see the first we are first change the directory to the project
  root directory [because the default directory is _build/default], and
  then we perform the build document generation, and then open open the
  generated html page.

  The first build command is this, if you want to perform the first
  build task, you can type

  `dune build @docopen'

  Then our second build command, relatively simple, with reference to
  the first, we can add a lot of build commands we want to add inside
  this dune configuration file.

  We just need to specify different alias aliases for them, no

  The official documentation also specifies some other available
  commands, I won't go into them one by one. Since I prefer to use shell
  scripts, I really only need the system to execute my shell scripts for

Lwt.5.6.0 (and other Lwt packages)


Raphaël Proust announced

Lwt 5.6.1

  Version 5.6.1 of the Lwt package has been released. This version
  contains a fix for a bug introduced in 5.6.0 whereby devnull file
  descriptor would be closed during some uses of `Lwt_process'.


Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0


jbeckford announced

  The 0.4.0 release of Diskuv OCaml for Windows users is available! It
  is usable enough that I've let my school-age kids (elementary through
  high school) install it and go through some tutorials.


  The links to the documentation are available from the above link as

  Here are the one-time inconveniences if you install this release:
  1. The built-in antivirus Windows Defender treats newly signed
     binaries like spam. There needs to be enough people who "Report
     this file as safe" before the binaries are trusted. /If you do
     nothing but mark it safe or install it on Windows, you are helping
  2. The installer will automatically install the Visual Studio compiler
     if needed. But Visual Studio sometimes requires a reboot. The
     instructions will tell you if you need the reboot.
  3. The Visual Studio Code OCaml plugin defaults to expecting a legacy
     `ocamlenv' program on Windows. You have to search for `ocamlenv' in
     Visual Studio Code Settings and disable it. This should have a fix,
     but not in time for this release.

Windows parity with Unix

  1. `opam' commands like `opam install' should work without any
     wrappers. But you should create new switches with `opam dkml init'
     (see `--help' for options).
  2. `dune' commands like `dune build' should work without any
     wrappers. The only hiccup is that aliases like `dune build
     @runtest' need to be escaped in PowerShell like:
     │ dune build `@runtest
  3. You have partial support if your home directory has spaces, since
     it is very common on Windows to have your username be `FirstName
     LastName'. So far I've configured/patched most things to work with
     spaces, but there could be common packages that were missed, and
     only NTFS drives work.
  4. OCaml 4.12.1. I'd like to upgrade to 4.13 or 4.14, but having
     support for Visual Studio Code debugging with [4.12-only
     ocamlearlybird] is more important, especially for traditional
     Windows users.
  5. Dune 2.9.3. I've bundled in support in 2.9.3 for fswatch/inotify so
     that `dune build --watch' works on Windows. Nothing is blocking an
     upgrade to 3.x except time (ie. not now) and a reason.
  6. Opam 2.1.2 plus some PRs that are pending the not-yet-released
     version 2.2.
  7. Git performance on Windows just sucks. It is like someone designed
     it for a Linux kernel 🤨. Apparently [Git FSMonitor in 2.37.0] can
     be enabled to speed things up, but I don't have real-world
     experience with it because it was just released yesterday.
  8. MSYS2, which can be accessed with `with-dkml bash', now uses the
     CLANG64 variant. There are thousands of up-to-date third-party
     libraries available and, unlike MinGW, they are ABI compatible with
     the dominant Windows compiler (MSVC). And if you are interested
     there is an [ocamlverse Help Wanted] to add the CLANG64 compiler as
     an alternative to the Administrator-requiring, reboot-needing MSVC

  Thanks to OCaml Software Foundation for sponsoring this!

  0.4.x will be the last minor versions of the "preview". I'll be
  shifting to closing out any show-stopping bugs, and updating the
  various Windows onboarding guides for OCaml to officially include
  Diskuv OCaml.

[4.12-only ocamlearlybird]

[Git FSMonitor in 2.37.0]

[ocamlverse Help Wanted]

OCamlFormat Web Configurator


Louis Roché announced

  It is my pleasure to share with you the [ocamlformat configurator] as
  a web page.

  Ocamlformat is a great tool that really makes editing code a more
  pleasant experience. It has a bunch of different built in profiles and
  many additional options to fine tune how the code should look
  like. While I would encourage most people and new projects to use one
  of the default profiles, the many options are helpful when
  transitioning an existing codebase. Unfortunately it is not super easy
  to figure out which options to use and how to combine them.  There are
  [58 parameters]! I've spent a long time trying different combinations
  by changing an option in my .ocamlformat, running `dune build @fmt`,
  checking the code, going back to the first step… It is a tedious
  work. So I decided to make a simple web interface with all of the
  options available and a faster feedback loop.


  Thanks to js_of_ocaml the task was not too complicated. Ocamlformat
  can be compiled to javascript, there is nothing special to do. Which
  means everything can be done in the browser, the code won't leak to
  anyone, there is no need to maintain a server, and the result will be
  guaranteed to be identical as a formatting with the cli tool.

  The configuration can be set through text (just put the content of
  your `.ocamlformat` in the text box) and through a bunch of
  dropdown. They will be combined together. The dropdown takes
  precedence over the textual configuration if an option is set in both.

  The project has been started as part of the "open source day" at
  Ahrefs (we try to dedicate some time to open source projects that we
  use internally). It is still in its infancy. Please pardon the
  terrible style, I am not a web developer and didn't have time to make
  it look nicer yet. There are some annoying things to fix (no feedback
  when the code is invalid and can't be formatted), and many
  improvements to come (a way to download the configuration for
  example). But I think that it is already working well enough to be
  used by others.

  You can find the configurator at
  The source code is on github at

  If you like ocaml and want to look for a job, we have some [positions

[ocamlformat configurator] <>

[58 parameters]

[positions available] <>

Release of optiml-transport


Igarnier announced

  Hi! [optiml-transport] was just released on opam. This library binds
  C++ primitives to solve the [optimal
  problem between finite weighted point clouds (i.e. finite
  measures). Concretely, this allows to lift any [metric] on a base
  space to a metric on finitely supported probability measures over that
  base space. (In fact, the library works with cost functions more
  general than that satisfying the metric axioms.) The library also
  outputs an optimal coupling between any two such measures. Optimal
  transportation has many applications in statistics, graphics,
  optimization, etc.

  The library consists in bindings to

[optiml-transport] <>

[metric] <>


  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

  If you also wish to receive it every week by mail, you may subscribe

  [Alan Schmitt]

[send me a message] <>

[the archive] <>

[RSS feed of the archives] <>

[online] <>

[Alan Schmitt] <>

[-- Attachment #2: Type: text/html, Size: 29182 bytes --]

             reply	other threads:[~2022-07-05  7:42 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05  7:42 Alan Schmitt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-26 17:54 Alan Schmitt
2022-07-19  8:58 Alan Schmitt
2022-07-12  7:59 Alan Schmitt
2022-06-28  7:37 Alan Schmitt
2022-06-21  8:06 Alan Schmitt
2022-06-14  9:29 Alan Schmitt
2022-06-07 10:15 Alan Schmitt
2022-05-31 12:29 Alan Schmitt
2022-05-24  8:04 Alan Schmitt
2022-05-17  7:12 Alan Schmitt
2022-05-10 12:30 Alan Schmitt
2022-05-03  9:11 Alan Schmitt
2022-04-26  6:44 Alan Schmitt
2022-04-19  5:34 Alan Schmitt
2022-04-12  8:10 Alan Schmitt
2022-04-05 11:50 Alan Schmitt
2022-03-29  7:42 Alan Schmitt
2022-03-22 13:01 Alan Schmitt
2022-03-15  9:59 Alan Schmitt
2022-03-01 13:54 Alan Schmitt
2022-02-22 12:43 Alan Schmitt
2022-02-08 13:16 Alan Schmitt
2022-02-01 13:00 Alan Schmitt
2022-01-25 12:44 Alan Schmitt
2022-01-11  8:20 Alan Schmitt
2022-01-04  7:56 Alan Schmitt
2021-12-28  8:59 Alan Schmitt
2021-12-21  9:11 Alan Schmitt
2021-12-14 11:02 Alan Schmitt
2021-11-30 10:51 Alan Schmitt
2021-11-16  8:41 Alan Schmitt
2021-11-09 10:08 Alan Schmitt
2021-11-02  8:50 Alan Schmitt
2021-10-19  8:23 Alan Schmitt
2021-09-28  6:37 Alan Schmitt
2021-09-21  9:09 Alan Schmitt
2021-09-07 13:23 Alan Schmitt
2021-08-24 13:44 Alan Schmitt
2021-08-17  6:24 Alan Schmitt
2021-08-10 16:47 Alan Schmitt
2021-07-27  8:54 Alan Schmitt
2021-07-20 12:58 Alan Schmitt
2021-07-06 12:33 Alan Schmitt
2021-06-29 12:24 Alan Schmitt
2021-06-22  9:04 Alan Schmitt
2021-06-01  9:23 Alan Schmitt
2021-05-25  7:30 Alan Schmitt
2021-05-11 14:47 Alan Schmitt
2021-05-04  8:57 Alan Schmitt
2021-04-27 14:26 Alan Schmitt
2021-04-20  9:07 Alan Schmitt
2021-04-06  9:42 Alan Schmitt
2021-03-30 14:55 Alan Schmitt
2021-03-23  9:05 Alan Schmitt
2021-03-16 10:31 Alan Schmitt
2021-03-09 10:58 Alan Schmitt
2021-02-23  9:51 Alan Schmitt
2021-02-16 13:53 Alan Schmitt
2021-02-02 13:56 Alan Schmitt
2021-01-26 13:25 Alan Schmitt
2021-01-19 14:28 Alan Schmitt
2021-01-12  9:47 Alan Schmitt
2021-01-05 11:22 Alan Schmitt
2020-12-29  9:59 Alan Schmitt
2020-12-22  8:48 Alan Schmitt
2020-12-15  9:51 Alan Schmitt
2020-12-01  8:54 Alan Schmitt
2020-11-03 15:15 Alan Schmitt
2020-10-27  8:43 Alan Schmitt
2020-10-20  8:15 Alan Schmitt
2020-10-06  7:22 Alan Schmitt
2020-09-29  7:02 Alan Schmitt
2020-09-22  7:27 Alan Schmitt
2020-09-08 13:11 Alan Schmitt
2020-09-01  7:55 Alan Schmitt
2020-08-18  7:25 Alan Schmitt
2020-07-28 16:57 Alan Schmitt
2020-07-21 14:42 Alan Schmitt
2020-07-14  9:54 Alan Schmitt
2020-07-07 10:04 Alan Schmitt
2020-06-30  7:00 Alan Schmitt
2020-06-16  8:36 Alan Schmitt
2020-06-09  8:28 Alan Schmitt
2020-05-19  9:52 Alan Schmitt
2020-05-12  7:45 Alan Schmitt
2020-05-05  7:45 Alan Schmitt
2020-04-28 12:44 Alan Schmitt
2020-04-21  8:58 Alan Schmitt
2020-04-14  7:28 Alan Schmitt
2020-04-07  7:51 Alan Schmitt
2020-03-31  9:54 Alan Schmitt
2020-03-24  9:31 Alan Schmitt
2020-03-17 11:04 Alan Schmitt
2020-03-10 14:28 Alan Schmitt
2020-03-03  8:00 Alan Schmitt
2020-02-25  8:51 Alan Schmitt
2020-02-18  8:18 Alan Schmitt
2020-02-04  8:47 Alan Schmitt
2020-01-28 10:53 Alan Schmitt
2020-01-21 14:08 Alan Schmitt
2020-01-14 14:16 Alan Schmitt
2020-01-07 13:43 Alan Schmitt
2019-12-31  9:18 Alan Schmitt
2019-12-17  8:52 Alan Schmitt
2019-12-10  8:21 Alan Schmitt
2019-12-03 15:42 Alan Schmitt
2019-11-26  8:33 Alan Schmitt
2019-11-12 13:21 Alan Schmitt
2019-11-05  6:55 Alan Schmitt
2019-10-15  7:28 Alan Schmitt
2019-09-03  7:35 Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).