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

Alan Schmitt
2024-06-25T13:58:49Z

[-- Attachment #1: Type: text/plain, Size: 19838 bytes --]

Hello

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

Table of Contents
─────────────────

First public editor tooling dev-meeting
First release of oma
Ppxlib dev meetings
CAISAR release 2.0, a platform for characterizing AI safety and robustness
First release of baby
Preview of Stripe client and mock server - DkStdRestApis
opam 2.2.0 rc1 release
Project wide occurrences
Other OCaml News
Old CWN

First public editor tooling dev-meeting
═══════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-first-public-editor-tooling-dev-meeting/14824/1>

vds announced
─────────────

We are organizing the first public dev-meeting about Merlin, OCaml-LSP
and more generally editor support for OCaml. This meeting will take
place on *Thursday, June 27th*, at 05:00 pm CEST. We plan to have
these happen every last Thursday of the month.

The goal of these meetings is to provide a place for all contributors
of these projects to discuss their work together. Whether you are a
long time maintainer, an occasional contributor, a new comer, or
simply a curious passer-by, please feel free to join and participate!

We also plan to have some short technical presentations to help
contributors learn more about the projects involved. These won't be
systematic, and if you are interested in a particular subject feel
free to ask about it or to propose a presentation.

The agenda for this first meeting, which will be focused on the
burning topic of project-wide occurrences, is the following:

• A tour-de-table to allow the participants that wish to do so to
present themselves and mention issues / prs they are interested in.
• A presentation of current on-going projects.
• A focus on project-wide occurrences: how does it work, what are the
tools that need to interact together and what are its current
limitations and possible future improvements.
• Discuss issues and pull requests that were tagged in advance or
mentioned during the tour-de-table.
• Informal discussion

We looking forward to meeting you!

Meeting link: <https://meet.google.com/imo-mkxi-hpt>

First release of oma
════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-first-release-of-oma/13845/2>

François Pottier announced
──────────────────────────

I have just published a new release of `oma' with the following fixes
and changes:

• New functions `invalidate_open_interval' and
`invalidate_semi_open_interval'.
• Fix a serious bug in `Unsafe.first' and `Unsafe.last', which would
incorrectly return `None' when the region contains only one point.
• Fix a serious bug in `Unsafe.iter', which would systematically omit
the last point of the region.

Ppxlib dev meetings
═══════════════════

Archive: <https://discuss.ocaml.org/t/ppxlib-dev-meetings/12441/25>

Nathan Rebours announced
────────────────────────

Meeting notes are available here:
<https://github.com/ocaml-ppx/ppxlib/wiki/Dev-Meeting-2024-06-18>.

Thanks to everyone who attended!

Our next meeting is scheduled for Tuesday July 16th, 6:00PM CET!

CAISAR release 2.0, a platform for characterizing AI safety and robustness
══════════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-caisar-release-2-0-a-platform-for-characterizing-ai-safety-and-robustness/14831/1>

Julien Girard announced
───────────────────────

On the occasion of the 34th birthday of the [abolition of the
apartheid laws], we are honoured to release CAISAR version 2.0.

The release source is available at our [public forge]. As our last
releases, CAISAR will soon be available on [opam] and on [Dockerhub].

A nix flake is available for building CAISAR directly in the
repository. Try CAISAR with `nix build
git+https://git.frama-c.com/pub/caisar'!

Here are the prominent features for this 2.0 release:

[abolition of the apartheid laws]
<https://www.dw.com/fr/il-y-a-25-ans-la-fin-de-lapartheid/a-18523920>

[public forge] <https://git.frama-c.com/pub/caisar/-/releases/2.0>

[opam] <https://opam.ocaml.org/packages/caisar/>

[Dockerhub] <https://hub.docker.com/r/laiser/caisar>

Specification and verification of several neural networks at once
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

CAISAR specification language already allowed to write specifications
that involved several neural networks at once. However, translating
such specifications to actual prover queries was not possible. We
added automated graph editing techniques to allow such verification to
take place. Within particular patterns, CAISAR will generate an ONNX
file that preserve the semantic of the different neural networks while
encapsulating parts of the specification directly in the control flow
of the new neural network. This feature allow the verification of
properties with multiple neural networks, including their composition.

This is quite a step forward, as it enables machine-learning dedicated
verifiers to tackle a much wider range of properties.

SVM as first-class citizens for interpretation
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

CAISAR now fully integrate SVMs into the interpretation engine. Users
can expect vector computations and applications on SVMs to be computed
similarly as what exists already for neural networks.

We also unified the theory of machine learning models. Now, SVMs and
neural networks can be specified with only the `model' type. In the
near future, SVMs will be parsed directly into CAISAR’s Neural
Intermediate Representations, which will simplify the verification of
systems with heterogeneous AI components.

First release of baby
═════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-first-release-of-baby/14840/1>

François Pottier announced
──────────────────────────

It is my pleasure to announce the first release of `baby'.

`baby' is an OCaml library that offers several implementations of
balanced binary search trees. At this time, `baby' offers a
replacement for OCaml's `Set' module; it does not yet have a
replacement for OCaml's `Map' module.

Height-balanced and weight-balanced binary search trees are offered
out of the box. Furthermore, to advanced users, the library offers a
lightweight way of implementing other balancing strategies.

The following points offer a comparison between `baby' and OCaml's
`Set' library.

Better Performance
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

At the time of writing, `baby' offers generally better performance
than OCaml's `Set' library. Its operations are generally faster
(sometimes much faster; sometimes slightly faster; sometimes slightly
slower) than those of the `Set' library, and its memory allocation
rate is slightly lower.

Constant-Time Cardinal
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

In contrast with the `Set' library, `baby''s weight-balanced trees
offer a `cardinal' function whose time complexity is *O(1)*. They also
offer a family of random access functions (`get', `index', etc.) whose
time complexity is *O(log n)*. Furthermore, by exploiting cardinality
information, the functions `subset' and `equal' are sometimes able to
return `false' in constant time.

Better Sharing
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

`baby''s binary operations (`union', `inter', `diff') take advantage
of (and preserve) physical equality in a more aggressive way. This
allows them to (sometimes) be faster and allocate less memory.

