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

Alan Schmitt
2024-08-20T09:29:57Z

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

Hello

Here is the latest OCaml Weekly News, for the week of August 13 to 20,
2024.

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

MlFront - A Java-like package system for OCaml
Rpmfile library v0.3.0 with new Eio-based reader
GitHub - meta-introspector/ocaml-libppx-import-yojson-introspector: Using libppx, ppx_import, reflect over ast using
Dune Developer Preview Updates
Ppxlib dev meetings
Pragmatic Category Theory: Part 2 published!
Dune dev meeting on 2024-08-21, 10am CEST
Other OCaml News
Old CWN

MlFront - A Java-like package system for OCaml
══════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-mlfront-a-java-like-package-system-for-ocaml/15072/8>

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

There is now a new library `MlFront_Top' with a build tool
`mlfront-top' that will generate self-contained OCaml toplevel script
files with parallelism based on @c-cube's moonpool library:

┌────
│ .
│ ├── AcmeWidgets_Std/
│ │ ├── JobsA1.ml
│ │ └── JobsA2.ml
│ └── BobBuilder_Std/
│ └── JobsB.ml
└────

┌────
│ $ mlfront-top -o buildscript.ml
│
│ $ ocaml buildscript.ml -j 2 -native
│ legend: -> start | <- finish
│ directory create: target/
│ file create: target/AcmeWidgets_Std.ml
│ link create: AcmeWidgets_Std/JobsA1.ml -> target/AcmeWidgets_Std__JobsA1.ml
│ link create: AcmeWidgets_Std/JobsA2.ml -> target/AcmeWidgets_Std__JobsA2.ml
│ link create: BobBuilder_Std/JobsB.ml -> target/BobBuilder_Std__JobsB.ml
│ -> compile: AcmeWidgets_Std.JobsA1
│ -> compile: AcmeWidgets_Std.JobsA2
│ <- compile: AcmeWidgets_Std.JobsA1
│ <- compile: AcmeWidgets_Std.JobsA2
│ -> compile: AcmeWidgets_Std
│ <- compile: AcmeWidgets_Std
│ -> compile: BobBuilder_Std.JobsB
│ <- compile: BobBuilder_Std.JobsB
│ -> executable create: BobBuilder_Std.JobsB
│ <- executable create: BobBuilder_Std.JobsB
│ done.
│
│ $ target/BobBuilder_Std.JobsB
│ I am an A1!
│ I am an A2!
│ I am a B!
└────

It requires the `ocaml' binary and `ocamlc' or `ocamlopt'. The
complete example is at
<https://gitlab.com/dkml/build-tools/MlFront/-/blob/0.4.0-6/tests/MlFront_Top/jobs.t/run.t>.

Rpmfile library v0.3.0 with new Eio-based reader
════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/rpmfile-library-v0-3-0-with-new-eio-based-reader/15149/1>

Mikhail announced
─────────────────

Today I want to tell you about new version of [Rpmfile
library]. Rpmfile is a library for reading metadata from [RPM]
packages. Originally Rpmfile's parser (reader) used [Angstrom] for
parsing. And in the new release added new modern [Eio]-based reader.

