2024-05-14

[Caml-list] Attn: Development Editor, Latest OCaml Weekly News

OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of May 07 to 14, 2024.

Some code for Molecular Mechanics in OCaml

UnixJunkie announced

Recently, I released a bunch of code for some Molecular Mechanics calculations in OCaml.

This is pretty much at the beta stage for the moment.

https://github.com/UnixJunkie/MMO

Maybe in the future I will create a proper library to encapsulate the Mol and Mol2 modules in there; they allow to perform some operations on small molecules.

For those interested, there is a partial implementation of the Universal Force Field (UFF) in there; only the part concerning non-bonded interactions.

OCaml.org Newsletter: April 2024

Sabine Schmaltz announced

Welcome to the April 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:

  • OCaml Cookbook: We shipped a new, community-driven section in the Learn area. Help us make it really useful by contributing and reviewing recipes for common tasks!
  • Community & Marketing Pages Rework: We have UI designs for the reworked and new pages of the community section and are starting work to implement these.
  • 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!

Here's some new (and as of time of writing this newsletter still open) issues that were opened this month:

The OCaml Cookbook

We shipped a new, community-driven section in the Learn area: the OCaml Cookbook!

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

A task is something that needs to be done inside a project. A recipe is a code sample and explanations on how to perform a task using a combination of open source libraries.

The Cookbook now live at ocaml.org/cookbook, but there are not a lot of recipes published yet.

Here's how we need your help:

  1. Help review open pull requests for cookbook recipes!
  2. Contribute new recipes and tasks for the cookbook!
  3. Suggest improvements to existing recipes and the UI.

Relevant PRs and Activities:

Community & Marketing Pages Rework

We have UI designs for the reworked and new pages of the community section and are starting work to implement these. We are opening small issues for contributors to help. :orange_heart:

Relevant PRs and Activities:

General Improvements and Data Additions

Relevant PRs and Activities:

Example of using LSP server in Emacs

Tim McGilchrist announced

I wrote a blog post about my setup https://lambdafoo.com/posts/2022-09-07-ocaml-with-emacs-2022.html The only change I've made is to use envrc-mode rather than direnv-mode.

Dune Developer Experience Feedback Form

ostera announced

The Dune team at Tarides is looking to get inputs from all of you to improve the Dune DX (developer experience), so we've opened a small, anonymous, unstructured feedback form to hear your ideas on how Dune could be improved :camel:

We're looking forward to your ideas! :sparkles:

DkML 2.1.1

jbeckford announced

Use https://ocaml.org/install if you are a first-time user (the install steps haven't changed).

The upgrade steps and release notes are available at https://gitlab.com/dkml/distributions/dkml/-/releases/2.1.1. For those who are on 2.1.0, the upgrade is the following in PowerShell:

  1..6 | % {  @("bash","sh","with-dkml","ocamllsp","git","opam","dune","ocamlrun") | % { taskkill /F /IM "$_.exe" }; Start-Sleep 1 }  winget upgrade dkml  

Major Changes

  • The opam repository is fixed to commit 6c3f73f42890cc19f81eb1dec8023c2cd7b8b5cd for stability. If you need a new version of a package and can't wait for the next version of DkML, you can pin that package's url (recommended) or float the opam repository with opam repository set-url default git+https://github.com/ocaml/opam-repository.git#main.
  • Windows SDK 10.0.22621.0 and VC 17.8 (14.38) added to allowed list. This supports Visual Studio 2022, especially for GitLab CI.
  • New supported package: tiny_httpd

Patches

Package What Issue
base_bigstring.v16.0 Implement memmem for Windows https://github.com/janestreet/base_bigstring/issues/6
core_kernel.v0.16.0 MSVC fix didn't make it to 0.16.0 https://github.com/janestreet/core_kernel/pull/107

Upgraded Packages

Package From To
dune (et al) 3.12.1 3.15.0
ocaml 4.14.0 4.14.2
ocamlformat (et al) 0.25.1 0.26.1
odoc 2.2.0 2.4.1
odoc-parser 2.0.0 2.4.1
lsp (et al) 1.16.2 1.17.0
mdx 2.3.0 2.4.1
ctypes (et al) 0.19.2-windowssupport-r7 0.19.2-windowssupport-r8
tiny_httpd   0.16

Thanks to OCaml Software Foundation for sponsoring DkML!

A May update on wasm_of_ocaml

Jan Midtgaard announced

Spring is over us and several months have passed since we last shared an update on WebAssembly compilation.

Introduction

wasm_of_ocaml is a compiler from OCaml bytecode to WebAssembly, similar to js_of_ocaml from which it was forked. wasm_of_ocaml offers a functional, almost drop-in replacement for js_of_ocaml - with better performance.

For now, the compiler targets a JavaScript-hosted WebAssembly engine. The produced code furthermore requires the following Wasm extensions to run:

Platform support

wasm_of_ocaml news

