Attn: Development Editor, Latest OCaml Weekly News
Alan Schmitt <[email protected]> Tue, 11 Feb 2025 08:17:52 +0100
| Newsgroups | gmane.comp.lang.caml.inria |
|---|---|
| Message-ID | <[email protected]> |
Hello
Here is the latest OCaml Weekly News, for the week of February 04 to 11,
2025.
Table of Contents
─────────────────
ocamlmig, a tool to rewrite ocaml code, and complement `[@@deprecated]'
Mopsa 1.1 – Modular Open Platform for Static Analysis
Other OCaml News
Old CWN
ocamlmig, a tool to rewrite ocaml code, and complement `[@@deprecated]'
═══════════════════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-ocamlmig-a-tool-to-rewrite-ocaml-code-and-complement-deprecated/16090/1>
v-gb announced
──────────────
Hi,
I'm glad to announce ocamlmig, a command line tool for rewriting ocaml
source code with access to scope and type information.
As the simplest example of what it's intended for, let's say an
opam-installed library A provides this interface:
┌────
│ val new_name : int -> int
│
│ val old_name : int -> int
│ [@@migrate { repl = Rel.new_name }]
└────
and your repository contains a file b.ml:
┌────
│ let _ = A.old_name 1
└────
then you could run:
┌────
│ $ git diff b.ml
│ $ ocamlmig migrate -w
│ $ git diff b.ml
│ -let _ = A.old_name 1
│ +let _ = A.new_name 1
└────
Obviously, it's not limited to renames.
When I meant by "complement `[@@deprecated]'" is that instead of
providing a textual description `[@@deprecated "please use this thing
instead" ]' , you get to provide an executable description. The goal
is to reduce the friction when the interface of a library evolves. If
people get in the habit of running this regularly (after every `opam
upgrade~/~dune pkg lock', say), then it could also be a way to get
users to switch to new interfaces without having to deprecate the old
interfaces immediately.
Additionally, using that and a couple of other builtin transformations
like removing ~open~s, you can execute some refactorings, without
learning anything like ppxlib or the ocaml ast, for instance:
• [Renaming operators] (not easy with sed or the like, because the
operators change precedence)
• [Switching code using both Stdlib and Core to mostly Core]
If that piqued your interest, here is more information about [what
ocamlmig does], and [using it].
This is decidedly work in progress, many things are not fully
implemented, and it needs a lot of polish, but the existing
functionality as is should still be interesting.
[Renaming operators]
<https://github.com/v-gb/Gillian/commit/e15ac20a5fac0849dae51523d1b73f1612f976e5>
[Switching code using both Stdlib and Core to mostly Core]
<https://github.com/v-gb/ortografe/commit/b0b6a0c323edb67c03ae938d122e73b4f6a8affc>
[what ocamlmig does]
<https://github.com/v-gb/ocamlmig/blob/main/doc/what.md>
[using it] <https://github.com/v-gb/ocamlmig/blob/main/doc/using.md>
Mopsa 1.1 – Modular Open Platform for Static Analysis
═════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-mopsa-1-1-modular-open-platform-for-static-analysis/16095/1>
Raphaël Monat announced
───────────────────────
Dear all,
On behalf of all its developers, I am glad to announce the release of
[Mopsa v1.1]! You can just `opam install mopsa' .
*What is Mopsa?* Mopsa stands for Modular and Open Platform for Static
Analysis. It aims at easing the development and use of static
analyzers. More specifically, Mopsa is a generic framework for
building sound static analyzer based on the theory of abstract
interpretation. Mopsa is independent of language and abstraction
choices. Developers are free to add arbitrary abstractions (numeric,
pointer, memory, etc.) and syntax iterators for new languages. Mopsa
encourages the development of independent abstractions which can
cooperate or be combined to improve precision.
*v1.1 changes.* This new version brings several expressivity,
precision and interface improvements, notably:
• [Trace and state partitioning]. ⚠️ introduces [breaking changes] in
the API of domains.
• [Suggestions to trigger automatic testcase reduction whenever Mopsa
crashes]
• * As a side-effect, Mopsa is able to generate preprocessed files
from make targets using option `-c-preprocess-and-exit=file.i',
which might be useful for other users too! This has been
experimented on our coreutils benchmarks, and can also be used to
generate the preprocessed files used in the [Software-Verification
Benchmarks].
• Bash completion support, thanks to [arg-complete] developped by
[Simmo Saan].
[Here is the detailed changelog].
[Mopsa v1.1] <https://gitlab.com/mopsa/mopsa-analyzer/>
[Trace and state partitioning]
<https://mopsa.gitlab.io/mopsa-analyzer/user-manual/options/general.html#partitioning>
[breaking changes]
<https://gitlab.com/mopsa/mopsa-analyzer/-/merge_requests/130#breaking-changes>
[Suggestions to trigger automatic testcase reduction whenever Mopsa
crashes]
<https://mopsa.gitlab.io/mopsa-analyzer/user-manual/debugging/automated-testcase-reduction.html>
[Software-Verification Benchmarks]
<https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks#programs>
[arg-complete] <https://opam.ocaml.org/packages/arg-complete/>
[Simmo Saan] <http://sim642.eu/>
[Here is the detailed changelog]
<https://gitlab.com/mopsa/mopsa-analyzer/-/blob/fb3fa9bdf9a225f041c8d03dfa248991f92c674d/CHANGELOG.md>
Other OCaml News
════════════════
From the ocaml.org blog
───────────────────────
Here are links from many OCaml blogs aggregated at [the ocaml.org
blog].
• [MirageOS on OCaml 5!]
[the ocaml.org blog] <https://ocaml.org/blog/>
[MirageOS on OCaml 5!]
<https://tarides.com/blog/2025-02-06-mirageos-on-ocaml-5>
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:[email protected]>
[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/>