Adaptive Conversions To Sets
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

`baby''s conversion functions `of_list', `of_array', and `of_seq' have
adaptive complexity. If the input data is sorted, their complexity is
*O(n)*; otherwise, their complexity gracefully degrades down to
*O(n.log n)*.

More Operations
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

`baby' offers a few operations that do not exist in OCaml's `Set'
library:

⁃ The symmetric difference, `xor';
⁃ The conversion functions `of_array' and `to_array';
⁃ The extremum-removal functions `remove_min_elt' and
`remove_max_elt';
⁃ The enumeration API in the submodule `Enum'. Enumerations should be
slightly faster than standard sequences, and are able to efficiently
seek ahead, via the function `from'.

Documented Complexity
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

In `baby', the time complexity of every operation is documented.

Compatibility
╌╌╌╌╌╌╌╌╌╌╌╌╌

`baby' is perfectly compatible with OCaml's Set library. In other
words, using `Baby.W.Set' instead of `Set' is safe.

As a word of warning, though, if the equivalence relation on elements
is coarser than equality (that is, if `compare x y = 0' does not imply
`x = y'), then `Baby.W.Set' and `Set' might behave differently when a
choice must be made between two equivalent elements. This can occur in
`union', `of_list', `of_array', `of_seq', `add_seq', `map'.

Preview of Stripe client and mock server - DkStdRestApis
════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-preview-of-stripe-client-and-mock-server-dkstdrestapis/14841/1>

jbeckford announced
───────────────────

I am pleased to announce that Stripe is the first REST API available
in the DkStdRestApis project:

<https://github.com/diskuv/DkStdRestApis?tab=readme-ov-file>

That README has a 10-minute quick start; you can do it with or without
a Stripe account.

The Stripe client and mock server have Apache 2.0 licensing and were
generated using a new OpenAPI code generator. The code generator is
not part of this preview announcement (wait until DkCoder 0.4
announcement) but since there have been a couple generators released
in the past month perhaps it is best to say what is different:

1. Both client and server source code are generated. The client
examples include direct web requests by cohttp-lwt-curl
(`src/DkStdRestApis_NotStripe/Curl2.ml') and also indirectly by
printing the `curl -d name=value https://api.stripe.com/...'
command (`src/DkStdRestApis_NotStripe/CurlCmd.ml'). The mock server
example (`src/DkStdRestApis_NotStripe/ServerTiny.ml') uses @c-cube
's [excellent tiny_httpd daemon].
2. Very small dependency cone that works on Windows/macOS/Linux
(including the REST server). And the minimum OCaml version will be
4.14 for the foreseeable future.
3. My focus is not on the code generator but having working,
maintainable REST clients for the major cloud/SaaS services that
can be included in DkCoder's liberally licensed standard
library. The server feature was a pleasant but very unplanned
accident. If I do take time to develop fancier server features
(ex. replaying mocks from a corpus, etc.) those additions will not
be open source.
4. It is intended to have high coverage of OpenAPI features. Today
that includes form URL encoding, sum types, server-side
polymorphism and style/explode support. The only major feature that
is intentionally unsupported is the `not' composition operator
(have no idea how to express negation in OCaml's type system!).

Now for the problems:

1. Stripe only compiles in bytecode mode. Why? The generated modules
are huge (8+ MB in total) because Stripe's specification is
6MB. Native compilation [can't handle that today].
2. I'm not releasing to opam until I'm sure that native compilation
won't denial-of-service developer and opam machines. I'm also
waiting for some Windows patches to dependencies to be released.

Thanks to @vlaviron for helping solve some of the compilation scaling
problems. And thanks to Nomadic Labs (and OCamlPro?) for developing
[Json_encoding] and @anuragsoni for developing [Routes]; they are both
bidirectional + lightweight + foundational.

Report bugs / add stars [in the DkCoder project].

[excellent tiny_httpd daemon] <https://v3.ocaml.org/p/tiny_httpd/latest>

[can't handle that today] <https://github.com/ocaml/ocaml/issues/13250>

[Json_encoding] <https://v3.ocaml.org/p/json-data-encoding/latest>

[Routes] <https://v3.ocaml.org/p/routes/latest/doc/index.html>

[in the DkCoder project] <https://github.com/diskuv/dkcoder>

opam 2.2.0 rc1 release
══════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-opam-2-2-0-rc1-release/14842/1>

R. Boujbel announced
────────────────────

We’re once again very excited to announce this first release candidate
(and hopefully only) for opam 2.2.0.

What’s new in this rc?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

• Fix `opam upgrade' wanting to keep rebuilding the compiler (as now
it contains an `x-env-path-rewrite' field)
• Provide defaults so `opam init -y' no longer asks questions on
Windows
• Fix `OpamConsole.menu' when there are more than 9 options (can
happen on Windows)
• A couple more fixes and general improvements

:open_book: You can read our [blog post ] for more information about
these changes and more, and for even more details you can take a look
at the [release note ] or the [changelog].

[blog post ] <https://opam.ocaml.org/blog/opam-2-2-0-rc1/>

[release note ] <https://github.com/ocaml/opam/releases/tag/2.2.0-rc1>

[changelog] <https://github.com/ocaml/opam/blob/2.2.0-rc1/CHANGES>

Windows issues
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Configuration of Windows is tricky, so please don’t be too
disheartened if things don’t work instantly. If something doesn’t work
first time, [please do report it ], even if you manage to find a way
to workaround it. If opam didn’t elegantly tell you what was wrong,
then it’s a bug and we’d love to hear about it, rather than ending up
with a series of workarounds flying around. It’s no problem at all for
us to receive a bug report which turns out to be user error - we’d far
rather that than not hear bugs which are opam’s error! :scream_cat:

[please do report it ] <https://github.com/ocaml/opam/issues>

How to upgrade
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

For Unix systems

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

or from PowerShell for Windows systems

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

We’re planning for a final opam 2.2.0 release next week, so please do
report any issue you encounter on our [bug-tracker ].

[bug-tracker ] <https://github.com/ocaml/opam/issues>

Project wide occurrences
════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-project-wide-occurrences/14847/1>

vds announced
─────────────

I am very excited to announce the first release of Merlin and
Ocaml-LSP with support for project-wide occurrences 🥳. More
precisely, it is now possible to query for every _usage_ of any value
(and type, modules, etc.) anywhere in a project built with Dune. This
is a very handy tool for code navigation !

Requirements
╌╌╌╌╌╌╌╌╌╌╌╌

• OCaml 5.2
• Latest Dune (>= `3.16.0')
• Latest Merlin (>= `5.1-502')
• Latest OCaml-LSP preview (`1.18.0~5.2preview')

Usage
╌╌╌╌╌

• Build the new `@ocaml-index' alias.
> We recommend running the indexation in watch mode along with your
usual targets: `dune build @ocaml-index --watch' so that the index
is always up to date.
• Use the `Find/Peek all references' feature of LSP-based plugins
• or `merlin-project-occurrences' in emacs
• or `OccurrencesProjectWide' in vim.
• Enjoy jumping around 🦘

<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/c/c282815986f60d12069d33bc13f22fcdb70f0022.gif>

More information and bug reports
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Bug reports and feature requests should be submitted to the Merlin
[issue tracker]. There are already some known issues like the absence
of declarations in the results and the impossibility to query from a
declaration. Progress on occurrences can be tracked in a [pinned
meta-issue]. If you are interested in contributing and learning more
about the feature do not hesitate to join the [first public
dev-meeting] on Thursday !

[issue tracker] <https://github.com/ocaml/merlin/issues>

[pinned meta-issue] <https://github.com/ocaml/merlin/issues/1780>

[first public dev-meeting]
<https://discuss.ocaml.org/t/ann-first-public-editor-tooling-dev-meeting/14824/1>

Other OCaml News
════════════════

From the ocaml.org blog
───────────────────────

Here are links from many OCaml blogs aggregated at [the ocaml.org
blog].

• [Keeping Up With the Compiler: How we Help Maintain the OCaml
Language]

[the ocaml.org blog] <https://ocaml.org/blog/>

[Keeping Up With the Compiler: How we Help Maintain the OCaml Language]
<https://tarides.com/blog/2024-06-19-keeping-up-with-the-compiler-how-we-help-maintain-the-ocaml-language>

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] <mailto:alan.schmitt@polytechnique.org>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[caml-list] <https://sympa.inria.fr/sympa/info/caml-list>

[Alan Schmitt] <https://alan.petitepomme.net/>

[-- Attachment #2: Type: text/html, Size: 32955 bytes --]