OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of July 02 to 09, 2024.

Table of Contents

The Structure of Godotcaml as of Today, by Matt Walker [Fizzixnerd]

Matt Walker announced

Fixed some bugs in the Godot OCaml bindings I'm working on. Here is a blog post that could be of interest if you're looking to dive into them, or using Ctypes in another project, or are writing Godot bindings for another language, or just have some time to kill. :smiley:

https://fizzixnerd.com/blog/2024-07-02-the-structure-of-godotcaml-as-of-today/

opam 2.2.0 is out!

Kate announced

We’re very happy to finally announce the release of opam 2.2.0.

What’s new?

  • Windows support :window: :tada: (you can hear all about it in the blog post)
  • opam tree / opam why: new commands showing a tree view of the given packages and their dependencies and reverse-dependencies, respectively.
  • with-dev-setup: a new variable and argument to install the recommend developement setup for a local project.
  • opam pin --recursive and --subpath to have opam look at opam files elsewhere than the root directory of a project.
  • opam switch - to go back to the previous global switch (inspired by git switch -)
  • opam pin --current fixes a package to its current state (disabling pending reinstallations or removals from the repository)
  • opam pin remove --all removes all the pinned packages from a switch
  • opam exec --no-switch removes the opam environment when running a command. It is useful when you want to launch a command without opam environment changes.
  • opam clean --untracked removes untracked files interactively remaining from previous packages removal.
  • opam admin add-constraint <cst> --packages pkg1,pkg2,pkg3 applies the given constraint to a given set of packages
  • opam list --base has been renamed into --invariant, reflecting the fact that since opam 2.1 the "base" packages of a switch are instead expressed using a switch invariant
  • opam install --formula <formula> installs a formula instead of a list of packages. This can be useful if you would like to install one package or another one. For example opam install --formula '"extlib" | "extlib-compat"' will install either extlib or extlib-compat depending on what's best for the current switch.
  • and many other features, performance improvements and fixes

:open_book: You can read our blog post for more information about these changes and a lot more.

How to upgrade

In case you plan a possible rollback, you may want to first backup your

~/.opam or $env:LOCALAPPDATA\opam directory.

The upgrade instructions are unchanged:

For Unix systems

bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.2.0"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1) }"

or download manually from the Github "Releases" page to your PATH.

You should then run:

opam init --reinit -ni

OCaml.org Newsletter: June 2024

Sabine Schmaltz announced

Welcome to the June 2024 edition of the OCaml.org newsletter! This update has been compiled by the OCaml.org team. You can find previous updates on Discuss.

Our goal is to make OCaml.org the best resource for anyone who wants to get started and be productive in OCaml. The OCaml.org newsletter provides an update on our progress towards that goal and an overview of the changes we are working on.

We couldn't do it without all the amazing people who help us review, revise, and create better OCaml documentation and work on issues. Your participation enables us to so much more than we could just by ourselves. Thank you!

This newsletter covers:

  • Recipes for the OCaml Cookbook: Help us make the OCaml Cookbook really useful by contributing and reviewing recipes for common tasks!
  • Community & Marketing Pages Rework: Implementation work in progress.
  • General Improvements: As usual, we also worked on general maintenance and improvements, so we're highlighting some of the work that happened below.

Open Issues for Contributors

Recipes for the OCaml Cookbook

The OCaml Cookbook is a place where OCaml developers share how to solve common tasks using packages from the ecosystem.

A recipe is a code sample and explanations on how to perform a task using a combination of open-source libraries.

The Cookbook is live at ocaml.org/cookbook.

Here's how you can help:

  1. Review, then open pull requests for cookbook recipes!
  2. Contribute new recipes and tasks for the cookbook!

Relevant PRs and Activities:

Community & Marketing Pages Rework

We have UI designs for the reworked and new pages of the community section, and implementation is in progress.

Relevant PRs and Activities:

General Improvements and Data Additions

Summary:

Relevant PRs and Activities:

ocaml-libbpf: Libbpf C-bindings for OCaml

Lee Koon Wen announced

I'm excited to announce the first release of ocaml-libbpf, a new library providing OCaml bindings for libbpf, the essential C library for working with eBPF programs. This library allows you to load, initialize, link, and manage eBPF programs within OCaml, simplifying the process of working with these powerful in-kernel applications.

opam install libbpf

Key Features:

  • High-level and Low-level APIs: Access both raw bindings and user-friendly high-level functions for eBPF management.
  • Seamless Integration: Load eBPF ELF files into the kernel with ease.
  • BPF Map Support: Manage BPF maps for communication between user space and kernel space.

For more information, visit the ocaml-libbpf repo. Contributions and feedback are welcome!

Enjoy!

How I built the Acutis template language in OCaml

John announced

Acutis is a personal project I've been developing on-and-off over the last few years. It's a template language (similar to Mustache, Nunjucks, etc.) that has a static type system, uses pattern-matching, and can compile templates into JavaScript files. I'm sharing it now because it's reached a somewhat-stable state.

You can view its home page here and its source code here. I also wrote a blog-style article that explains how I created Acutis, the problems I faced, and the decisions I made. You can read it here: "The Acutis template language, or: how I over-engineered a program that just prints text".

I don't especially expect people to use Acutis much, since it's very personal and based around my specific use cases. (Also, we have an overabundance of template languages already anyway.) Nonetheless, building it was a fun and rewarding learning experience for me. Perhaps some people will find it as interesting as I did. 🙂

MirageOS podcast

Hannes Mehnert announced

I recently was interviewed by Matthias Kirschner from FSFE about MirageOS (+ OCaml). The result is a podcast https://fsfe.org/news/podcast/episode-25.en.html

Spread the word, have a listen, and please don't hesitate to give feedback - via email or in this thread.

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.