Since the last update in December

  • Jérôme gave a talk about wasm_of_ocaml at the INRIA Cambium seminar - slides available here
  • Olivier Nicole joined the wasm_of_ocaml effort
  • Jérôme and Olivier visited Jane Street to help them adopt wasm_of_ocaml

Notable features

  • Sourcemap support was added ocaml-wasm/wasm_of_ocaml#27
  • A first implementation of separate compilation was completed ocaml-wasm/wasm_of_ocaml#36
    • One can compile cmo and cma files, producing intermediate archive files
    • Then the files can be linked together: relevant Wasm modules are put in a directory, and JavaScript code is generated to load them and link them together
  • Store long-lived toplevel values into globals ocaml-wasm/wasm_of_ocaml#30
    • The initialization code produced by wasm_of_ocaml can be large and contain a large number of variables. This is challenging to both binaryen tools and the Wasm engines. The problem can be alleviated by storing long-lived toplevel values into global variables. As an side benefit, many closures can be statically allocated (since their free variables are now stored in globals), which again can provide performance improvements in the remaining parts of the code.
  • Tuple syntax changes ocaml-wasm/wasm_of_ocaml#31
    • Prepared the switch to the new version of binaryen, which has small syntax changes
  • Use the JS String Builtins proposal for string conversions when available ocaml-wasm/wasm_of_ocaml#33
  • Improve the WAT (Wasm text format) output to be more readable ocaml-wasm/wasm_of_ocaml#34
    • Name local variables (they were just numbered) and use shorter names (the names used to be systematically suffixed to ensure they were unique).

Other features and fixes

Binaryen fixes

  • PR: wasm-merge: check that the types of imports and exports match. WebAssembly/binaryen#6437
    • Improved binaryen's linker to check that the types of imports and exports match. Found a type mismatch in the wasm_of_ocaml runtime this way.
  • PR: Fixes regarding explicit names WebAssembly/binaryen#6466
    • The name of some module components were lost during module linking
  • PR: Fix writing of data segment names in name section WebAssembly/binaryen#6462
    • Binaryen could actually generate a malformed name section

OCaml 5.2.0 released

octachron announced

The OCaml team has the pleasure of celebrating the birthday of Inge Lehmann by announcing the release of OCaml version 5.2.0.

Some of the highlights in OCaml 5.2.0 are:

  • Re-introduced GC compaction
    GC compaction can now be manually triggered by calling Gc.compact () manually. This is expected to be particularly useful for programs that wish to release memory to the operating system after a temporary memory-intensive phase.
  • Restored native backend for POWER 64 bits
    With this restored backend, all 64 bits architecture supported in OCaml 4 are supported bin OCaml 5
  • Thread sanitizer support
    Thread sanitizer is a dynamic data race detector which instrument memory accesses to detect and explain data races at execution time. Since the instrumentation is costly (with a 2x to 7x slowdown), it must be enabled with the ocaml-option-tsan configuration flag. (The reference manual contains more information on how to use TSAN.)
  • New Dynarray module
    This new standard library module provides a standard implementation for resizeable array, which is guaranteed to be memory safe even in presence of data races.
  • New -H flag for hidden include directories
    This new flag makes it possible for build tools to split cleanly dependencies between direct (the dependencies explicitly added by the project) and indirect dependencies (the dependencies introduced by the direct dependencies) without the quirks of previous implementations.
  • Project-wide occurence metadata support for developer tools
    When compiling a module with the -bin-annot and -bin-annot-occurrences flags, the compiler stores in the .cmt file an index of all occurences of values, types, modules, …
  • Raw identifiers
    To improve OCaml upward-compatibility, there is a new syntax for lowercase identifiers, let \#if = 0, which works even if the identifier is a keyword in some OCaml versions. This change has been adopted in OCaml 5.2 in preparation of the introduction of the effect keyword in OCaml 5.3
  • Local open in type expressions
    Local open are now allowed in type expression: val (+): Int64.(t -> t -> t).

And a lot of incremental changes:

  • Around 20 new functions in the standard library besides the new Dynarray module (in the Array, Float, Format, Fun, In_channel, Out_channel, and Random modules )
  • Many fixes and improvements in the runtime
  • Many bug fixes

OCaml 5.2.0 is still a somewhat experimental release compared to the OCaml 4.14 branch. In particular

  • The Windows MSVC port is still unavailable.
  • Ephemeron performances need to be investigated.
  • statmemprof is being tested in the developer branch of OCaml.
  • There are a number of known runtime concurrency or GC performance bugs (that trigger under rare circumstances).

Since the Windows MSVC port and statmemprof are still missing, the maintenance support for OCaml 4.14 will be extended until at least the end of the year.

Please report any unexpected behaviours on the OCaml issue tracker and post any questions or comments you might have here on discuss.

The full list of changes can be found in the changelog below.

Installation Instructions

The base compiler can be installed as an opam switch with the following commands:

  opam update  opam switch create 5.2.0  