Globally, the project is now split into four packages: `rpmfile',
which contains signatures and implementation-independent functions,
`rpmfile-unix' with the original Angstrom parser, and `rpmfile-eio'
(with `rpmfile-cli') written using Eio.

[Rpmfile library] <https://github.com/dx3mod/rpmfile>

[RPM] <https://en.wikipedia.org/wiki/RPM_Package_Manager>

[Angstrom] <https://github.com/inhabitedtype/angstrom>

[Eio] <https://github.com/ocaml-multicore/eio>

My experience porting to Eio
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Eio is a fantastic effect-based I/O library for a more modern age in
multicore OCaml. I think it takes the best ideas from the
ecosystem. So built-in `Buf_read' and `Buf_write' modules implement
ideas from Angstrom and Faraday libraries. Almost API one-to-one,
allowing porting via copy-paste.

But, of course, not everything is so perfect. Unlike the
`Angstrom.parse_' function, the `Buf_read.parse' function thinks I
want to read a whole stream to end of input.

A snippet of the source code:
┌────
│ let parse ?initial_size ~max_size p flow =
│ let buf = of_flow flow ?initial_size ~max_size in
│ format_errors (p <* end_of_input) buf
│ (* ^^^^^^^^^^^^^^^
│ 0_0 nice (not) *)
└────

So I had to rewrite this function myself in a form similar to
`Angstrom.Consume.Prefix'.

◊ Is it a signed or unsigned integer?

`BE.uint16' and other similar functions are *signed int* even though
they have the prefix `u' in the name for some reason.

◊ And a few other differences

• `Angstrom.advance' is `skip'
• `Angstrom.pos' is `consumed_bytes'

P.S.
╌╌╌╌

Thanks for your attention!

GitHub - meta-introspector/ocaml-libppx-import-yojson-introspector: Using libppx, ppx_import, reflect over ast using
════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/github-meta-introspector-ocaml-libppx-import-yojson-introspector-using-libppx-ppx-import-reflect-over-ast-using/15151/1>

Jim Dupont announced
────────────────────

Here is a working first version (with warts) of a ppxlib to yojson
converter, am still testing it but the hello world is working, I have
tried multiple times to get this to work, and finally settled on the
import route to override the type system. code here:
<https://github.com/meta-introspector/ocaml-libppx-import-yojson-introspector>

example snippet

┌────
│ {
│ "pexp_desc": [
│ "Pexp_constant",
│ [
│ "Pconst_string",
│ "Hello, World!"
│ ]
│ ]
│ }
└────

Dune Developer Preview Updates
══════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-dune-developer-preview-updates/15160/1>

ostera announced
────────────────

Just wanted to share some of the work the Dune has been up to lately
re: the Developer Preview we announced [here] :) – we'll be using this
thread to share more updates as things go.

As always, we hold our Dune Developer meetings in public and you're
more than welcome to subscribe to our public Calendar ([Google],
[iCal])

[here]
<https://discuss.ocaml.org/t/ocaml-platform-newsletter-march-may-2024/14765>

[Google]
<https://calendar.google.com/calendar/embed?src=c_5cd698df6784e385b1cdcdc1dbca18c061faa96959a04781566d304dc9ec7319%40group.calendar.google.com&ctz=Europe%2FStockholm>

[iCal]
<https://calendar.google.com/calendar/ical/c_5cd698df6784e385b1cdcdc1dbca18c061faa96959a04781566d304dc9ec7319%40group.calendar.google.com/public/basic.ics>

Getting ready for the Public Beta
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

As we prepare for the public beta, we're ramping up the DX interviews
and ensuring the first few users will have a fun, productive
experience with the developer preview.

:inbox_tray: If you signed up for the Dev Preview back in
May, check your inbox for a link and instructions to
schedule your DX interview with us.

Here's a sample video ([Mastodon] or [X]) where you can see me
building the Riot project on a machine that does not have OCaml
installed. It is pretty neat!

Seriously, big shoutout to the Dune team at Tarides[0] who have been
doing a phenomenal job :clap: :sparkles: :camel:

So here's what getting started with OCaml looks like today with the
Dune Developer Preview as of today (August 19 2024):

1. get `dune' from our binary distribution – we'll soon make this
public!
2. run `dune pkg lock' in your favorite project
3. run `dune build'

That's it. No need to install anything else, Dune will see that lock
file, fetch, and build all necessary dependencies.

:world_map: These are some strong step towards the [OCaml
Platform vision for 2026], that we are actively working
towards. If you have any thoughts or feedback please let
me know!

There are more improvements coming that will help remove friction to
get started and creating a delightful experience. Both of these things
we strongly believe will help onboard new users to the OCaml world.

Here's a few in the works:

• *Various DX improvements* – from new outputs to simplified
workflows, we want to make using Dune just delightful.
• *Bundled support for dev tools* (ocalmformat, odoc, lsp) – the
default toolset will be available without any extra steps! just
call `dune fmt', and it works. No need to manually install anything
else.
• *Automatic dependency locking* – when building, and even on watch
mode, Dune will lock your dependencies by default and keep the lock
up to date.
• *Cross-project Caching* – by default we'll enabled a local Dune
cache that across the system, so you never rebuild the same
dependency even across projects.
• *Signed binaries with certificates of origin* – we care deeply about
security and want to make sure that any binary we ship will be
easily verified and tracked back to its sources.

