[Caml-list] Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt
2025-04-01T09:13:04Z

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

Hello

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

Table of Contents
─────────────────

MlFront_ZipFile - High-level API for zip files
MlFront_Cache - Transient caches + slowly varying data
New lesson on polymorphic variants
The OBazl Toolsuite 3.0.0.beta.1
Dune dev meeting
Other OCaml News
Old CWN

MlFront_ZipFile - High-level API for zip files
══════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-mlfront-zipfile-high-level-api-for-zip-files/16380/1>

jbeckford announced
───────────────────

I am happy to announce that `MlFront_ZipFile.2.3.0', a package that
can do basic zip/unzip operations on a zip file, was released
today. It is available on opam with `opam update' and `opam install
MlFront_ZipFile'.

There are other opam packages for zip files, and often those are more
appropriate. `MlFront_ZipFile' is different because:

• It is very high-level. I wanted an API to unzip and zip, with a
simple observer API for unzipping so I could attach @CraigFe's
excellent [`progress'] bar library.
• It can unzip 4GB files in a 32-bit OCaml runtime.
• It has a permissive license.
• It is not thread-safe (except unzipping).
• It fully embeds the C code. That means it works on Windows and
should work under cross-compilation without needing a
non-portable/non-reproducible `pkg-config' installation.
• It has a binary `mlfront-zip' which can do glob-based exclusions (a
feature not present in the typical InfoZip `/usr/bin/zip' that comes
with Unix or PowerShell `Compress-Archive' on Windows). macOS,
Windows and Linux have prebuilt binaries.

