Attn: Development Editor, Latest OCaml Weekly News
Alan Schmitt <[email protected]>
| Newsgroups | gmane.comp.lang.caml.inria |
|---|---|
| Message-ID | <[email protected]> |
Hello
Here is the latest OCaml Weekly News, for the week of November 28 to
December 05, 2023.
Table of Contents
─────────────────
Highlexer
Video Tutorial: How to Install OCaml on Linux and macOS!
Eio TUI chat server and client demo
dune.3.12.1
OCaml Platform Newsletter: October 2023
Advent of Code project template
opam-health-check-ng 0.1.0: check the health of an opam repository on your home machine
First release candidate of OCaml 5.1.1
Compositional Automated Verification for OCaml
OCaml and OPAM awarded The Open Science Award for Free and Open-Source Research Softwares
ICFP 2023 OCaml Presentations on YouTube
geojson and geojsone
Rethinking abstract module types - feedback wanted
TSan support in OCaml 5.1 and blog post
Hilite 0.3.0
You Can Attend the New OCaml.org Community Meetings
A December update from the ocaml-wasm organisation
Other OCaml News
Old CWN
Highlexer
═════════
Archive: <https://discuss.ocaml.org/t/ann-highlexer/13520/1>
Emile Trotignon announced
─────────────────────────
I please to announce the first release of [highlexer]. It is a small
library that allows you to highlight ocaml code snippets using a
modified version of the ocaml lexer.
It was designed to work well in the browser with js_of_ocaml, but it
does not have to, you can use it to color html in the backend or even
probably latex.
[highlexer]
<https://ocaml.org/p/highlexer/latest/doc/Highlexer/index.html>
Video Tutorial: How to Install OCaml on Linux and macOS!
════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/video-tutorial-how-to-install-ocaml-on-linux-and-macos/13523/1>
Isabella Leandersson announced
──────────────────────────────
Hello everyone!
I’m part of a group at Tarides that is focusing on creating video
tutorials for OCaml. Since everyone learns differently – I myself use
videos a lot when learning a new skill or concept – we want to provide
different mediums through which people can learn OCaml.
This is our first video and there’s definitely room for improvement!
Please let us know what could be better, and if you have any ideas for
what we should cover next please share them with us! :D
<https://www.youtube.com/watch?v=sy4EQirNMUI>
Eio TUI chat server and client demo
═══════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/eio-tui-chat-server-and-client-demo/13533/1>
Darren announced
────────────────
Hello everyone,
I’m sharing a small demo of using Eio and Nottui (and Notty) to
implement chat server + client.
[Repo]
The technical details are available in the README of the repo.
Server:
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/4/4f7948399009cd7976003ec7a2b289bd306e50f4.png>
Client:
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/f/f4ca35a5b08807ebc502589c9cb6ae7e1468e7d4.png>
[Repo] <https://github.com/darrenldl/ocaml-tui-chat-demo>
dune.3.12.1
═══════════
Archive: <https://discuss.ocaml.org/t/ann-dune-3-12-1/13536/1>
Etienne Millon announced
────────────────────────
The Dune team is pleased to announce the release of Dune 3.12.
Note that due to a mistake during the release process, version
`3.12.0' was not published to opam and should not be used. So here’s
the changelog for `3.12.1'.
Added
╌╌╌╌╌
• Introduce `$ dune ocaml doc' to open and browse documentation.
(#7262, fixes #6831, @EmileTrotignon)
• `dune cache trim' now accepts binary byte units: `KiB', `MiB', etc.
(#8618, @Alizter)
• Introduce the `runtest_alias' field to the `cram' stanza. This
allows removing default `runtest' alias from tests. (@rgrinberg,
#8887)
• Display cache location in Dune log (#8974, @nojb)
• Dune can now be built and installed on Haiku (#8795, fix #8551,
@Alizter)
• Mark installed directories in `dune-package' files. This fixes
`(package)' dependencies against packages that contain such
directories. (#8953, fixes #8915, @emillon)
• Introduce new experimental odoc rules (#8803, @jonjudlam)
Changed
╌╌╌╌╌╌╌
• dune-build-info: when `version=""' is found in a `META' file, we now
return `None' as a version string (#9177, @emillon)
• No longer force colors for OCaml 4.03 and 4.04 (#8778, @rgrinberg)
• Dependencies in the copying sandbox are now writeable (#8920,
@rgrinberg)
• Rules that only use internal dune actions (`write-file', `echo',
etc.) can now be sandboxed. (#9041, fixes #8854, @rgrinberg)
• Add `test_' prefix to default test name in `dune init project'
(#9257, fixes #9131, @9sako6)
Fixed
╌╌╌╌╌
• Do not ignore libraries named `bigarray' when they are defined in
conjunction with OCaml 5.0 (#8902, fixes #8901, @rgrinberg)
• Correctly ignore `bigarray' on recent versions of OCaml (#9076,
@rgrinberg)
• Absent packages shouldn’t prevent all rules from being loaded
(#8948, fixes #8630, @rgrinberg)
• Correctly determine the stanza of menhir modules when
`(include_subdirs qualified)' is enabled (@rgrinberg, #8949, fixes
#7610)
• Re-run actions whenever `(expand_aliases_in_sandbox)' changes
(#8990, @rgrinberg)
• Do not re-run rules when their location changes (#9052, @rgrinberg)
• [coq rules] Be more tolerant when coqc –print-version / –config
don’t work properly, and fallback to a reasonable default. This
fixes problems when building Coq projects with `(stdlib no)' and
likely other cases. (#8966, fix #8958, @Alizter, reported by Lasse
Blaauwbroek)
• Dune will now run at a lower framerate of 15 fps rather than 60 when
`INSIDE_EMACS'. (#8812, @Alizter)
OCaml Platform Newsletter: October 2023
═══════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ocaml-platform-newsletter-october-2023/13538/1>
Thibaut Mattio announced
────────────────────────
Welcome to the seventh edition of the OCaml Platform newsletter!
In this October edition, we bring you the latest on the OCaml
Platform, continuing our tradition of highlighting recent developments
as seen in [previous editions]. To understand the direction we’re
headed, especially regarding development workflows and user experience
improvements, check out our [roadmap].
*Highlights:*
• The three-year roadmap for the OCaml Platform has been adopted!
We’re thrilled to have a community-driven roadmap for the
improvement of OCaml developer experience, and we’re very grateful
for all the excellent feedback we received from the community. Have
a look at the [announcement].
• After [giving space for feedback] and objections by the community,
we have [deprecated ocaml-migrate-parsetree] (aka OMP). It is
superseded by [Ppxlib].
• We’re introducing a new format for our newsletter. Let us know your
thoughts and how we can make it even better for you!
*Releases:*
• [`opam-publish' 2.3.0]
• [`Ppxlib' 0.31.0]
• [`odoc' 2.3.1]
• [Dune 3.11.0]
• [Dune 3.11.1]
[previous editions] <https://discuss.ocaml.org/tag/platform-newsletter>
[roadmap] <https://ocaml.org/docs/platform-roadmap>
[announcement]
<https://discuss.ocaml.org/t/the-ocaml-platform-roadmap-is-adopted/13459>
[giving space for feedback]
<https://discuss.ocaml.org/t/deprecating-ocaml-migrate-parsetree-in-favor-of-ppxlib-also-as-a-platform-tool/13240>
[deprecated ocaml-migrate-parsetree]
<https://ocaml.org/changelog/2023-10-23-omp-deprecation>
[Ppxlib] <https://github.com/ocaml-ppx/ppxlib>
[`opam-publish' 2.3.0]
<https://ocaml.org/changelog/2023-10-30-opam-publish-2.3.0>
[`Ppxlib' 0.31.0] <https://ocaml.org/changelog/2023-10-05-ppxlib-0.31.0>
[`odoc' 2.3.1] <https://ocaml.org/changelog/2023-10-30-odoc-2.3.1>
[Dune 3.11.0] <https://ocaml.org/changelog/2023-10-04-dune-3.11.0>
[Dune 3.11.1] <https://ocaml.org/changelog/2023-10-12-dune-3.11.1>
*[Dune]* Exploring Package Management in Dune
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W4])
*Contributed by:* @rgrinberg (Tarides), @Leonidas-from-XIV (Tarides),
@gridbugs (Tarides), @kit-ty-kate (Tarides), @Alizter
*Why:* Unify OCaml tooling under a single command line for all
development workflows. This addresses one of the most important pain
points [reported by the community].
*What:* Prototyping the integration of package management into Dune by
using opam as a library. We’re adding a new `dune pkg lock' command to
generate a lock file and extend `dune build' to support downloading
and building dependencies specified in the lock file. Read the [Dune
RFC] for more details.
*Activities:*
• We reworked the storage for opam repositories. We now have support
for multiple repositories, which we store and update in an efficient
manner. – [ocaml/dune#8950]
• We introduced the `$ dune pkg outdated' command to view all the
outdated packages in a lock directory. – [ocaml/dune#8773]
• We introduced `$ dune describe pkg lock' to print lock directories.
This gives users a nice overview of what’s available in the lock
directory’s build plan. – [ocaml/dune#8841]
• We added support for solver variables in `lockdir' to make sure opam
variables are also available at build and install time –
[ocaml/dune#8973]
• We managed to successfully generate a lock file for `cmdliner' on
Windows! :windows: Next, we’re working on making build work on
Windows as well. – [ocaml/dune#9048]
• And as usual, we fixed a bunch of bugs that prevented your regular
packages from building:
• Require copying sandbox for build rules – [ocaml/dune#8923]
• Respect [flags] field in opam packages – [ocaml/dune#9047]
• Improve invalid substitute error – [ocaml/dune#8922]
• Correctly verify tarball checksums – [ocaml/dune#8876]
• Improve locations of conversion errors – [ocaml/dune#8828]
• Remove post deps – [ocaml/dune#8834]
• Move solver env printing to own command – [ocaml/dune#8819]
• Record installed directories in `dune-package' – [ocaml/dune#8953]
[W4] <https://ocaml.org/docs/platform-roadmap#w4-build-a-project>
[reported by the community]
<https://www.dropbox.com/s/omba1d8vhljnrcn/OCaml-user-survey-2020.pdf?dl=0>
[Dune RFC] <https://github.com/ocaml/dune/issues/7680>
[ocaml/dune#8950] <https://github.com/ocaml/dune/pull/8950>
[ocaml/dune#8773] <https://github.com/ocaml/dune/pull/8773>
[ocaml/dune#8841] <https://github.com/ocaml/dune/pull/8841>
[ocaml/dune#8973] <https://github.com/ocaml/dune/pull/8973>
[ocaml/dune#9048] <https://github.com/ocaml/dune/pull/9048>
[ocaml/dune#8923] <https://github.com/ocaml/dune/pull/8923>
[ocaml/dune#9047] <https://github.com/ocaml/dune/pull/9047>
[ocaml/dune#8922] <https://github.com/ocaml/dune/pull/8922>
[ocaml/dune#8876] <https://github.com/ocaml/dune/pull/8876>
[ocaml/dune#8828] <https://github.com/ocaml/dune/pull/8828>
[ocaml/dune#8834] <https://github.com/ocaml/dune/pull/8834>
[ocaml/dune#8819] <https://github.com/ocaml/dune/pull/8819>
[ocaml/dune#8953] <https://github.com/ocaml/dune/pull/8953>
*[opam]* Native Support for Windows in opam 2.2
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W5])
*Contributed by:* @rjbou (OCamlPro), @kit-ty-kate (Tarides), @dra27
(Tarides), @AltGr (OCamlPro)
*Why:* Opam and `opam-repository' currently don’t support Windows
natively. This effectively makes OCaml a very niche candidate on
Windows, as users either have to (1) not use a package manager or (2)
use a fork of opam and the `opam-repository'. Making opam and the
`opam-repository' compatible with Windows will make OCaml a better
choice for Windows users and help us grow the community. More Windows
users able to use opam leads to more contributors, more testing, more
Windows friendly packages, and more packages in the end.
*What:* Releasing opam 2.2 with native support for Windows and making
the official `opam-repository' usable on Windows.
*Activities:*
• Essentially focused on `setenv' & `build-env' environment variables
update handling on Windows - [ocaml/opam#5636]
[W5] <https://ocaml.org/docs/platform-roadmap#w5-manage-dependencies>
[ocaml/opam#5636] <https://github.com/ocaml/opam/pull/5636>
*[`odoc']* Add Search Capabilities to `odoc'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W25])
*Contributed by:* @panglesd (Tarides), @EmileTrotignon (Tarides),
@julow (Tarides), @jonludlam (Tarides)
*Why:* The in-package search added in OCaml.org’s central package
documentation has been very well received by the community and
improves how users navigate and discover OCaml documentation. We’re
upstreaming it to `odoc' to bring it into the local documentation as
well and provide more advanced features, like searching by type.
*What:* We’re adding support in `odoc' for pluging in a search engine!
`odoc' provides the UI (a search bar) and will generate a search index
(that can also be used to be integrated into other search engine like
Elasticsearch). We’re also building a default client-side search
engine based on Sherlodoc.
*Activities:*
• We’ve merged the PR adding [new search capabilities]! :tada: This
will ship in the upcoming version of `odoc' 2.4.0.
• We are currently experimenting with building an `odoc' search engine
based on [Sherlodoc] –[art-w/sherlodoc#4].
[W25]
<https://ocaml.org/docs/platform-roadmap#w25-generate-documentation>
[new search capabilities] <https://github.com/ocaml/odoc/pull/972>
[Sherlodoc] <https://github.com/art-w/sherlodoc>
[art-w/sherlodoc#4] <https://github.com/art-w/sherlodoc/pull/4>
*[`odoc']* Syntax for Images and Assets in `odoc'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W25])
*Contributed by:* @panglesd (Tarides), @jonludlam (Tarides),
@dbuenzli, @gpetiot (Tarides)
*Why:* Allow package authors to write rich documentation, making it
more useful and improving OCaml developer experience by providing an
ecosystem of high-quality documentation for OCaml packages.
*What:* We’re adding support for assets and new syntax to embed medias
(images, audio, and videos).
*Activities:*
• We’ve decided to rework the asset support design a little to bring
it more in line with how other elements are handled, such as
modules, types, and values. The intent is to ensure the code is
straightforward to maintain in the long term. – [ocaml/odoc#1002]
• We continued reviewing the PR, adding syntactic support for media.
There were some good discussions relating to missing assets, and
it’s ready to go in once the assets PR is merged. –
[ocaml/odoc#1005]
[W25]
<https://ocaml.org/docs/platform-roadmap#w25-generate-documentation>
[ocaml/odoc#1002] <https://github.com/ocaml/odoc/pull/1002>
[ocaml/odoc#1005] <https://github.com/ocaml/odoc/pull/1005>
*[Dune]* Generate Dependencies Documentation with Dune
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W25])
*Contributed by:* @jonludlam (Tarides)
*Why:* Make locally-generated documentation more useful by allowing
users to navigate to their dependencies’ documentation from their
package docs. Currently users can use `odig', which provides a similar
workflow. We’re adding support for this in Dune directly.
*What:* We’re writing new Dune rules for `odoc' that (1) use the new
`odoc' CLI to enable performance improvement and caching opportunities
and (2) generate the documentation of every opam packages in your
switch, allowing users to navigate to their dependencies’
documentation from their local docs.
*Activities:*
• The new Dune rules have been reworked a little following feedback
from @alizter and @rgrinberg, improving the following areas: better
support for multiple `findlib' directories; better support for
system switches; and a more robust method for translating from
`findlib' paths to local paths. – [ocaml/dune#8803]
[W25]
<https://ocaml.org/docs/platform-roadmap#w25-generate-documentation>
[ocaml/dune#8803] <https://github.com/ocaml/dune/pull/8803>
*[Merlin]* Support for Project-Wide References in Merlin
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
([W19])
*Contributed by:* @voodoos (Tarides), @trefis (Tarides), @Ekdohibs
(OCamlPro), @gasche (INRIA)
*Why:* Project-wide reference as an editor feature is a great way for
developers to navigate their codebase and understand it better. It’s
also a feature that users expect to have coming from other ecosystems,
so having support for it in Merlin and OCaml LSP will both improve
OCaml editor experience and make it on par with other languages.
*What:* We’re adding a new `merlin single occurrences' command and
support for the LSP `textDocument/references' request. To do that,
we’re extending the compiler’s Shapes to support global occurences,
building a tool that generates an index of identifiers in a codebase
and adding support for it in Dune, Merlin, and OCaml LSP.
*Activities:*
• We continued working on the compiler PR for project-wide
occurrences, notably adding support for inline records’ labels. The
PR is now ready for the next round of reviews. – [ocaml/ocaml#12508]
• Concurrently, we continued working on the tools involved in
providing occurrences. We are still on track for releasing an
experimental 4.14-based variant of the compiler to gather feedback
on the feature before the end of the year. Our current aim is to
provide official project-wide occurrences support in OCaml 5.2. –
[voodoos/merlin#8], [voodoos/ocaml-lsp#2], [voodoos/dune#2],
[ocaml-index#5]
[W19] <https://ocaml.org/docs/platform-roadmap#w19-navigate-code>
[ocaml/ocaml#12508] <https://github.com/ocaml/ocaml/pull/12508>
[voodoos/merlin#8] <https://github.com/voodoos/merlin/pull/8>
[voodoos/ocaml-lsp#2] <https://github.com/voodoos/ocaml-lsp/pull/2>
[voodoos/dune#2] <https://github.com/voodoos/dune/pull/2>
[ocaml-index#5] <https://github.com/voodoos/ocaml-index/pull/5>
*[Merlin]* Improving Merlin’s Performance ([W19])
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
*Contributed by:* @pitag (Tarides), @Engil (Tarides), @3Rafal
(Tarides)
*Why:* Some Merlin queries have been shown to scale poorly in large
codebases, making the editor experience subpar, with users reporting
that they sometime must wait for a few seconds to get the answer for
Merlin. This is obviously a major issue that hurts developer
experience, so we’re working on improving Merlin performance when it
falls short.
*What:* We’re building benchmarking and fuzzy-testing CIs to
continuously benchmark and test Merlin. We’re addressing the
performance bottlenecks identified from profiling Merlin and analysing
benchmarking results.
*Activities:*
• We’ve continued our work on a fuzzy-testing CI for Merlin. Our first
approach was to persist the testing data in sync with the Merlin
commit history. However, that implied dealing with all kinds of data
races when comparing the data between a PR and its base branch, when
generating and persisting new data, and when approving changes. To
avoid that, in October we experimented with a simpler approach that
regenerates the data for every CI run - without compromising on CI
run time. The new approach seems promising.
• We’ve also come back to work on Merlin performance improvements. We
plan to [optimise Merlin’s space-time trade-off] by experimenting
(on an opt-in basis) with different lifetimes for the `cmi-cache'
and `cmt-cache'. For that, we’re [adding information about Merlin’s
memory usage to its telemetry]. Furthermore, we’ve looked into
refining the typer cache granularity and [have analysed its
challenges].
[W19] <https://ocaml.org/docs/platform-roadmap#w19-navigate-code>
[optimise Merlin’s space-time trade-off]
<https://github.com/ocaml/merlin/issues/1636>
[adding information about Merlin’s memory usage to its telemetry]
<https://github.com/ocaml/merlin/issues/1680>
[have analysed its challenges]
<https://github.com/ocaml/merlin/issues/1637#issuecomment-1781232379>
Advent of Code project template
═══════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-advent-of-code-project-template/13539/1>
Trent Small announced
─────────────────────
Hey everyone!
I recently published a starter project for working on Advent of Code
puzzles in OCaml: [https://github.com/Sixstring982/tanenbaum]
It works for all “years” (and should work for 2023, assuming no API
changes will be made tonight), and has some other nice features:
• Automatic downloading + caching of puzzle inputs
• CLI for running puzzles + submitting answers to `adventofcode.com'
• Automatic puzzle detection + registration
Hope some folks find this useful – I’ve been using it a lot myself!
[https://github.com/Sixstring982/tanenbaum]
<https://github.com/Sixstring982/tanenbaum>
opam-health-check-ng 0.1.0: check the health of an opam repository on your home machine
═══════════════════════════════════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-opam-health-check-ng-0-1-0-check-the-health-of-an-opam-repository-on-your-home-machine/13546/1>
Kate announced
──────────────
Hi everyone,
I’m happy to announce the first release of [opam-health-check-ng] that
I’ve been developing the past 2 months.
[opam-health-check-ng] is a fork of [opam-health-check] (available at
[check.ci.ocaml.org]) of which I’m also the author of and was its main
user for the past 6 years. It fundamentally differs from its parent
mainly by targeting small home servers using:
• an off-the-shelf Docker installation
• tightly controlled network access (e.g. you don’t want to have your
home internet stop to a crawl at an unexpected time while you’re
watching a video)
• a tightly controlled load making it easier to benchmark whole runs
and have stable temperature, which also makes sure your hardware
lasts as long as possible
My main goal was for it to be easier to maintain and deploy when I’m
working for the [OCaml Software Foundation] on making sure the OCaml
Software Ecosystem (aka. packages in [opam-repository]) is ready
before each release of the OCaml compiler, as well as making sure the
compiler itself doesn’t have any problem.
Incidentally, having a server at home, especially in colder countries
like Scotland, makes it so that you’re not wasting any energy trying
to get rid of heat from a server room. Instead it now serves as your
own personal electric space heater that you can carry to rooms that
need it, making the whole process a little bit greener overall.
If you’re in the unlikely case, where, like me you need to test an
entire opam repository on a daily basis, you’re welcome to install
opam-health-check-ng 0.1.0 using:
┌────
│ opam pin add git+https://github.com/kit-ty-kate/opam-health-check-ng#v0.1.0
└────
You can read on the prerequisites and usage in the associated
[README].
/Disclaimer: I’m not claiming this release to be stable or secure, if
you do use it, use it at your own risk. If you have any questions,
feel free to ask here or on the bugtracker./
I’d like to thank the [OCaml Software Foundation] for founding my work
and this release.
[opam-health-check-ng]
<https://github.com/kit-ty-kate/opam-health-check-ng>
[opam-health-check] <https://github.com/ocurrent/opam-health-check>
[check.ci.ocaml.org] <https://check.ci.ocaml.org/>
[OCaml Software Foundation] <https://ocaml-sf.org/>
[opam-repository] <https://github.com/ocaml/opam-repository/>
[README]
<https://github.com/kit-ty-kate/opam-health-check-ng/blob/v0.1.0/README.md>
First release candidate of OCaml 5.1.1
══════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/first-release-candidate-of-ocaml-5-1-1/13548/1>
octachron announced
───────────────────
Two months (and half) after the release of OCaml 5.1.0, we have
discovered three significant regressions in OCaml 5.1.0, affecting the
packaging of executables, the typechecking of OCaml programs, and the
performance of numerical codes.
Since those regressions affect many users and could have lasting
effects, we have decided to cut a patch release of OCaml 5.1 with
fixes for those issues next week.
To give time for opam packages to test this patch version, we have
just published a first release candidate for OCaml 5.1.1 . The full
list of changes in this release candidate is available below.
As a major exception to our policy for patch releases, OCaml 5.1.1
will contain one breaking change in the standard library: the
`Compression' flag has been removed from the `Marshal' module. This
drastic measure was taken because supporting zstd compression in the
standard library made zstd a dependency of all OCaml executables.
Since the compiler should not impose its dependency on end-users, the
support for compressed marshaling has been moved to a compiler
internal library in 5.1.1. This internally library might be released
as an independent library in later releases of OCaml but not in OCaml
5.1.1 to give us time to polish the library integration and packaging.
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.1.1~rc1
└────
The source code for the release candidate is also directly available
on:
• GitHub: <https://github.com/ocaml/ocaml/archive/5.1.1-rc1.tar.gz>
• OCaml archives at Inria:
<https://caml.inria.fr/pub/distrib/ocaml-5.1/ocaml-5.1.1~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.1.1~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.1.1~rc1+flambda+nffa ocaml-variants.5.1.1~rc1+options ocaml-option-flambda ocaml-option-no-flat-float-array
└────
All available options can be listed with `opam search ocaml-option'.
Changes in OCaml 5.1.1
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
◊ Standard Library Dependency Fix:
• (*breaking change*) [#12562], [#12734], [#12783]: Remove the
`Marshal.Compression' flag to the `Marshal.to_*' functions
introduced in 5.1 by [#12006], as it cannot be implemented without
risking to link -lzstd with all ocamlopt-generated executables. The
compilers are still able to use ZSTD compression for compilation
artefacts. (Xavier Leroy and David Allsopp, report by Kate Deplaix,
review by Nicolás Ojeda Bär, Kate Deplaix, and Damien Doligez).
[#12562] <https://github.com/ocaml/ocaml/issues/12562>
[#12734] <https://github.com/ocaml/ocaml/issues/12734>
[#12783] <https://github.com/ocaml/ocaml/issues/12783>
[#12006] <https://github.com/ocaml/ocaml/issues/12006>
◊ Type System Bug Fix:
• [#12623], fix the computation of variance composition (Florian
Angeletti, report by Vesa Karvonen, review by Gabriel Scherer)
[#12623] <https://github.com/ocaml/ocaml/issues/12623>
◊ GC Performance Regression Fixes
• [#12590], [#12595]: Move `caml_collect_gc_stats_sample' in
`caml_empty_minor_heap_promote' before barrier arrival. (B.
Szilvasy, review by Gabriel Scherer)
• [#12318]: GC: simplify the meaning of custom_minor_max_size: blocks
with out-of-heap memory above this limit are now allocated directly
in the major heap. (Damien Doligez, report by Stephen Dolan, review
by Gabriel Scherer)
• [#12439]: Finalize and collect dead custom blocks during minor
collection (Damien Doligez, review by Xavier Leroy, Gabriel Scherer
and KC Sivaramakrishnan)
• [#12491], [#12493], [#12500], [#12754]: Do not change GC pace when
creating sub-arrays of bigarrays (Xavier Leroy, report by Ido Yariv,
analysis by Gabriel Scherer)
[#12590] <https://github.com/ocaml/ocaml/issues/12590>
[#12595] <https://github.com/ocaml/ocaml/issues/12595>
[#12318] <https://github.com/ocaml/ocaml/issues/12318>
[#12439] <https://github.com/ocaml/ocaml/issues/12439>
[#12491] <https://github.com/ocaml/ocaml/issues/12491>
[#12493] <https://github.com/ocaml/ocaml/issues/12493>
[#12500] <https://github.com/ocaml/ocaml/issues/12500>
[#12754] <https://github.com/ocaml/ocaml/issues/12754>
◊ Miscellaneous Bug Fixes
• [#12581], [#12609]: Fix error on uses of packed modules outside
their pack to correctly handle nested packs (Vincent Laviron, report
by Javier Chávarri, review by Pierre Chambart)
• [#12757]: Fix ocamlnat (native toplevel) by registering frametables
correctly (Stephen Dolan, Nick Barnes and Mark Shinwell, review by
Vincent Laviron and Sébastien Hinderer)
• [#12645], [#12649] fix error messages for cyclic type definitions in
presence of the `-short-paths' flag. (Florian Angeletti, report by
Vesa Karvonen, review by Gabriel Scherer)
[#12581] <https://github.com/ocaml/ocaml/issues/12581>
[#12609] <https://github.com/ocaml/ocaml/issues/12609>
[#12757] <https://github.com/ocaml/ocaml/issues/12757>
[#12645] <https://github.com/ocaml/ocaml/issues/12645>
[#12649] <https://github.com/ocaml/ocaml/issues/12649>
Compositional Automated Verification for OCaml
══════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/postdoc-compositional-automated-verification-for-ocaml/13550/1>
Gabriel Radanne announced
─────────────────────────
This is an announcement for a postdoctoral position in the CAVOC
project (Compositional Automated Verification for OCaml Code). The
post-doc will take place in Nantes, France. It will be co-supervised
by Guilhem Jaber (Nantes Université and Inria Gallinette team) and
Gabriel Radanne (Inria CASH team). It aims to bring together
approaches from abstract interpretation, model checking, and game
semantics to statically analyze OCaml code.
The successful candidate will be employed by Inria and work in the
Gallinette team (<https://gallinette.inria.fr>), at Nantes University.
The position is for one year, and should start in the first semester
of 2024 (to be negociated). The salary will depend on the successful
candidate’s prior research experience with a guaranteed minimum of
~2200€/month after taxes. The working language can either be English
or French.
We seek candidates holding a PhD in Computer Science or Mathematics,
and with expertise in programming language semantics, λ-calculi, type
theory, functional programming, abstract interpretation, compilation,
model checking, or program logic.
Profile
╌╌╌╌╌╌╌
The candidate should be familiar with formal approaches in programming
language design, notably type systems, semantics, and logic. More
concretely, knowledge of the OCaml programming language is expected,
and a knowledge of abstract interpretation or model checking would be
highly appreciated.
This postdoc strongly relies on the fact that practical implementation
should have strong theoretical foundations and that further
refinements of the theory should get inspiration from the practical
side.
Application process
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
• Applications will be processed starting the 18th of December. Late
applications will be considered until the position is filled.
• You do not need to have defended your PhD thesis to apply, but you
will need to have obtained your PhD to start the contract.
• Candidates can send their application to Guilhem Jaber (guilhem
dot jaber at inria dot fr) and Gabriel Radanne (gabriel dot
radanne at inria do fr) with a subject containing “[CAVOC post-doc
application]“.
• The application should contain a CV, two selected publications and
two contacts of reference persons (or reference letters if
available).
Context
╌╌╌╌╌╌╌
The CAVOC project aims to develop a sound and precise static analyzer
for OCaml, that can catch large classes of bugs represented by
uncaught exceptions. The analyzer reasons compositionally on programs,
in order to analyze them at the granularity of a function or of a
module. It takes into account the abstraction properties provided by
the type system and the module system of the language: local values,
abstracted definitions of types, parametric polymorphism.
The main goal is to be sound in a strong way: if an OCaml module is
considered to be correct by the analyzer, then one will have the
guarantee that no OCaml code interacting with this module can trigger
uncaught exceptions coming from the code of this module.
To model the behaviour of a module, we rely on game semantics, where
programs formed by a module and a client of the module are modeled as
calls-and-returns interactions. A module is then represented as a
transition system that generates traces representing the interaction
with any possible client. This transition system is directly generated
from the module’s code (implementation and signature), using an
operational semantics. We have implemented such an interactive
semantics for a large fragment of OCaml, which we are using to develop
our prototype analyzer.
OCaml and OPAM awarded The Open Science Award for Free and Open-Source Research Softwares
═════════════════════════════════════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ocaml-and-opam-awarded-the-open-science-award-for-free-and-open-source-research-softwares/13553/1>
OCamlPro announced
──────────────────
Greetings to all our fellow Cameleers!
In case you missed it: two days ago, the OCaml Community,
specifically, was commended by the /Ministère de l’Enseignement
Supérieur et de la Recherche/ (French Ministry of Higher Education and
Research) in the context of their annual [Prix Science Ouverte du
Logiciel Libre de la Recherche] (The Open Science Awards of Free and
Open-Source Research Software).
Let’s appreciate this moment for what it is: an acknowledgement of the
gargantuan amounts of work that have been poured into OCaml for the
past 27 years, and an opportunity for celebration and praise! We are
so proud and happy to be part of this strong and dynamic community!
/OCaml is a functional programming language that embeds
imperative and object-oriented constructs. Its design is
centred around strong static typing, automatic type
inference, and program modularity. Its applications span
from the high-end academic research to various industrial
domains. Among other things, OCaml is comprised of two
compilers and an execution environment. It evolves inside
a vast ecosystem centred around the package manager
`opam'. The language has maintained its course since 1996
while maintaining the perenniality of the programs running
on it./
[Prix Science Ouverte du Logiciel Libre de la Recherche]
<https://www.enseignementsup-recherche.gouv.fr/fr/remise-des-prix-science-ouverte-du-logiciel-libre-de-la-recherche-2023-93732#item4>
ICFP 2023 OCaml Presentations on YouTube
════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-icfp-2023-ocaml-presentations-on-youtube/13554/1>
jbeckford announced
───────────────────
The individual presentations of the ICFP 2023 OCaml track are
available¹ at:
<https://www.youtube.com/playlist?list=PLyrlk8Xaylp7Tq5-ZN6jkir-sYrhGi_0E>
Bios and papers are listed in the ICFP 2023 program schedule:
<https://icfp23.sigplan.org/home/ocaml-2023#program>.
Thanks to all the presenters and participants who made this event
happen!
– ICFP 2023 OCaml Chairs
[¹] Only the presentations that gave permission to be recorded.
geojson and geojsone
════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-geojson-and-geojsone/10738/2>
Patrick Ferris announced
────────────────────────
Recently, a version `0.2.0' was released of `Geojson' and `Geojsone' –
the biggest change was to remove the explicit dependency on Eio from
the core library and place it into a subpackage `geojsone.eio'. The
[README] has some documentation on this change.
Happy Geospatial Hacking :world_map: :camel:
[README] <https://github.com/geocaml/ocaml-geojson#geojsone>
Rethinking abstract module types - feedback wanted
══════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/gagalium-blog-post-rethinking-abstract-module-types-feedback-wanted/13564/1>
Clément Blaudeau announced
──────────────────────────
I’ve written a blog post on /abstract module types/ (`module type T'
without a definition), available [on the gagalium blog]. The post sums
up how abstract module types can be used, what are the current issues
and proposes a restriction/simplification of their semantics. The goal
is to eventually update the typechecker with this simplified
semantics.
Yet, as it is a restriction, it might break backwards compatibility.
Therefore, the key question I’m trying to answer is whether or not the
simplification I’m proposing is *actually backwards compatible*,
because no one uses abstract module types outside of the setting I’m
proposing.
I welcome any feedback from the both the pedagogical part or the
proposed restriction (to /simple-signatures-only instantiation/),
especially if you’re an user or potential user of abstract module
types!
[on the gagalium blog]
<https://gallium.inria.fr/blog/rethinking-ocaml-abstract-signatures/>
TSan support in OCaml 5.1 and blog post
═══════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-tsan-support-in-ocaml-5-1-and-blog-post/13306/2>
Olivier Nicole announced
────────────────────────
[The video of our talk] about ThreadSanitizer at the OCaml Workshop
2023 is now available.
[The video of our talk]
<https://www.youtube.com/watch?v=zr9S0Fr_Chc&list=PLyrlk8Xaylp7Tq5-ZN6jkir-sYrhGi_0E&index=4>
Hilite 0.3.0
════════════
Archive: <https://discuss.ocaml.org/t/ann-hilite-0-3-0/12723/2>
Patrick Ferris announced
────────────────────────
The not too distant future is here! [Hilite `0.4.0'] now uses
`Cmarkit' instead of `Omd' for the underlying Markdown library. This
is in very large part thanks to [Outreachy contributions to
ocaml.org]!
[Hilite `0.4.0'] <https://github.com/ocaml/opam-repository/pull/24807>
[Outreachy contributions to ocaml.org]
<https://github.com/ocaml/ocaml.org/pull/1642>
You Can Attend the New OCaml.org Community Meetings
═══════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/you-can-attend-the-new-ocaml-org-community-meetings/12656/9>
Sabine Schmaltz announced
─────────────────────────
The meeting time for future ocaml.org dev meetings has changed to
17:00-18:00 CET.
Dec 11 agenda:
1. Open issues for contributors
2. Q&A
You can propose topics for the agenda.
A December update from the ocaml-wasm organisation
══════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/a-december-update-from-the-ocaml-wasm-organisation/13565/1>
Jan Midtgaard announced
───────────────────────
December is upon us and so it is time for an update since our last
[`ocaml-wasm' organisation September update].
[`ocaml-wasm' organisation September update]
<https://discuss.ocaml.org/t/an-update-from-the-ocaml-wasm-organization/13114>
Introduction
╌╌╌╌╌╌╌╌╌╌╌╌
Earlier this year we formed [the `ocaml-wasm' organisation] to join
efforts between two [WebAssembly (Wasm)] targeting compiler projects
for OCaml:
• [`wasocaml'] – a prototype backend for OCaml’s native code compiler
based on the Flambda-intermediate representation
• [`wasm_of_ocaml'] – a fork of [`js_of_ocaml'] that translates OCaml
bytecode to Wasm instead of JavaScript
Exciting news: [The WebAssembly Garbage Collection (WasmGC) extension]
which both `wasocaml' and `wasm_of_ocaml' depend on is now enabled by
default in the latest:
• [Chrome 119 release]
• [Firefox 120 release]
[the `ocaml-wasm' organisation] <https://github.com/ocaml-wasm>
[WebAssembly (Wasm)] <https://webassembly.org/>
[`wasocaml'] <https://github.com/OCamlPro/wasocaml>
[`wasm_of_ocaml'] <https://github.com/ocaml-wasm/wasm_of_ocaml>
[`js_of_ocaml'] <https://github.com/ocsigen/js_of_ocaml>
[The WebAssembly Garbage Collection (WasmGC) extension]
<https://github.com/WebAssembly/gc>
[Chrome 119 release] <https://developer.chrome.com/blog/wasmgc/>
[Firefox 120 release]
<https://www.mozilla.org/en-US/firefox/120.0/releasenotes/>
`wasm_of_ocaml'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
`wasm_of_ocaml' currently requires the following [Wasm extensions]:
• [The GC extension], including functional references and 31-bit
integers
• [The tail-call extension]
• [The exception handling extension]
As you may have inferred, with the latest release Chrome 119 can now
run the output of `wasm_of_ocaml' out of the box!
For Firefox 120, [one needs to enable the Wasm tail call extension
first], but this will [be remedied in the forthcoming 121 release].
OCaml 5.x code using effect handlers can be compiled in two different
ways: one can either enable the CPS transformation from `js_of_ocaml'
or emit code requiring the [JavaScript-Promise Integration extension].
Previously, `wasm_of_ocaml' also required the [experimental
`stringref' proposal] to convert strings between OCaml and JavaScript.
The `stringref' proposal may however be superseeded by the newer
[JS-string-builtins proposal], which is being implemented in both
Chrome and Firefox. With the JavaScript string situation up in the
air, for now `wasm_of_ocaml' instead uses the
`TextEncoder~/~TextDecoder' API on the JavaScript side to convert
JavaScript to or from UTF-8 by writing strings to or reading them from
a buffer in Wasm linear memory as an intermediate state.
Since September @vouillon has continued extending and improving
`wasm_of_ocaml':
• [Implemented unboxed `float' arrays]
• Small runtime improvements:
• Accurate fused multiply–add
• Improved handling of uncaught exceptions
• Improved the generated code by reducing the number of casts
• Optimised the JavaScript interface:
• [Generate constant JavaScript strings at compile time]
• [Generate JavaScript code for function and method calls]
• [Generate JavaScript code for object literals and object property
accesses]
• Run CI tests after each push:
• Run [`js_of_ocaml'’s testsuite including effects, and a number of
other testsuites testing in particular the~zarith~ JavaScript
stubs and the `bonsai' library]
• Run [more Jane Street tests] to ensure compatibility
• [Updated `Eliom' to work with `wasm_of_ocaml'] as a stress test.
This included:
• Finding and fixing a number of small bugs in `wasm_of_ocaml'’s
runtime
• Implementing a few missing features in the runtime, like
[`Json.output'] and [`Js.export'] - [Fixed a performance issue
with toplevel loops]:
• Our loops included all the code that follows, and the V8 engine
used jump offsets to estimate the cost of a loop. So, it could
widely overestimate the cost of loops at toplevel and produce
optimised top-level code which is run only once. Since this
code can be very large, this could take several minutes. Now,
the code which is not involved in a loop is moved after the
loop if it exceeds a size threshold.
In addition, @vouillon also contributed with a couple of broader Wasm
community improvements:
• Making `binaryen' more effective at cancelling out a boxing followed
by an unboxing: [WebAssembly/binaryen#5952] and
• [Improved the performance of Wasm exceptions in V8], the JavaScript
/ Wasm engine used by Chrome. After a number of optimisations, like
using a cache to find which Wasm code correponds to a code pointer,
they are about a order of magnitude faster. As a consequence the
Boyer benchmark runs about 5 time faster.
Finally, he prepared and gave two presentations about `wasm_of_ocaml':
• A general `wasm_of_ocaml' talk at the [WebAssembly Community Group
meeting] on October 12. In particular, he presented a number of
performance measurements.
• A talk on implementing OCaml effect handlers in Wasm at the
[WebAssembly’s Stack Subgroup]
[Wasm extensions] <https://webassembly.org/roadmap/>
[The GC extension] <https://github.com/WebAssembly/gc>
[The tail-call extension]
<https://github.com/WebAssembly/tail-call/blob/main/proposals/tail-call/Overview.md>
[The exception handling extension]
<https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md>
[one needs to enable the Wasm tail call extension first]
<https://github.com/ocaml-wasm/wasm_of_ocaml/issues/10#issuecomment-1824022060>
[be remedied in the forthcoming 121 release]
<https://bugzilla.mozilla.org/show_bug.cgi?id=1846789>
[JavaScript-Promise Integration extension]
<https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md>
[experimental `stringref' proposal]
<https://github.com/WebAssembly/stringref>
[JS-string-builtins proposal]
<https://github.com/WebAssembly/js-string-builtins/blob/main/proposals/js-string-builtins/Overview.md>
[Implemented unboxed `float' arrays]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/3d7b79a932d2d0c45b99af0fb304e8b025ff3b99>
[Generate constant JavaScript strings at compile time]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/3965761ae66189fd2d27df1f00312c7e1e5aa0be>
[Generate JavaScript code for function and method calls]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/a17d190291ed2a8fbe51fd7701a77e3069049eaa>
[Generate JavaScript code for object literals and object property
accesses]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/767134ace25d8612965fd8352370ce7354f911b0>
[`js_of_ocaml'’s testsuite including effects, and a number of other
testsuites testing in particular the~zarith~ JavaScript stubs and the
`bonsai' library]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/6ef1e04eae0091bd87b595791db7ada10b3c4d77>
[more Jane Street tests]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/931ded65c5385af83327ed605226b938095680b1>
[Updated `Eliom' to work with `wasm_of_ocaml']
<https://github.com/ocsigen/eliom/pull/767>
[`Json.output']
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/d2e8eef04117db07318faf36e6619cf4b4eea132>
[`Js.export']
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/f6b1af66bc43ced22d28b28d4c8ff3ef0641f4ce>
[Fixed a performance issue with toplevel loops]
<https://github.com/ocaml-wasm/wasm_of_ocaml/commit/f517bbcafd81de486cf9951f401bd45a69ec4ae8>
[WebAssembly/binaryen#5952]
<https://github.com/WebAssembly/binaryen/pull/5952>
[Improved the performance of Wasm exceptions in V8]
<https://chromium-review.googlesource.com/c/v8/v8/+/5013674>
[WebAssembly Community Group meeting]
<https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-10.md>
[WebAssembly’s Stack Subgroup]
<https://github.com/WebAssembly/meetings/blob/main/stack/2023/stack-2023-11-06.md>
Other OCaml News
════════════════
From the ocaml.org blog
───────────────────────
Here are links from many OCaml blogs aggregated at [the ocaml.org
blog].
• [Rethinking OCaml abstract signatures]
• [Release of Frama-C 28.0 (Nickel)]
• [Unix Module Considered Harmful]
• [Performance Engineering on Hard Mode with Andrew Hunter]
• [Redeveloping TCP from the ground up]
[the ocaml.org blog] <https://ocaml.org/blog/>
[Rethinking OCaml abstract signatures]
<http://cambium.inria.fr/blog/rethinking-ocaml-abstract-signautres>
[Release of Frama-C 28.0 (Nickel)]
<https://frama-c.com/fc-versions/nickel.html>
[Unix Module Considered Harmful]
<https://practicalocaml.com/unix-module-considered-harmful/>
[Performance Engineering on Hard Mode with Andrew Hunter]
<https://signals-threads.simplecast.com/episodes/performance-engineering-on-hard-mode-with-andrew-hunter-fxhCMIkB>
[Redeveloping TCP from the ground up]
<https://hannes.robur.coop/Posts/TCP-ns>
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:[email protected]>
[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/>