OCaml Weekly News
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 bygit 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 switchopam 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 packagesopam 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 invariantopam 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 exampleopam install --formula '"extlib" | "extlib-compat"'
will install eitherextlib
orextlib-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
You can find open issues for contributors here!
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:
- Review, then open pull requests for cookbook recipes!
- Contribute new recipes and tasks for the cookbook!
Relevant PRs and Activities:
- (open) PR: Cookbook Extract Links From HTML ocaml/ocaml.org#2552 by @ggsmith842
- (open) PR: Cookbook Measures of Central Tendency ocaml/ocaml.org#2540 by @ggsmith842
- (open) PR: Cookbook Send a POST/PATCH Request w/ Authentication ocaml/ocaml.org#2534
- PR: Cookbook Normalise Vector ocaml/ocaml.org#2513 by @ggsmith842
- PR: (docs) Cookbook "Validate an Email Address" With
re
ocaml/ocaml.org#2518 by @ggsmith842
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:
- PR: Events feed ocaml/ocaml.org#2495 by @ishar19
- (open) PR: OCaml In Numbers: A dashboard with key metrics and statistics about the OCaml community ocaml/ocaml.org#2514 by @tmattio
- PR: Add fields professor, enrollment, and
last_check
to Academic ocaml/ocaml.org#2489 by @cuihtlauac - PR: Fix: render full title of OCaml Cookbook recipe as HTML page title ocaml/ocaml.org#2560 by @sabine
General Improvements and Data Additions
Summary:
- To reduce repetition of the module interface definitions relating to
ood-gen
(the tool that turns the files in thedata/
folder into OCaml modules), types have been factored out. This hopefully makes it simpler to contribute to changes to the data models. - Materials for some of the tutorials have been published under the https://github.com/ocaml-web GitHub organisation: “Your First OCaml Program”, “Modules”, “Functors”, and “Libraries With Dune”.
- The OCamlFormat version used to format the project is now 0.26.2.
Relevant PRs and Activities:
- PR: Update code highlighting color scheme ocaml/ocaml.org#2496 by @Siddhant-K-code
- Data
- PR: (data) Add OCaml.org newsletter May 2024 ocaml/ocaml.org#2498 by @sabine
- PR: Add changelog entry for Merlin
4.15-414/501
ocaml/ocaml.org#2473 by @voodoos - PR: Add the announement for opam 2.2.0~beta3 ocaml/ocaml.org#2509 by @kit-ty-kate
- PR: Add missing changelog entries ocaml/ocaml.org#2476 by @tmattio
- PR: Add changelog entry for
ppxlib.0.32.1
release ocaml/ocaml.org#2479 by @NathanReb - PR: (data) add
odoc
dev meeting to governance ocaml/ocaml.org#2521 by @sabine - PR: (data) Update meeting link and frequency in governance for OCaml.org ocaml/ocaml.org#2542 by @sabine
- Documentation:
- PR: Prerequisites for Libraries With Dune ocaml/ocaml.org#2551 by @cuihtlauac
- Added repositories holding materials for some of the tutorials at https://github.com/ocalm-web
- PR:~ocaml-web~ repo link ocaml/ocaml.org#2547 by @cuihtlauac
- PR: Prerequisites and
ocaml-web
repo link ocaml/ocaml.org#2544 by @cuihtlauac - PR: Prerequisites and
ocaml-web
repo link ocaml/ocaml.org#2543 by @cuihtlauac - PR: Fix typo in
0it_00_values_functions.md
ocaml/ocaml.org#2548 by @boisgera - PR:
ocaml-web
tutorial material URLs ocaml/ocaml.org#2550 by @cuihtlauac
- PR: In "Modules" tutorial: Fix
dune
files ocaml/ocaml.org#2535 by @cuihtlauac - PR: Fix typo in "Tour of OCaml" ocaml/ocaml.org#2519 by @blackwindforce
- PR: Clarification on pattern matching and definitions ocaml/ocaml.org#2500 by @cuihtlauac
- Refactoring / Code health:
- Factor out types on
ood-gen
tool that parses the files in thedata/
folder:- PR: Single data type definition for Outreachy ocaml/ocaml.org#2481 by @cuihtlauac
- PR: Single data type definition for Resource ocaml/ocaml.org#2533 by @cuihtlauac
- PR: Single data type defintion for Success_story ocaml/ocaml.org#2536 by @cuihtlauac
- PR: Single data type defintion for Tool ocaml/ocaml.org#2538 by @cuihtlauac
- PR: Single type for Tool_page ocaml/ocaml.org#2539 by @cuihtlauac
- PR: Single type for Book ocaml/ocaml.org#2488 by @cuihtlauac
- PR: Single data type definition for Exercise ocaml/ocaml.org#2497 by @cuihtlauac
- PR: Single data type definitions for Planet ocaml/ocaml.org#2529 by @cuihtlauac
- PR: Single data type definition for Release ocaml/ocaml.org#2531 by @cuihtlauac
- PR: Single data type definition for Changelog ocaml/ocaml.org#2492 by @cuihtlauac
- PR: Single data type definition for Cookbook ocaml/ocaml.org#2490 by @cuihtlauac
- PR: Single data type definition for Governance ocaml/ocaml.org#2504 by @cuihtlauac
- PR: Single data type definitions for Tutorial ocaml/ocaml.org#2555 by @cuihtlauac
- PR: Single data type definition for Event ocaml/ocaml.org#2559 by @cuihtlauac
- PR: Single data type definition for Industrial_user ocaml/ocaml.org#2505 by @cuihtlauac
- PR: Single type for Is_ocaml_yet ocaml/ocaml.org#2508 by @cuihtlauac
- PR: Single type definition for Job ocaml/ocaml.org#2516 by @cuihtlauac
- PR: Single data type definition for News ocaml/ocaml.org#2520 by @cuihtlauac
- PR: Single data type defintion for opam_user ocaml/ocaml.org#2522 by @cuihtlauac
- PR: Single data type definition for Workshop ocaml/ocaml.org#2541 by @cuihtlauac
- PR: Single data type defintion for Watch ocaml/ocaml.org#2545 by @cuihtlauac
- PR: Single data type definition for Page ocaml/ocaml.org#2524 by @cuihtlauac
- PR: Single data type definition for Paper ocaml/ocaml.org#2526 by @cuihtlauac
- PR: Single data type definition for Academic_Institution ocaml/ocaml.org#2477 by @cuihtlauac
- PR: Single data type definition for Code_examples ocaml/ocaml.org#2501 by @cuihtlauac
- PR: Remove redundant data type Watch ocaml/ocaml.org#2507 by @cuihtlauac
- Increase OCamlFormat version used to format the project from 0.25.1 to 0.26.2
- PR: Bringup OCamlFormat ocaml/ocaml.org#2482 by @cuihtlauac
- PR: Formatting ocaml/ocaml.org#2484 by @cuihtlauac
- PR: Add information on switch pin update ocaml/ocaml.org#2483 by @cuihtlauac
- PR: Bringup OCamlFormat in CI ocaml/ocaml.org#2485 by @cuihtlauac
- PR: Add information on switch pin update, cont'd ocaml/ocaml.org#2486 by @cuihtlauac
- PR: Rename Utils
map_files
intomap_md_files
ocaml/ocaml.org#2515 by @cuihtlauac - PR: Remove unused Video data ocaml/ocaml.org#2506 by @cuihtlauac
- PR: Remove unused
ood/video
files ocaml/ocaml.org#2546 by @cuihtlauac
- Factor out types on
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.