Here are the relevant links:
• Docs:
[https://dkml.gitlab.io/build-tools/MlFront/MlFront_ZipFile/MlFront_ZipFile/index.html]
• `mlfront-zip' binaries:
[https://gitlab.com/dkml/build-tools/MlFront/-/releases/2.3.0-8]
• homepage: <https://gitlab.com/dkml/build-tools/MlFront>

Sidenote: The docs won't be available on ocaml.org. Use the doc links
above until I figure out a technical solution (very low-priority).

[`progress']
<https://github.com/craigfe/progress?tab=readme-ov-file#progress>

[https://dkml.gitlab.io/build-tools/MlFront/MlFront_ZipFile/MlFront_ZipFile/index.html]
<https://dkml.gitlab.io/build-tools/MlFront/MlFront_ZipFile/MlFront_ZipFile/index.html>

[https://gitlab.com/dkml/build-tools/MlFront/-/releases/2.3.0-8]
<https://gitlab.com/dkml/build-tools/MlFront/-/releases/2.3.0-8>

MlFront_Cache - Transient caches + slowly varying data
══════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-mlfront-cache-transient-caches-slowly-varying-data/16381/1>

jbeckford announced
───────────────────

I am happy to announce that `MlFront_Cache.2.3.0', a framework for
transient caches and slowly varying data, was released today. It is
available on opam with `opam update' and `opam install MlFront_Cache'.

MlFront_Cache lets you cache files and directories, all backed in a
local sqlite3 database. It is a bit esoteric. I use it for:

1. Transient caches when downloading zip files.
2. Immutable installs for DkCoder. A related use case is covered in
detail in the docs as "Downloading datasets".

Treat this as an alpha release with a somewhat unstable API. In
particular, I haven't implemented cache eviction yet.

Here are the relevant links:
• Docs:
[https://dkml.gitlab.io/build-tools/MlFront/MlFront_Cache/MlFront_Cache/index.html]
• homepage: <https://gitlab.com/dkml/build-tools/MlFront>

Sidenote: The docs won't be available on ocaml.org. Use the doc links
above until I figure out a technical solution (very low-priority).

[https://dkml.gitlab.io/build-tools/MlFront/MlFront_Cache/MlFront_Cache/index.html]
<https://dkml.gitlab.io/build-tools/MlFront/MlFront_Cache/MlFront_Cache/index.html>

New lesson on polymorphic variants
══════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/new-lesson-on-polymorphic-variants/16390/1>

Jakub Svec announced
────────────────────

Hello,

I wrote a new lesson on polymorphic variants.

You can find it [here].

I appreciate any feedback you may have. I expect that if there is
interest in including a lesson on polymorphic variants that there will
likely be several rounds of refinement.

Sources:

• <https://blog.shaynefletcher.org/2017/03/polymorphic-variants-subtyping-and.html>
• <https://discuss.ocaml.org/t/new-draft-tutorial-on-polymorphic-variants/13485>
• <https://discuss.ocaml.org/t/is-there-any-kind-of-guidline-about-when-to-use-polymorphic-variants/11006>
• <https://blog.klipse.tech/ocaml/2018/03/16/ocaml-polymorphic-types.html>

This lesson is about 800 lines long (about 1100 with line length
limited to 85 columns). This makes this lesson on the longer side when
compared to other lessons on OCaml.org. Therefore, this is the first
of 2 lessons on polymorphic variants.

This lesson (lesson 1) introduces the concepts behind polymorphic
variants (such as row polymorphism and structural typing), then
discusses common syntactic structures of polymorphic variants. It
teaches these concepts in a bottom-up direction. It is my subjective
belief (held lightly) that introducing polymorphic variants in a
top-down direction leads to more complexity and confusion.

Lesson 2, which is forthcoming, introduces common usecases for
polymorphic variants through real-world examples.

Any feedback a reviewer is willing to provide is greatly
appreciated. The author is particularly interested in ensuring
accuracy and validity of examples and consistency in the language with
OCaml.org's other materials, but all feedback is welcome.

[here] <https://hackmd.io/@wqo57Le0RIyZVlb8qdJ8PA/HJchCEX6ye/edit>

The OBazl Toolsuite 3.0.0.beta.1
════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-the-obazl-toolsuite-3-0-0-beta-1/16407/1>

Gregg Reynolds announced
────────────────────────

The OBazl Toolsuite 3.0.0.beta.1 is now available.

The OBazl Toolsuite is a collection of rules & tools that support
OCaml development using [Bazel]. To get started:
┌────
│ $ git clone https://github.com/obazl/demo_hello.git
│ $ cd demo_hello
│ $ bazel run bin:greetings
└────

See [The OBazl Book] for more guidance.

Tested on MacOS and Linux (Ubuntu).

This version contains many improvements:

• Improved toolchain support. Select a compiler by passing
e.g. `--tc=ocamlc'.
• Seamless opam dependencies. The previous version required a
preprocessing step (running `bazel run @coswitch'); this is no
longer necessary.
• Fine-grained dependencies. Depend directly on any module, whether it
is in a library or not, and whether it is namespaced (~~wrapped'')
or not.
• Context-sensitive archiving. Archives are for distribution; internal
dependencies do not need them. The `ocaml_library' rule will only
construct an archive on demand. By default, an internal dependency
on an `ocaml_library' target will not request archiving. This can be
overridden.
• Several examples of OBazl extensions: rules_ppx, rules_cppo,
rules_ctypes, rules_menhir. These demonstrate the relative ease
with which tools can be integrated into the Bazel environment.
• A new tool, `bazel run @obazl//new' that generates a project from a
template.
• Direct support for the tools in the standard SDK (ocamldebug,
ocamlobjinfo, etc.) and for a subset of the OCaml Platform
tools. For example:
‣ `$ bazel run @opam -- list'
‣ `$ bazel run @ocaml'
‣ `$ bazel run @utop'
‣ `$ bazel run @dbg --@dbg//pgm=src:greetings'

OBazl ensures that these commands will be invoked under the correct
switch, with correct paths (CAML_LD_LIBRARY_PATH etc.), insulated
from environment variables.

Other tools are invoked by passing an option to an ordinary build
command. For example:

• `$ bazel build lib/hello:Hello --modinfo' # runs ocamlobjinfo on the
.cmo/.cmx output
• `$ bazel build lib/hello:Hello --siginfo' # runs ocamlobjinfo on the
.cmi output
• `$ bazel build lib/hello:libFoo --archinfo' # runs ocamlobjinfo on
the .cma/.cmxa output
• `$ bazel build lib/hello:Hello --gensig' # runs `ocamlopt -i' on the
.ml file to generate inteface code.

The documentation at [The OBazl Book] has been updated. It remains
far from complete but it should be useful. In particular the [OBazl
Guide] and the [`rules_ocaml' Reference Manual].

What's missing?

• Support for opam publishing. I have successfully published an OBazl
(Bazel) project to an opam switch, and used it in a dune-only
project, but the code is still under development so I don't have a
demo.
• Support for `odoc', `ocamlformat', and linting. Currently under
development.
• Windows support. The code is designed for portability but it will
probably be a while before I can get to Windows.
• Automatic generation of BUILD.bazel files. I have a tool for this
but it is outdated. Bringing it up-to-date is a high priority.

Support:
• [discord]
• [@obazl.bsky.social]

Cheers!

Gregg

[Bazel] <https://bazel.build/>

[The OBazl Book] <https://obazl.github.io/docs_obazl/>

[OBazl Guide] <https://obazl.github.io/docs_obazl/obazl>

[`rules_ocaml' Reference Manual]
<https://obazl.github.io/docs_obazl/rules-ocaml/reference/>

[discord] <https://discord.gg/wZCSq2nq6y>

[@obazl.bsky.social] <https://bsky.app/profile/obazl.bsky.social>

Dune dev meeting
════════════════

Archive: <https://discuss.ocaml.org/t/ann-dune-dev-meeting/14994/27>

Etienne Marais announced
────────────────────────

Hello :waving_hand: The next Dune Dev Meeting will be on *Wednesday,
April, 2nd 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 :+1:

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

• Meeting link: [zoom]
• Calendar event: [google calendar]
• Wiki with information and previous notes: [dune wiki on GitHub]

[meeting dedicated page]
<https://github.com/ocaml/dune/wiki/dev-meeting-2025-04-02>

[zoom]
<https://us06web.zoom.us/j/85096877776?pwd=cWNhU1dHQ1ZNSjZuOUZCQ0h2by9Udz09>

[google calendar]
<https://calendar.google.com/calendar/u/0/embed?src=c_5cd698df6784e385b1cdcdc1dbca18c061faa96959a04781566d304dc9ec7319@group.calendar.google.com>

[dune wiki on GitHub] <https://github.com/ocaml/dune/wiki>

Other OCaml News
════════════════

>From the ocaml.org blog
───────────────────────

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

• [Why F#?]
• [ FOSDEM 2025: Report from the Friendly Functional Languages BOF
Room]
• [Pushing the opam-repository into a sustainable repository]
• [μTCP, Miou and unikernels]

[the ocaml.org blog] <https://ocaml.org/blog/>

[Why F#?] <https://batsov.com/articles/2025/03/30/why-fsharp/>

[ FOSDEM 2025: Report from the Friendly Functional Languages BOF Room]
<https://tarides.com/blog/2025-03-28-fosdem-2025-report-from-the-friendly-functional-languages-bof-room>

[Pushing the opam-repository into a sustainable repository]
<https://blog.robur.coop/articles/2025-03-26-opam-repository-archive.html>

[μTCP, Miou and unikernels]
<https://blog.robur.coop/articles/utcp_and_effects.html>

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

[Alan Schmitt]

[send me a message] <mailto:alan.schmitt@polytechnique.org>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[caml-list] <https://sympa.inria.fr/sympa/info/caml-list>

[Alan Schmitt] <https://alan.petitepomme.net/>

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