The source code for the release candidate is also directly available on:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

  opam update  opam switch create <switch_name> ocaml-variants.5.1.0+options <option_list>  

where <option_list> is a space separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

  opam switch create 5.2.0+flambda+nffa ocaml-variants.5.2.0+options ocaml-option-flambda ocaml-option-no-flat-float-array  

OCaml 5.2.0 Changelog (13 May 2024)

(Changelog elided to reduce message size. Please follow the archive link above for the full message.)

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.

2024-05-03

[Caml-list] Remainder: OCaml Workshop @ ICFP'24: submission deadline in 1 month

Dear OCaml users,

This is a small remainder that there is one month left until the
submission deadline for the OCaml Workshop colocated with ICFP'24!

We are looking forward to all kind of submissions, be it research-,
user- or community-oriented, and the submission format is quite flexible
(~2 pages long), so don't hesitate to send us your work!

The important dates:
Talk proposal submission deadline: May 30th (Thursday)
Author notification: July 4th (Thursday)
Workshop: September 7th (Saturday)

(See below for the original announcement with further details.)

Cheers,
Your OCaml workshop organizers,
Sonja and Armaël



> This year, ICFP (the International Conference on Functional Programming)
> is going to take place in beautiful Milan.
>
> Such as every year since 2012, on the last day of that conference, i.e.
> on September 7th (Saturday), we'll hold a workshop on OCaml. The
> workshop is intended to cover all different kinds of aspects of the
> OCaml programming language as well as the OCaml ecosystem and its
> community, such as scientific and/or research-oriented, engineering
> and/or user-oriented, as well as social and/or community-oriented.
>
> ## Call for talk proposals
>
> The call for talk proposals for the workshop is open:
>
> https://icfp24.sigplan.org/home/ocaml-2024#Call-for-Papers
>
> ### Dates
>
> Here are the important dates:
>
> Talk proposal submission deadline: May 30th (Thursday)
> Author notification: July 4th (Thursday)
> Workshop: September 7th (Saturday)
>
> ### Submissions
>
> Submissions are typically around 2 pages long (flexible), describing the
> motivations of the work and what the presentation would be about.
>
> We encourage everyone who might be interested in giving a talk to submit
> a proposal! We truly mean everyone, and also have strongly anyone in
> mind who belongs to a group that's traditionally underrepresented at
> OCaml workshops, e.g. due to your gender(s) or non-gender, where you're
> from or based or whatever other kinds of characteristics you might have.
> You should all be able to find all information you'll need to submit a
> proposal on the official call for talk proposals. However, if you have
> any question, don't hesitate to ask us.
>
> ### Quota on accepted talks per affiliation
>
> Even though none of us is a fan of quotas, last year's workshop
> experimented with a quota of a maximum of four talks given by speakers
> with the same company/university/institute affiliation. In order to
> guarantee a coverage of a diverse range of topics and perspectives,
> we'll experiment with the same affiliation quota again.
>
> Do not hesitate to submit your talk proposal in any case: quotas, if
> needed, will be taken into account by the PC after reviewing all
> submissions, so there's no reason to self-select upfront.
>
> ## About the workshop itself
>
> So far, we've only talked about talk proposals and formalities. The
> really exciting part will be the workshop itself! It's going to be a
> whole-day workshop and, similarly to previous years, it's likely going
> to have four sessions of about four talks each. It's a rather informal
> and interactive environment, where people engage in all kinds of
> conversations about OCaml during the breaks and after the workshop.
>
> ### Hybrid attendance and cost for speakers
>
> We're aiming to make the workshop hybrid with the same streaming
> modalities as last year, meaning that talks as well as participation can
> be either in-person or remote, and remote attendance will be free. To
> promote a good atmosphere, communication and engagement, we prefer to
> have most talks in-person, but remote talks will be most welcome as well.
>
> We know that giving the talk in-person comes with an economic cost.
> We're very happy to announce that thanks to the OCaml Software
> Foundation, registration fees will be covered for speakers in case they
> can't get them funded by other means (e.g. their employer).
>
> We will do our best to provide the best workshop experience possible for
> remote participants, within the constraints of the hybrid format. While
> attending in-person does come with advantages, it also comes with an
> environmental cost, and we strongly support transitioning to a less
> plane-intensive organization for conferences and community events.
>
> ### Related events
>
> The day before the OCaml workshop, i.e. Sep 6th (Friday), is the day of
> the ML workshop (https://icfp24.sigplan.org/home/mlworkshop-2024), with
> focus on more theoretical aspects of OCaml and the whole family of ML
> languages in general. The ML workshop has already been announced on the
> OCaml discuss
> (https://discuss.ocaml.org/t/call-for-presentations-ml-2024-acm-sigplan-ml-family-workshop/14284)
> and tends to be very interesting for OCaml lovers as well.
>
> We're looking forward to the the talk submissions and to the workshop!
> Let us know if you have any questions.
>
> Sonja Heinze and Armaël Guéneau
>