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

Alan Schmitt
2024-12-24T08:55:25Z

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

Hello

Here is the latest OCaml Weekly News, for the week of December 17 to 24,
2024.

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

dream-html and pure-html
Dune 3.17
First release candidate of OCaml 5.3.0
Pragmatic Category Theory | Part 3: Associativity
ocaml-stk, xtmpl, stog, ocaml-css, ocaml-ldp, higlo and chamo
MirageOS on OCaml 5
Dune dev meeting
Other OCaml News
Old CWN

dream-html and pure-html
════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-dream-html-pure-html-3-5-2/14808/6>

Yawar Amin announced
────────────────────

[ANN] dream-html 3.8.0

Happy to announce some added power to the form decoding
functionality. Three main things:

1. Added [Dream_html.form] and [query] helper functions to wrap
extracting the data directly from the Dream request and decoding it
correspondingly from the body or query.
2. Added the (monadic) chaining operator [Dream_html.Form.( let* )]
and [ok] and [error] helpers to allow sophisticated sequential
decoding where decoding of some fields depend on others.
3. Added optional parameters to constrain [typed decoding] of values
eg `int ~min:0' will succeed the decode if the value is an integer
_and_ at least 0. Also added [unix_tm] type decoder to decode
timestamps into `Unix.tm' structs (not timezone-aware).

The last [example] on the page shows a fairly sophisticated form
decoder which requires an `id' field and _one or more of_ the fields
`days', `weeks', `months', and `years', and fails if at least one is
not provided.

Enjoy :slight_smile:

[Dream_html.form]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/#val-form>

[query]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/#val-query>

[Dream_html.Form.( let* )]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#val-let*>

[ok]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#val-ok>

[error]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#val-error>

[typed decoding]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#basic-type-decoders>

[unix_tm]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#val-unix_tm>

[example]
<https://yawaramin.github.io/dream-html/dream-html/Dream_html/Form/index.html#examples>

Dune 3.17
═════════

Archive: <https://discuss.ocaml.org/t/ann-dune-3-17/15770/4>

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

The Dune team is happy to announce the release of Dune `3.17.1'!
:camel:

This patch release includes some bug fixes. To reduce computing time,
it does not build `.cmxs' files anymore when the `(no_dynlink)' stanza
is used. This change also corrects the semantic of the `(no_dynlink)'
stanza which was building `.cmxs' files even if it did not install
them. Now, it does not build nor install them.

If you encounter a problem with this release, you can report it on the
[ocaml/dune] repository.

[ocaml/dune] <https://github.com/ocaml/dune/issues>

Changelog
╌╌╌╌╌╌╌╌╌

◊ Fixed

