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: 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: 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://dkml.gitlab.io/build-tools/MlFront/MlFront_ZipFile/MlFront_ZipFile/index.html] [https://gitlab.com/dkml/build-tools/MlFront/-/releases/2.3.0-8] MlFront_Cache - Transient caches + slowly varying data ══════════════════════════════════════════════════════ Archive: 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: 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] New lesson on polymorphic variants ══════════════════════════════════ Archive: 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: • 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] The OBazl Toolsuite 3.0.0.beta.1 ════════════════════════════════ Archive: 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] [The OBazl Book] [OBazl Guide] [`rules_ocaml' Reference Manual] [discord] [@obazl.bsky.social] Dune dev meeting ════════════════ Archive: 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] [zoom] [google calendar] [dune wiki on GitHub] 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] [Why F#?] [ FOSDEM 2025: Report from the Friendly Functional Languages BOF Room] [Pushing the opam-repository into a sustainable repository] [μTCP, Miou and unikernels] 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] [the archive] [RSS feed of the archives] [caml-list] [Alan Schmitt]