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 December 05 to 12,
2023.
Table of Contents
─────────────────
Ecosystem Wishlist Survey
OUPS meetup december 2023
Js_of_ocaml 5.2
containers 3.13
Melange 2.0
OCaml 5.1.1 released
DkML 2.1.0 - Major changes
Call for Participation: BOB 2024 (Berlin, March 15)
ocaml-protoc 3.0
Other OCaml News
Old CWN
Ecosystem Wishlist Survey
═════════════════════════
Archive:
<https://discuss.ocaml.org/t/ecosystem-wishlist-survey/13578/1>
Sabine Schmaltz announced
─────────────────────────
Hey OCaml folks,
I am running a little OCaml Ecosystem Wishlist survey where you can
put in really specific wishes for
• new packages,
• package improvements,
• compiler / tooling / language changes
I’m really curious what you all need and I think this will be helpful
to better understand the current state of the ecosystem.
The survey will stay open at least into January, probably much longer.
Put those wishes in! 🎄🐫🔥🔥
<https://docs.google.com/forms/d/e/1FAIpQLSdVGjO3g9qS31rXy3SE-PxcG6Aki652jiqxzfM2lb7kVh5UHg/viewform?usp=sf_link>
OUPS meetup december 2023
═════════════════════════
Archive:
<https://discuss.ocaml.org/t/oups-meetup-december-2023/13580/1>
zapashcanon announced
─────────────────────
The next OUPS meetup will take place on *Thursday, 14th of December*
2023. It will start at *7pm* at the *4 place Jussieu* in Paris.
:warning: :trumpet: It will be in the in the *Esclangon building*
(amphi TBA). :trumpet: :warning:
Please, *[register on meetup ]* as soon as possible to let us know how
many pizza we should order.
For more details, you may check the [OUPS’ website ].
This month will feature the following talks :
*Miou, un simple scheduler pour OCaml 5 – Romain Calascibetta
(@dinosaure)*
Miou est un scheduler pour OCaml 5 utilisant les effets nouvellement
introduit. Il se concentre sur la disponibilité d’une application au
travers d’une politique de gestion des tâches bien décrite. Cette
présentation introduira les effets avec OCaml 5 ainsi qu’une
rétrospective de son API. Il s’agira ensuite de présenter les
spécifités de Miou par rapport aux autres schedulers. Enfin, il y aura
la présentation d’un client/serveur HTTP développé selon le design de
Miou. La présentation permettra de faire un état des lieux du
scheduling en OCaml, des raisons de la multiplicité des solutions
ainsi que des objectifs concrets de Miou (implémentation de services,
disponibilités des applications, unikernels).
*Towards a solution to the expression problem for compilers: strongly
typed nano-passes – Boris Yakobowski*
We present a new solution to the problem of (strongly) typing compiler
passes when the source and destination language share multiple
constructors. We are interested in approaches that limit the amount of
boilerplate that needs to be (re)written for each language, while
still maintaining a very strict typing discipline. Our solution uses
well-known tools, but combine them in a novel way:
• the idea of nanopasses, in which each pass encodes a very limited
transformation
• the use of ppx syntax extensions to express only the differences
between a language and the next
• the traversal of the AST using top-down and bottom-up recursion
schemes
• OCaml polymorphic variants, which are instrumental to precisely type
our (non-recursive) transformation functions.
We present our implementation of this approach in the context of the
Ada frontend for the Infer analyzer, which as of today contains 28
passes. We will also discuss the various pitfalls we have encountered
along the way, as well as possible improvements (in particular
deforesting the combination of multiple passes).
[register on meetup ]
<https://www.meetup.com/fr-FR/ocaml-paris/events/297791037>
[OUPS’ website ] <https://oups.frama.io>
Js_of_ocaml 5.2
═══════════════
Archive: <https://discuss.ocaml.org/t/ann-js-of-ocaml-5-2/13581/1>
Hhugo announced
───────────────
I’m pleased to announce the release of js_of_ocaml 5.2. It should soon
be able available in opam.
Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes
it possible to run pure OCaml programs in JavaScript environment like
browsers and Node.js.
Most significant changes:
• Improve support for modern javascript
• New global dead code elimination pass. Jsoo can now drop unused code
inside functors. See the [pull request] for more details
• Change strategy used for control flow compilation. It was adapted
from wasm_of_ocaml and based on the following paper
<https://dl.acm.org/doi/abs/10.1145/3547621>.
See the [Changelog ] for other changes.
[pull request] <https://github.com/ocsigen/js_of_ocaml/pull/1503>
[Changelog ]
<https://github.com/ocsigen/js_of_ocaml/blob/master/CHANGES.md>
containers 3.13
═══════════════
Archive: <https://discuss.ocaml.org/t/ann-containers-3-13/13582/1>
Simon Cruanes announced
───────────────────────
Hello, I just released [containers 3.13] on opam.
This release is somewhat more breaking than usual:
• OCaml 4.08 is now the minimum OCaml version.
• `CCShims_' (which was used to provide a shim for `Stdlib' pre-4.08)
is removed
• `containers-thread', which was deprecated, is no more. The
recommended alternative is [Moonpool].
On OCaml 5.1 and above, tail-rec-mod-cons is used to simplify and
accelerate some functions in `CCList'.
Happy hacking!
[containers 3.13]
<https://github.com/c-cube/ocaml-containers/releases/tag/v3.13>
[Moonpool] <https://github.com/c-cube/moonpool/>
Melange 2.0
═══════════
Archive: <https://discuss.ocaml.org/t/ann-melange-2-0/13073/3>
Antonio Nuno Monteiro announced
───────────────────────────────
Melange 2.2 is now out with support for OCaml 5.1.1.
OCaml 5.1.1 released
════════════════════
Archive: <https://discuss.ocaml.org/t/ocaml-5-1-1-released/13592/1>
octachron announced
───────────────────
In the last three months after the release of OCaml 5.1.0, three
significant regressions have been discovered in OCaml 5.1.0. Those
regressions concern 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 published a patch release, OCaml 5.1.1, fixing those
issues.
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 has been taken because supporting zstd compression in
the standard library made zstd a dependency of all OCaml executables.
Since the compiler should not propagate its dependencies on end-users,
the support for compressed marshalling has been moved to a compiler
internal library in 5.1.1.
Accounting for the still experimental nature of the multicore runtime,
this patch release 5.1.1 also contains safe fixes for subtle
concurrency bugs in the OCaml runtime.
In brief, if you were using OCaml 5.1.0, I strongly recommend that you
switch to 5.1.1 .
The full list of changes is available below for more details.
Installation Instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
The base compiler can be installed as an opam switch with the
following commands:
┌────
│ opam update
│ opam switch create 5.1.1
└────
The source code for the release is also directly available on:
• [GitHub]
• [Inria archive]
[GitHub] <https://github.com/ocaml/ocaml/archive/5.1.1.tar.gz>
[Inria archive]
<https://caml.inria.fr/pub/distrib/ocaml-5.1/ocaml-5.1.1.tar.gz>
Changes in OCaml 5.1.1 (8 December 2023)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
◊ Standard Library
• (*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>
◊ Bug Fixes
• [#12623], fix the computation of variance composition (Florian
Angeletti, report by Vesa Karvonen, review by Gabriel Scherer)
• [#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)
• [#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)
• [#12757]: Fix ocamlnat (native toplevel) by registering frametables
correctly (Stephen Dolan, Nick Barnes and Mark Shinwell, review by
Vincent Laviron and Sébastien Hinderer)
• [#12791]: `extern' is applied to definitions of `caml_builtin_cprim'
and `caml_names_of_builtin_cprim' when linking bytecode ’-custom’
executables with a C++ linker. (Shayne Fletcher, review by Antonin
Décimo and Xavier Leroy)
[#12623] <https://github.com/ocaml/ocaml/issues/12623>
[#12581] <https://github.com/ocaml/ocaml/issues/12581>
[#12609] <https://github.com/ocaml/ocaml/issues/12609>
[#12645] <https://github.com/ocaml/ocaml/issues/12645>
[#12649] <https://github.com/ocaml/ocaml/issues/12649>
[#12757] <https://github.com/ocaml/ocaml/issues/12757>
[#12791] <https://github.com/ocaml/ocaml/issues/12791>
◊ GC Performance Regression Fixes
• [#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)
• [#12590], [#12595]: Move `caml_collect_gc_stats_sample' in
`caml_empty_minor_heap_promote' before barrier arrival. (B.
Szilvasy, review by Gabriel Scherer)
• [#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, review by Gabriel Scherer and Fabrice
Buoro)
[#12318] <https://github.com/ocaml/ocaml/issues/12318>
[#12439] <https://github.com/ocaml/ocaml/issues/12439>
[#12590] <https://github.com/ocaml/ocaml/issues/12590>
[#12595] <https://github.com/ocaml/ocaml/issues/12595>
[#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>
◊ Runtime Bug Fixes
• [#11800], [#12707]: fix an assertion race condition in
`install_backup_thread' (Jan Midtgaard, review by Gabriel Scherer)
• [#12486], [#12535]: Fix delivery of unhandled effect exceptions on
amd64 with –enable-frame-pointers (Miod Vallat, report by Jan
Midtgaard, review by Gabriel Scherer)
• [#12712], [#12742]: fix an assertion boundary case in
`caml_reset_young_limit' (Jan Midtgaard, review by Guillaume
Munch-Maccagnoni)
• [#12713], [#12715]: disable common subexpression elimination for
atomic loads (Gabriel Scherer and Vincent Laviron, review by Vincent
Laviron, KC Sivaramakrishnan and Xavier Leroy, report by Vesa
Karvonen and Carine Morel)
[#11800] <https://github.com/ocaml/ocaml/issues/11800>
[#12707] <https://github.com/ocaml/ocaml/issues/12707>
[#12486] <https://github.com/ocaml/ocaml/issues/12486>
[#12535] <https://github.com/ocaml/ocaml/issues/12535>
[#12712] <https://github.com/ocaml/ocaml/issues/12712>
[#12742] <https://github.com/ocaml/ocaml/issues/12742>
[#12713] <https://github.com/ocaml/ocaml/issues/12713>
[#12715] <https://github.com/ocaml/ocaml/issues/12715>
DkML 2.1.0 - Major changes
══════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-dkml-2-1-0-major-changes/13593/1>
jbeckford announced
───────────────────
I’m pleased to announce a major overhaul of DkML in version 2.1.0.
Some of the major changes include:
• `winget install dkml' is the recommended way to install.
• Installation is now in stages. The first stage (`winget install
dkml') takes 5 minutes and lets the end-user do `utop', `ocamlc' and
`ocamlrun' (sufficient for learning). However, any command that need
Visual Studio (ex. `opam', `dkml') will first:
• guide you if you need Git and/or Visual Studio (`winget' does not
support auto-installing dependencies like other /sane/ package
managers), and then
• install the OCaml system compiler, the opam root and a playground
global switch automatically on first run
• Alpha support for macOS/Silicon and most modern distros of GNU/Linux
• Has an accompanying video describing how to install and use DkML on
Windows targeted to both learners and professionals. Includes Visual
Studio Code and LSP:
Call for Participation: BOB 2024 (Berlin, March 15)
═══════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/call-for-participation-bob-2024-berlin-march-15/13609/1>
Michael Sperber announced
─────────────────────────
More info at <https://bobkonf.de/2024/>!
┌────
│ =========================================================================
│ BOB 2024
│ Conference
│ “What happens if we simply use what’s best?”
│ March 15, 2024, Berlin
│ https://bobkonf.de/2024/
│
│ Program: https://bobkonf.de/2024/program.html
│ Registration: https://bobkonf.de/2024/registration.html
│ =========================================================================
│
│ BOB conference is a place for developers, architects, and decision-makers
│ to explore technologies beyond the mainstream in software development
│ and to find the best tools available to software developers today. Our
│ goal is for all participants of BOB to return home with new insights
│ that enable them to improve their own software development
│ experience.
│
│ The program features 14 talks and 8 tutorials on current topics:
│
│ https://bobkonf.de/2024/program.html
│
│ Talk subjects includes functional programming, property-based testing,
│ service API design, programming for spacecraft, accessibility,
│ hypermedia, business processes, software analytics, event-based
│ communication and zero-knowledge proofs.
│
│ BOB will feature tutorials on F#, Haskell, Lean, SwiftUI, Copilot, the
│ K Framework, functional domain modelling, and Liberating Structures.
│
│ Andreas Rossberg will give the keynote talk.
│
│ Registration is open - online tickets are all under 200€, and many
│ discount options are available, as are grants for members of groups
│ underrepresented in tech:
│
│ https://bobkonf.de/2024/registration.html
└────
ocaml-protoc 3.0
════════════════
Archive: <https://discuss.ocaml.org/t/ann-ocaml-protoc-3-0/13611/1>
Simon Cruanes announced
───────────────────────
Dear camlidae,
I’m happy to announce the release of [ocaml-protoc 3.0] (alongside the
multiple runtime libraries: `pbrt', `pbrt_yojson', and the new
`pbrt_services'). This is a majorly breaking release, I’m sorry for
that (I do, however, believe it necessary) and recommend every user of
ocaml-protoc add an upper bound `< 3.0' to their current project and
migrate when they have time.
First, a summary. `ocaml-protoc' is a self-contained compiler that
turns [protobuf] IDL files (`.proto' files) into OCaml types,
pretty-printers, and (de)serialization functions. The runtime library
`pbrt' (“protobuf runtime”) contains support code for printers and
binary (de)serialization; `pbrt_yojson' contains support code for JSON
(de)serialization by way of `yojson'.
So what changed with ocaml-protoc 3.0? Many things.
For a start, from one `.proto' file we now generate one pair of `.ml'
and `.mli' files instead of several pairs. This reduces the
boilerplate in build systems and simplifies user code overall (one
module per `.proto' file). A large internal refactor of `ocaml-protoc'
was done prior to the integration of… _services_.
The major new feature of `ocaml-protoc' 3.0 is the support for service
declarations. These are essentially [a way] to describe RPC endpoints,
next to the types used to interact with the endpoint ([example]; [full
generated code]). This is typically what it used in systems such as
[gRPC]. Now `ocaml-protoc' generates server and client stubs for each
endpoint, that pack together the type definitions and the relevant
(de)serializers; that code doesn’t presume anything about a concrete
RPC system. I have in the works a simple [Twirp] [OCaml library] that
relies on this generated code to provide services over HTTP 1.1; It is
also possible to write RPC systems over ZMQ, websockets, etc. without
changes to the generated code[^1].
[^1]: note that twirp doesn’t support stream RPC over HTTP 1.1. Other
RPC systems can support these, e.g. gRPC does.
Another big-ish change is how the generated code looks like, at least
when it comes to binary (de)serialization. `ocaml-protoc' 3.0 comes
with significant speedups for encoding (up to twice the throughput;
order of magnitude reduction in allocations in some cases [^2]) and
some less impressive speedups for decoding. This is a combination of
multiple changes:
• use of a few C stubs to accelerate varint decoding/encoding;
• encoding is done back-to-front, which allows the encoder to use a
single slice internally[^3]. This is what required changes in the
generated code in the first place;
• encoding code now requires a lot fewer closures (passing arguments
explicitly instead) which reduces allocations to almost nothing.
I haven’t recently benchmarked against other protobuf implementations
in OCaml, but I’m reasonably confident that this is now the fastest
one by a healthy margin.
There are also other improvements and bugfixes. I want to thank in
particular [@Konstantin_Olkhovski] for some of these contributions and
for very helpful discussions, and also @VPhantom for more discussions
on the topic of performance.
[^2]: if the encoder type is reused, there’s almost no minor
allocations, and no major allocations, to encode an existing value
into the encoder’s buffer.
[^3]: because sub-messages use varint as their sizes, encoding
front-to-back cannot be efficiently done in a single buffer, because
it’s not clear how many bytes to reserve in front of a sub-message.
With back-to-front that’s not an issue.
The [changelog] contains many more details.
[ocaml-protoc 3.0]
<https://github.com/mransan/ocaml-protoc/releases/tag/v3.0.0>
[protobuf] <https://protobuf.dev/>
[a way] <https://protobuf.dev/programming-guides/proto3/#services>
[example]
<https://github.com/mransan/ocaml-protoc/blob/master/src/examples/file_server.proto>
[full generated code]
<https://gist.github.com/c-cube/c76fecafeedf426c353e487c2e471354>
[gRPC] <https://grpc.io>
[Twirp] <https://github.com/twitchtv/twirp>
[OCaml library] <https://github.com/c-cube/ocaml-twirp>
[@Konstantin_Olkhovski] <https://github.com/lupus>
[changelog]
<https://github.com/mransan/ocaml-protoc/releases/tag/v3.0.0>
Other OCaml News
════════════════
From the ocaml.org blog
───────────────────────
• [Florian compiler weekly, 11 December 2023]
• [International Disability Day 2023: Why It Matters]
[Florian compiler weekly, 11 December 2023]
<https://gallium.inria.fr/blog/florian-cw-2023-12-11>
[International Disability Day 2023: Why It Matters]
<https://tarides.com/blog/2023-12-05-international-disability-day-2023-why-it-matters>
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/>