• When a library declares `(no_dynlink)', then the `.cmxs' file for it
is no longer built. (#11176, @nojb)
• Fix bug that could result in corrupted file copies by Dune, for
example when using the `copy_files#' stanza or the `copy#'
action. (@nojb, #11194, fixes #11193)
• Remove useless error message when running `$ dune subst' in empty
projects. (@rgrinberg, #11204, fixes #11200)

First release candidate of OCaml 5.3.0
══════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/first-release-candidate-of-ocaml-5-3-0/15815/1>

octachron announced
───────────────────

The release of OCaml 5.3.0 is imminent.

As a final step, we are publishing a release candidate to check that
everything is in order before the release in the upcoming week(s).

If you find any bugs, please report them on [OCaml's issue tracker].

Compared to the second beta, this release candidate contains a
regression fix in the type system (some type expressions were not
generalized when they ought to be), one fix for the new check for
dependency order at link time, and a manual update.

The full change log for OCaml 5.3.0 is available [on GitHub]. A short
summary of the changes since the second beta release is also available
below.

[OCaml's issue tracker] <https://github.com/ocaml/ocaml/issues>

[on GitHub] <https://github.com/ocaml/ocaml/blob/5.3/Changes>

Installation Instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

The base compiler can be installed as an opam switch with the
following commands on opam 2.1 and later:
┌────
│ opam update
│ opam switch create 5.3.0~rc1
└────

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

• [GitHub]
• [OCaml archives at Inria]

[GitHub] <https://github.com/ocaml/ocaml/archive/5.3.0-rc1.tar.gz>

[OCaml archives at Inria]
<https://caml.inria.fr/pub/distrib/ocaml-5.3/ocaml-5.3.0~rc1.tar.gz>

◊ Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch
to the option variant with:
┌────
│ opam update
│ opam switch create <switch_name> ocaml-variants.5.3.0~rc1+options <option_list>
└────
where `<option_list>' is a space-separated list of `ocaml-option-*'
packages. For instance, for a `flambda' and `no-flat-float-array'
switch:
┌────
│ opam switch create 5.3.0~rc1+flambda+nffa ocaml-variants.5.3.0~rc1+options ocaml-option-flambda ocaml-option-no-flat-float-array
└────

All available options can be listed with `opam search ocaml-option'.

Changes since the second beta
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

◊ Type system

• [#13690]: some type expressions were incorrectly not generalized
(because they were assigned to the wrong level pool)

[#13690] <https://github.com/ocaml/ocaml/issues/13690>

◊ Documentation

• [#13666]: Rewrite parts of the example code around nested lists in
Chapter 6 (Polymorphism and its limitations -> Polymorphic
recursion) giving the "depth" function [in the
non-polymorphically-recursive part of the example] a much more
sensible behavior; also fix a typo and some formatting. (Frank
Steffahn, review by Florian Angeletti)

[#13666] <https://github.com/ocaml/ocaml/issues/13666>

◊ Compiler user-interface and warnings:

• [#12084], +[#13669], +[#13673]: Check link order when creating
archive and when using ocamlopt.

[#12084] <https://github.com/ocaml/ocaml/issues/12084>

[#13669] <https://github.com/ocaml/ocaml/issues/13669>

[#13673] <https://github.com/ocaml/ocaml/issues/13673>

Pragmatic Category Theory | Part 3: Associativity
═════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/pragmatic-category-theory-part-3-associativity/15819/1>

Dmitrii Kovanikov announced
───────────────────────────

Hi everyone! :wave:

I've finished writing the third part of my *Pragmatic Category Theory*
series (some code examples are in OCaml):

• [Part 3: Associativity]

Previous discussion:

• <https://discuss.ocaml.org/t/new-part-pragmatic-category-theory-part-2-published/15056>

P.S. I would've edited the previous topic instead of creating a new
one but looks like I haven't touched it for a while, so I can't edit
the title and the body anymore.

[Part 3: Associativity]
<https://chshersh.com/blog/2024-12-20-pragmatic-category-theory-part-03.html>

ocaml-stk, xtmpl, stog, ocaml-css, ocaml-ldp, higlo and chamo
═════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-ocaml-stk-xtmpl-stog-ocaml-css-ocaml-ldp-higlo-and-chamo/15820/1>

Zoggy announced
───────────────

Hello,

I made new releases for some libraries and tools. All are available in
opam.

[OCaml-stk] 0.4.0
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

OCaml-stk is a library to build graphical user interfaces, based on
SDL2. This release includes two new widgets:

• a [layers] widget, allowing to display widgets in… layers,
• a xmlview widget (in [stk_xml] package), allowing to display XML
(and so XHTML) documents, handling CSS for styling and layout. The
programmer can customize which widgets are created for each XML
node, and add event handlers on each node. See the "xmlview" example
included in sources.

This new release also comes with an [inspection window] for easier
debugging.

Complete list of changes is [here].

[OCaml-stk] <https://zoggy.frama.io/ocaml-stk/>

[layers]
<https://zoggy.frama.io/ocaml-stk/refdoc/stk/Stk/Layers/class-layers/index.html>

[stk_xml] <https://zoggy.frama.io/ocaml-stk/refdoc/stk_xml/index.html>

[inspection window] <https://zoggy.frama.io/ocaml-stk/doc-inspect.html>

[here] <https://zoggy.frama.io/ocaml-stk/posts/release-0.4.0.html>

[Xtmpl] 1.0.0
╌╌╌╌╌╌╌╌╌╌╌╌╌

Xtmpl is a library to build, read and parse XML document. It provides
a [rewriting engine] and [templating facilities]. This new release
includes a big refactoring, using functors. This creates some
incompatibilities with prior versions. See [here] for changes.

[Xtmpl] <https://www.good-eris.net/xtmpl/>

[rewriting engine]
<https://www.good-eris.net/xtmpl/refdoc/xtmpl/Xtmpl/Rewrite/index.html>

[templating facilities] <https://www.good-eris.net/xtmpl/doc.html>

[here] <https://www.good-eris.net/xtmpl/posts/release-1.0.0.html>

[Stog] 1.1.0
╌╌╌╌╌╌╌╌╌╌╌╌

Stog is a static web site compiler. It is able to handle blog posts as
well as regular pages or any XML document in general. This release
upgrades to Xtmpl 1.1.0 and includes small fixes (see [here] for
details).

[Stog] <https://www.good-eris.net/>

[here] <https://www.good-eris.net/stog/posts/release-1.1.0.html>

[OCaml-css] 0.3.0
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

OCaml-css is an OCaml library to parse and print CSS. It can also
expand namespaces and perform computations on property values. Parser
can be extended by defining additional properties.

This release includes various parsing fixes and adds new CSS
properties: `border-collapse', `border-spacing', and `opacity'. The
complete list of changes is [here].

[OCaml-css] <https://zoggy.frama.io/ocaml-css/>

[here] <https://framagit.org/zoggy/ocaml-css/-/blob/master/Changes>

[OCaml-ldp] 0.4.0
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

This is a library to build [LDP] (Linked Data Platform) and [SOLID]
applications, runnable either in standalone program (using packages
`ldp_tls' or `ldp_curl') or in the browser (using package `ldp_js'
with js_of_ocaml).

This release includes only one fix in [`Ldp.Http'] module: when
following redirection, resolve IRI in Location field of response
against original IRI.

[OCaml-ldp] <https://zoggy.frama.io/ocaml-ldp/>

[LDP] <http://www.w3.org/TR/ldp/>

[SOLID] <https://solidproject.org/>

[`Ldp.Http']
<https://zoggy.frama.io/ocaml-ldp/refdoc/ldp/Ldp/Http/module-type-Http/index.html>

[Higlo] 0.10.0
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Higlo is an OCaml library for syntax highlighting. This release adds a
simple commonmark lexer.

[Higlo] <https://zoggy.frama.io/higlo/>

[Chamo] 4.2.0
╌╌╌╌╌╌╌╌╌╌╌╌╌

Chamo is a source code editor, even if it can be used to edit any text
file. A system of "views" allows to edit some kinds of files in
specific views. It's like an Emacs where Lisp is replaced by OCaml, as
it can be extended and customized in OCaml.

This release is just an upgrade to Stk 0.4.0 and Xtmpl 1.0.0.

[Chamo] <https://zoggy.frama.io/chamo/>

MirageOS on OCaml 5
═══════════════════

Archive: <https://discuss.ocaml.org/t/mirageos-on-ocaml-5/15822/1>

shym announced
──────────────

On behalf of all the numerous developers involved, it’s my pleasure to
announce that the MirageOS ecosystem has seen the long-running work to
port to OCaml 5 come to fruition: `ocaml-solo5' v1.0 is now using
OCaml 5.2.1!

What is `ocaml-solo5'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

`ocaml-solo5' is an OCaml cross compiler for producing Solo5
unikernels. Solo5 is the basis for MirageOS unikernels when they are
not compiled as programs to run on a regular OS.

`ocaml-solo5' responds to specific unikernel constraints. In
particular it provides a placeholder for the standard C library that
is complete enough that we can build the OCaml runtime without a full
POSIX system to support it. That OCaml runtime can then be linked
statically to OCaml programs in order to produce unikernels.

These constraints require us to keep track of developments of the
OCaml compiler and particularly of its runtime. The major changes
coming with OCaml 5 have required quite a lot of work (over 1 year) to
bring our cross compiler up-to-date.

It should be noted that `ocaml-solo5' is restricted to a single domain
but it makes it possible to use the effects introduced with OCaml 5.

MirageOS & OCaml 5
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

The long road to bring Mirage on OCaml 5 started with adding support
for Thread-Local Storage (TLS) in Solo5. Even if Solo5 doesn’t support
the creation of threads, the OCaml 5 runtime stores domain-specific
data, including for the first domain, in TLS. The main work was done
in [solo5#546] and [solo5#542] with fixes in [solo5#551] and
[solo5#554]. It was released with [Solo5 v0.8.0].

This foundational work on Solo5 unblocked the port of the compiler
_per se_. As the OCaml runtime changed substantially between OCaml 4.x
and 5.x, this required many changes in the minimal library, called
`nolibc', that provides simple implementations and stubs for the part
of the libc interface the runtime uses. In particular, the memory
management of the runtime is very different from OCaml 4.x (which is
natural, due to the multicore support): it uses the `mmap~/~munmap'
functions instead of `malloc~/~free'. `mmap' is a very versatile
interface, tightly tied to the virtual memory. Providing adequate
(correct but still simple) implementations of `mmap~/~munmap' in the
context of Solo5, _i.e._ without virtualisation of the memory,
required a careful review of how the interface is actually used in the
runtime.

Besides that work on `nolibc', building an OCaml compiler targeting
Solo5 also requires a few patches to the compiler build system. As
much work has been happening upstream to fix issues in building a
cross compiler, this was taken as an opportunity to write clean
patches in order to contribute them upstream and simplify the future
of OCaml/Solo5 (along with other cross-compiler projects).

All this work has been combined in [ocaml-solo5#134], which built on
and completed [ocaml-solo5#122], [ocaml-solo5#124] and
[ocaml-solo5#129]. It was released in [ocaml-solo5 v1.0.0].

Now we are eager to learn how it behaves in your applications! Note in
particular that, as already mentioned, the garbage collector is
completely different from the one in OCaml 4. For example, the [Mirage
website] currently runs the two versions, one on OCaml 4 and one on
OCaml 5 with traffic being alternatively routed to one or the other,
to monitor their behaviours. First experiments show that we must tweak
the `space_overhead' parameter to have the OCaml 5 unikernel use the
same amount of memory than the OCaml 4 one, at the price of some
compute time. This generally means that you might have to experiment a
bit if you run within very constrained memory limits.

[solo5#546] <https://github.com/Solo5/solo5/pull/546>

[solo5#542] <https://github.com/Solo5/solo5/pull/542>

[solo5#551] <https://github.com/Solo5/solo5/pull/551>

[solo5#554] <https://github.com/Solo5/solo5/pull/554>

[Solo5 v0.8.0]
<https://github.com/Solo5/solo5/blob/master/CHANGES.md#v080-2023-04-25>

[ocaml-solo5#134] <https://github.com/mirage/ocaml-solo5/pull/134>

[ocaml-solo5#122] <https://github.com/mirage/ocaml-solo5/pull/122>

[ocaml-solo5#124] <https://github.com/mirage/ocaml-solo5/pull/124>

[ocaml-solo5#129] <https://github.com/mirage/ocaml-solo5/pull/129>

[ocaml-solo5 v1.0.0]
<https://github.com/mirage/ocaml-solo5/blob/main/CHANGES.md#v100-2024-12-04>

[Mirage website] <https://mirage.io/>

How to give it a spin
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

To try the new OCaml 5, first create an OPAM switch [with OCaml
5.2.1]. Then, follow the standard procedure (see how to [install it]
and how to [build an hello-world unikernel]). After installing
`ocaml-solo5', you can check with `opam list ocaml-solo5' that it
installed the version `1.x' of the package.

[with OCaml 5.2.1]
<https://discuss.ocaml.org/t/ocaml-5-2-1-released/15634>

[install it] <https://mirage.io/docs/install>

[build an hello-world unikernel] <https://mirage.io/docs/hello-world>

People involved
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Many people got involved at some point or another, either with code or
comments, to that community effort (hopefully not forgetting anyone,
in `sort' order):

• Adam Steen
• Adrian-Ken Rueegsegger
• Christiano Haesbaert
• Fabrice Buoro
• Hannes Mehnert
• Kate
• Pierre Alain
• Romain Calascibetta
• Samuel Hym
• Sébastien Hinderer

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

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

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

Hi camelers! :camel: The next Dune meeting is supposed to be on
Wednesday, December, 25th, but since it is Christmas Day (a bank
holiday for various countries), the meeting is cancelled. Next one
will be on the January, 8th, 2025 :fireworks:

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

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

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

• [Pragmatic Category Theory | Part 3: Associativity]
• [Learn OCaml the Easy Way - Including the Hard Bits]
• [MetAcsl v0.8 for Frama-C 30.0 Zinc]
• [Saturn 1.0: Data structures for OCaml Multicore]
• [Frama-Clang v0.0.17 for Frama-C 30.0~ Zinc]

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

[Pragmatic Category Theory | Part 3: Associativity]
<https://chshersh.com/blog/2024-12-20-pragmatic-category-theory-part-03.html>

[Learn OCaml the Easy Way - Including the Hard Bits]
<https://tarides.com/blog/2024-12-18-learn-ocaml-the-easy-way-including-the-hard-bits>

[MetAcsl v0.8 for Frama-C 30.0 Zinc]
<https://frama-c.com/fc-plugins/metacsl.html>

[Saturn 1.0: Data structures for OCaml Multicore]
<https://tarides.com/blog/2024-12-11-saturn-1-0-data-structures-for-ocaml-multicore>

[Frama-Clang v0.0.17 for Frama-C 30.0~ Zinc]
<https://frama-c.com/fc-plugins/frama-clang.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: 34090 bytes --]