OCaml Weekly News

Previous Week Up Next Week

Hello

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

Table of Contents

OCaml Tech Talk | Editor Features

Continuing this thread, PizieDust announced

The video is now uploaded on YouTube at: Ocaml | Editor Features

New release of Ocsipersist

Vincent Balat announced

Ocsipersist has been recently updated.

Ocsipersist is an OCaml interface for key-value stores, with three implementations based on SQLite, DBM and PostgreSQL.

It proposes several interfaces: basic string to string tables, typed tables with custom (de)serialisation functions, persistent variables …

This new version 2.0.0, adds the following features:

  • some dependencies removed
  • Basic interface for persistent references, in the style of Eliom's scoped references (but without scope)

Example of use of persistent references from the toplevel, with the sqlite backend:

# #require "lwt_ppx";;
(* #thread;; if you are using OCaml < 5.0.0 *)
# #require "ocsipersist-sqlite";;
# Ocsipersist.init ();;
# let r = Ocsipersist.Ref.ref ~persistent:"r" 444;;
val r : int Ocsipersist.Ref.t = <abstr>
# Lwt_main.run (let%lwt v = Ocsipersist.Ref.get r in print_int v; Lwt.return_unit);;
444- : unit = ()

Backends: Choose the backend you prefer by using packages ocsipersist-sqlite, ocsipersist-dbm or ocsipersist-postgresql.

Configuration:

  • Use module Ocsipersist_settings, provided by each backend to configure the database
  • Opam packages ocsipersist-sqlite-config, ocsipersist-dbm-config or ocsipersist-postgresql-config make it possible to configure the backend from Ocsigen Server's config file (breaking change: this was provided by ocsipersist-sqlite, ocsipersist-dbm or ocsipersist-postgresql before. You'll need to update your configuration files).

Preview of Godotcaml for the Godot 4.2 Game Engine

Matt Walker announced

I've released a small preview of a project I've been working on. It's bindings to the Godot 4.2 game engine from OCaml.

To keep this announcement short, I've posted a longer explanation on my blog:

https://fizzixnerd.com/blog/2024-06-24-announcing-godotcaml/

Here is the git repo:

https://github.com/Fizzixnerd/godotcaml

Here is another short blog post explaining how to get up and started with it:

https://fizzixnerd.com/blog/2024-06-28-godotcaml-basic-setup/

Do not expect much, I've basically just reached the point where Godot and OCaml can call each other. I just thought people might think it's cool! Open issues or discuss in this thread if you'd like; another blog post will be forthcoming covering the current structure of the code if there seems to be interest.

euler 0.3

glen announced

It is my pleasure to announce the release of Euler version 0.3. :slight_smile:

Euler is an arithmetic library for OCaml integers. For more details, please read the repo​’s README or browse the docs.

In version 0.3:

  • some amount of optimization (:magic_wand: magic tricks to compute logarithms, see source code of log2sup and logsup);
  • new functions (for instance: root extraction, multiplicative order);
  • Arith.gcdext now returns minimal coefficients and avoids overflows (which was not trivial);
  • factorization now performs some steps of Fermat’s factor searching, which I think closes the gap with Owl (mentioning this because @struktured had asked me how Euler compared with Owl, and Fermat’s algorithm was the only integer arithmetic operation that I found in Owl not provided by Euler).

The full list of changes is found in the changelog, in the repo.

Happy factorizing!

(This is a new topic because I cannot edit the initial one.)

dune 3.15

Etienne Millon announced

We've released 3.15.3 (some time ago already) with the following changes:

3.15.3 (2024-05-24)

Fixed

  • Fix interpretation of exists_if predicate in META files of installed libraries containing more than one element. (#10564, fixes #10563, @dbuenzli, @nojb)
  • Fix TSAN warning in wait4 stubs (#10554, fixes #10553, @emillon)

dune 3.16

Etienne Millon announced

We're happy to announce the release of Dune 3.16.0.

Among the list of chances, this release contains improvements to melange support and a way to look for references in a whole project using merlin and ocaml-lsp.

3.16.0 (2024-06-17)

Added

  • allow libraries with the same (name ..) in projects as long as they don't conflict during resolution (via enabled_if). (#10307, @anmonteiro, @jchavarri)
  • dune describe pp now finds the exact module and the stanza it belongs to, instead of guessing the name of the preprocessed file. (#10321, @anmonteiro)
  • Print the result of dune describe pp with the respective dialect printer. (#10322, @anmonteiro)
  • Add new flag --context to dune ocaml-merlin, which allows to select a Dune context when requesting Merlin config. Add dune describe contexts subcommand. Introduce a field generate_merlin_rules for contexts declared in the workspace, that allows to optionally produce Merlin rules for other contexts besides the one selected for Merlin (#10324, @jchavarri)
  • melange: add include paths for private library .cmj files during JS emission. (#10416, @anmonteiro)
  • dune ocaml-merlin: communicate additional directives SOURCE_ROOT, UNIT_NAME (the actual name with wrapping) and INDEX with the paths to the index(es). (#10422, @voodoos)
  • Add a new alias @ocaml-index that uses the ocaml-index binary to generate indexes that can be read by tools such as Merlin to provide project-wide references search. (#10422, @voodoos)
  • merlin: add optional (merlin_reader CMD) construct to (dialect) stanza to configure a merlin reader (#8567, @andreypopp)

Changed

  • melange: treat private libraries with (package ..) as public libraries, fixing an issue where import paths were wrongly emitted. (#10415, @anmonteiro)
  • install .glob files for Coq theories too (#10602, @ejgallego)

Fixed

  • Don't try to document non-existent libraries in doc-new target (#10319, fixes #10056, @jonludlam)
  • Make dune-site's load_all function look for META files so that it doesn't fail on empty directories in the plugin directory (#10458, fixes #10457, @shym)
  • Fix incorrect warning for libraries defined inside non-existant directories using (subdir ..) and used by executables using dune-build-info (#10525, @rgrinberg)
  • Don't try to take build lock when running coq top --no-build (#10547, fixes #7671, @lzy0505)
  • Make sure to truncate dune's lock file after locking and unlocking so that users cannot observe incorrect pid's (#10575, @rgrinberg)
  • mdx: link mdx binary with byte_complete. This fixes (libraries) with foreign archives on Linux. (#10586, fixes #10582, @anmonteiro)
  • virtual libraries: fix an issue where linking an executable involving several virtual libries would cause an error. (#10581, fixes #10460, @rgrinberg)

Other OCaml News

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.