Stay tuned! :wave:

PS: here's a longer video ([Mastodon], [X]) showing you the setup for
OCaml from zero, creating a new project, and adding a dependency, all
within ~5 minutes

[0] @emillon @Leonidas @gridbugs @tmattio. Ambre Shumay, Alpha Diallo,
Etienne Marais

[Mastodon] <https://mas.to/deck/@leostera/112988841207690720>

[X] <https://x.com/leostera/status/1825519465527673238>

[OCaml Platform vision for 2026]
<https://ocaml.org/tools/platform-roadmap>

[Mastodon] <https://mas.to/deck/@leostera/112988880290815356>

[X] <https://x.com/leostera/status/1825519469759812062>

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

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

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

This month's meeting is scheduled for tomorrow, [date=2024-08-20
time=17:00:00 timezone="Europe/London"]!

The meeting agenda thus far is to discuss the following:

• *5.2 Bump Progess*
• Auto-generate AST pattern code and labelled arguments
(e.g. `value_binding ~constraint_:none' but no positional
argument?)
• `Ast_helper.Exp.function_' deprecation
• [opam-repository overlay for 5.2 AST bump]
• *Issues in migrations*
• Bumping the AST has uncovered issues in migrating code up and down
the internal ppxlib ASTs – would be good to discuss this and also
how to mitigate this going forward.
• *Documentation*
• Great user feedback from [Ppxlib: Getting the original definition
of `typ_constr' like `type_declaration' from `core_type' of
`ptyp_constr'] which we should take onboard and work into
<https://github.com/ocaml-ppx/ppxlib/issues/324>
• *Some carry over items from last month*
• In general what is the medium term goals for ppxlib? Mostly
maintenance and bumping the AST/keeping up with compiler releases?

The meeting will be hosted on google meet here:
<https://meet.google.com/yxw-ejnu-cju>

Everyone is very welcome to join! :camel:

[opam-repository overlay for 5.2 AST bump]
<https://github.com/patricoferris/opam-ppxlib-repository>

[Ppxlib: Getting the original definition of `typ_constr' like
`type_declaration' from `core_type' of `ptyp_constr']
<https://discuss.ocaml.org/t/ppxlib-getting-the-original-definition-of-typ-constr-like-type-declaration-from-core-type-of-ptyp-constr/15110>

Pragmatic Category Theory: Part 2 published!
════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/new-part-pragmatic-category-theory-part-2-published/15056/6>

Dmitrii Kovanikov announced
───────────────────────────

I just published [the second part] of my series, so I updated the
topic.

Let me know when notifications become too noisy :slight_smile:

[the second part]
<https://dev.to/chshersh/pragmatic-category-theory-part-2-composing-semigroups-87>

Dune dev meeting on 2024-08-21, 10am CEST
═════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-dune-dev-meeting-on-2024-08-21-10am-cest/15166/1>

Steve Sherratt announced
────────────────────────

Hi! The next public dune dev meeting will be held on 2024-08-21, 10am
CEST. Please feel free to let me know any topics you'd like us to
discuss and I'll update [the meeting notes]. The zoom link for the
meeting is:
<https://us06web.zoom.us/j/85096877776?pwd=cWNhU1dHQ1ZNSjZuOUZCQ0h2by9Udz09>

[the meeting notes]
<https://github.com/ocaml/dune/wiki/dev-meeting-2024-08-21>

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

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

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

• [The new Tar release, a retrospective]

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

[The new Tar release, a retrospective]
<https://blog.robur.coop/articles/tar-release.html>

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: 27121 bytes --]