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

Alan Schmitt
2024-06-04T13:26:29Z

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

Hello

Here is the latest OCaml Weekly News, for the week of May 28 to June 04,
2024.

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

v0.17 release of Jane Street packages
jsonschema2atd, Generate an ATD file from a JSON Schema / OpenAPI document
opam-repository policy change: checksums (no md5) and no extra-files
Camlkit – macOS/iOS/GNUstep toolkit for OCaml
position for MoonBit advocate
Why is there no tradition of CLI and TUI apps?
Ppxlib dev meetings
Yojson 2.2.0
Grace 0.2.0 💅, fancy diagnostics library for compilers
First release of Slipshow on opam!
Other OCaml News
Old CWN

v0.17 release of Jane Street packages
═════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-v0-17-release-of-jane-street-packages/14717/1>

Diana Kalinichenko announced
────────────────────────────

*v0.17 release of Jane Street packages*

Dear OCaml developers,

We are pleased to announce the v0.17 release of Jane Street packages!

This release comes with 15 new packages and a multitude of new
features and fixes.

Switch to OCaml 5.1
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

We are switching Base and all our packages (except `sexplib0') to
OCaml 5.1 and above. We are also switching `sexplib0' to 4.14 to take
advantage of the Tail Recursion Modulo Cons optimization in the
compiler.

Core on OCaml 5.2
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Due to some changes to `Stdlib.Gc' in OCaml 5.2, `core.v0.17.0' fails
to compile with that language version. We will release a fix that
allows using Core with OCaml 5.2 soon.

Torch and VCaml
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Due to some issues with their builds, `torch.v0.17.0' and
`vcaml.v0.17.0' were omitted from the main v0.17 release. We will soon
submit those packages to opam.

Changes
╌╌╌╌╌╌╌

Browse our [GitHub repositories] and look at the respective
`CHANGES.md' files for changes since the v0.16 release. For examples,
see changelogs for [Base], [Async_kernel], and [Bonsai].

[GitHub repositories] <https://github.com/janestreet>

[Base] <https://github.com/janestreet/base/blob/master/CHANGES.md>

[Async_kernel]
<https://github.com/janestreet/async_kernel/blob/master/CHANGES.md>

[Bonsai] <https://github.com/janestreet/bonsai/blob/master/CHANGES.md>

New packages
╌╌╌╌╌╌╌╌╌╌╌╌

[async_log] – a logging library for Async code, moved from
`async_unix'

[capitalization] – a library for case conventions and renaming
identifiers

[codicons] – icons from VS Code for use with Bonsai

[gel] – a library to mark non-record fields global for use with our
compiler extensions

[hardcaml_event_driven_sim] – a simulator library for Hardcaml

[ocaml_intrinsics_kernel] – a split from `ocaml_intrinsics' compatible
with javascript

[ocaml_openapi_generator] – an OpenAPI 3 to OCaml client generator

[ppx_diff] – a ppx for generation of diffs and update functions for
OCaml types.

[ppx_embed_file] – a ppx that allows embedding files directly into
executables/libraries as strings or bytes

[ppxlib_jane] – utilities for working with Jane Street AST constructs

[ppx_quick_test] – a ppx providing an ergonomic wrapper for quickcheck
tests, similar to `ppx_inline_test'

[ppx_string_conv] – deriving `to_string~and ~of_string'

[uopt] – unsafe option type that does not allocate, moved from
`core_kernel'

[versioned_polling_state_rpc] – helper functions for versioned
`Polling_state_rpc.t'

[virtual_dom_toplayer] – bindings for the `floating_positioning'
javascript library

[async_log] <https://github.com/janestreet/async_log>

[capitalization] <https://github.com/janestreet/capitalization>

[codicons] <https://github.com/janestreet/codicons>

[gel] <https://github.com/janestreet/gel>

[hardcaml_event_driven_sim]
<https://github.com/janestreet/hardcaml_event_driven_sim>

[ocaml_intrinsics_kernel]
<https://github.com/janestreet/ocaml_intrinsics_kernel>

[ocaml_openapi_generator]
<https://github.com/janestreet/ocaml_openapi_generator>

[ppx_diff] <https://github.com/janestreet/ppx_diff>

[ppx_embed_file] <https://github.com/janestreet/ppx_embed_file>

[ppxlib_jane] <https://github.com/janestreet/ppxlib_jane>

[ppx_quick_test] <https://github.com/janestreet/ppx_quick_test>

[ppx_string_conv] <https://github.com/janestreet/ppx_string_conv>

[uopt] <https://github.com/janestreet/uopt>

[versioned_polling_state_rpc]
<https://github.com/janestreet/versioned_polling_state_rpc>

[virtual_dom_toplayer]
<https://github.com/janestreet/virtual_dom_toplayer>

jsonschema2atd, Generate an ATD file from a JSON Schema / OpenAPI document
══════════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-jsonschema2atd-generate-an-atd-file-from-a-json-schema-openapi-document/14718/1>

Louis Roché announced
─────────────────────

Ahrefs has released jsonschema2atd, a cli tool to convert an OpenAPI
or Json Schema specification into an atd file.

Quite a lot of api out there are now publishing some kind of spec for
their expected input our output. It's often done through a a JSON
Schema or OpenAPI document. The goal of this tool is to save time for
large api by doing a mechanical translation to an atd file instead of
writing all the types by hand.

Unfortunately the world is kind of a mess. Most of the specs we have
seen are not following a specific version of openapi/jsonschema but
contain a bit of everything. jsonschema2atd does its best to do the
right thing, but there are probably cases that aren't covered.

The generated code might also not be optimal. It often deserves some
hand cleanup and a bit of renaming. Hopefully it still gives a good
head start.

Thanks to [Egor Chemokhonenko] for this work.

The code is available at <https://github.com/ahrefs/jsonschema2atd>

And there is a package that is published on opam
<https://ocaml.org/p/jsonschema2atd/latest>

[Egor Chemokhonenko] <https://github.com/ixzzd>

opam-repository policy change: checksums (no md5) and no extra-files
════════════════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-opam-repository-policy-change-checksums-no-md5-and-no-extra-files/14720/1>

Hannes Mehnert announced
────────────────────────

Dear everyone,

the opam-repository policy just changed to *not accept md5-only
checksums*, and also to *avoid extra-files* in packages (use
extra-source instead).

NOTE:
╌╌╌╌╌

If you encounter issues during `opam update', please make sure to have
`opam 2.1.6' installed, and `gpatch' (especially on BSD systems and
macOS). This may break silently, if you encounter issues, please `rm
-rf ~/.opam/repo/default && opam update default' See further notes in
<https://github.com/ocaml/opam-repository/issues/25961>

What has been achieved?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

• A new lint check that errors on md5-only checksum specification has
been put into place
<https://github.com/ocurrent/opam-repo-ci/pull/304>
• A new lint check that errors if `extra-files' is present
<https://github.com/ocurrent/opam-repo-ci/pull/313>
• The existing `extra-files', bundled in the opam-repository, have
been moved to opam-source-archives
(<https://github.com/ocaml/opam-source-archives/pull/28>)
• The opam files in the opam-repository were changed to use
extra-source with the opam-source-archives repository
<https://github.com/ocaml/opam-repository/commit/76eb35c8a78a891c7e5e27b5c32316d7add1f52d>
• All existing (and available) packages using only md5 have been
upgraded to use sha256 as well
(<https://github.com/ocaml/opam-repository/commit/ea87c49e51ff29a459422419e1688938fd77a46f>)
• See the PR for the full changes
<https://github.com/ocaml/opam-repository/pull/25960>
• See discussion at
<https://github.com/ocaml/opam-repository/issues/25876>

These changes were automated using `opam admin migrate-extrafiles' and
`opam admin add-hashes' (using the branch
<https://github.com/hannesm/opam/tree/migrate-extra-files>). There is
a utility to check that existing files and md5 checksums are still
present in the new opam-repository
<https://github.com/hannesm/opam-check-checksum>.

Impact on users and developers
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

• A lot of packages will want to be recompiled on `opam upgrade'
(since checksum changed, extra-files/extra-source was modified) –
sorry for the extensive use of CPU time
• If you need to include a patch or an extra file for your opam
package, you will need to host it elsewhere. You can host it using a
gist (<https://gist.github.com>), or on your server. All the
`extra-source' will be cached by `opam.ocaml.org'.

The reasoning for this change
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Apart from making the mental model of "how does opam-repository work"
easier (since there's no more any `files' subdirectory which includes
files that are added during the build), it also makes the approach to
cryptographically sign the repository much smoother (since we can now
rely on non-weak hash algorithms and don't need to compute more
hashes, and not need to add further hashes to the repository).

We needed to get both (weak hashes AND removing extra-files) through
at some point, it has been done today.

Camlkit – macOS/iOS/GNUstep toolkit for OCaml
═════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-camlkit-macos-ios-gnustep-toolkit-for-ocaml/14722/1>

borisd announced
────────────────

I am pleased to announce the alpha release of [Camlkit]. Camlkit
provides OCaml bindings to a collection of Cocoa frameworks on macOS,
iOS, and GNUstep. Currently available are Foundation, AppKit, UIKit,
WebKit, CoreImage, Photos, and Vision.

The package `camlkit' for macOS/GNUstep development is available from
OPAM. The key libraries to add to your dune file are
`camlkit-base.foundation' and `camlkit-gui.appkit'.

iOS development requires a [cross-toolchain]. The package is named
`camlkit-ios'. UIKit is in the library `camlkit-gui.uikit'.

Other useful resources:
• [a starter project template for iOS]
• [a few example porgrams]

More information is available on the [project's github page]. Feedback
and contributions are welcome. I hope we can make OCaml viable for GUI
development and on mobile. Happy hacking!

[Camlkit] <https://github.com/dboris/camlkit>

[cross-toolchain] <https://github.com/ocaml-cross/opam-cross-ios>

[a starter project template for iOS]
<https://github.com/dboris/camlkit-starter-nostoryboard>

[a few example porgrams] <https://github.com/dboris/camlkit-examples/>

[project's github page] <https://github.com/dboris/camlkit>

position for MoonBit advocate
═════════════════════════════

Archive:
<https://discuss.ocaml.org/t/job-part-time-position-for-moonbit-advocate/14726/1>

Hongbo Zhang announced
──────────────────────

MoonBit is ML language inspired by Rust, Go and OCaml, it was
announced with a [Wasm backend], and recently we added a [JavaScript
backend], we plan to ship a native backend this year.

It is similar to OCaml, the main difference is that we have traits,
zero-cost generics and modern tooling support. You are welcome to DM
for more details.

[Wasm backend] <https://www.moonbitlang.com/blog/first-announce>

[JavaScript backend] <https://www.moonbitlang.com/blog/js-support>

Why is there no tradition of CLI and TUI apps?
══════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/why-is-there-no-tradition-of-cli-and-tui-apps/14628/17>

Deep in this thread, Jazz announced
───────────────────────────────────

I once created a command-line bookmarking tool called [Favemarks] in
OCaml using Janestreet's Core Command.

[Favemarks] <https://github.com/nyinyithann/favemarks>

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

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

Continuing this thread, Patrick Ferris announced
────────────────────────────────────────────────

The [meeting notes are now available from the last meeting].

Thanks to everyone who attended the meeting. The next meeting is set
for [date=2024-06-18 time=17:00:00 timezone="Europe/London"], if that
changes we'll post to this thread. Hope to see you there!

[meeting notes are now available from the last meeting]
<https://github.com/ocaml-ppx/ppxlib/wiki/Dev-Meeting-2024-05-28>

Yojson 2.2.0
════════════

Archive: <https://discuss.ocaml.org/t/ann-yojson-2-2-0/14737/1>

Marek Kubica announced
──────────────────────

Hello fellow Camel-wranglers,

It's my pleasure to announce the release of Yojson 2.2.0 which you can
find in your neighborhood [opam-repository].

The most important highlights include:

• [JSON5] support. Getting annoyed by dangling commas being a problem
or the inability to use comments? JSON5 is basically JSON but with
the object syntax of ECMAScript 5.1 which allows some additional
features like unquoted keys, dangling commas or well, comments. This
has been in the works for years but finally made it to the
finish-line. The new JSON5 parser requires `sedlex' and at least
OCaml 4.08, thus it is part of the [yojson-five] package. Its usage
mimics the `Yojson' package; there exist both `Basic' and `Safe'
variants and the AST matches the JSON variants.
• No CPPO dependency anymore. Given the large amount of
reverse-dependencies on Yojson, each dependency of Yojson is going
to be a dependency of a lot of packages, thus keeping the dependency
cone small makes everything (slightly) faster. As such, instead of
using CPPO as a compile-time dependency we now use [µCPPO] as a
light-weight alternative. µCPPO is meant for embedding as part of
the build process and supports a tiny subset of what CPPO supports
but without an extra package.

Happy de- and encoding!

[opam-repository] <https://ocaml.org/p/yojson/2.2.0>

[JSON5] <https://json5.org/>

[yojson-five] <https://ocaml.org/p/yojson-five/2.2.0>

[µCPPO] <https://github.com/Leonidas-from-XIV/mucppo>

Grace 0.2.0 💅, fancy diagnostics library for compilers
═══════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-grace-0-2-0-fancy-diagnostics-library-for-compilers/14741/1>

"Alistair O'Brien announced
───────────────────────────

I'm excited to announce the release of [grace 0.2.0], an OCaml library
for building, reporting and rendering beautiful compiler diagnostics
:camel: :paintbrush:. Now available on [opam-repository].

The three main features of this release include:
• :books: *UTF8 support*: Source files can now contain Unicode
characters, including emojis ⚡️ 🌈 🚀, with proper rendering of
ASCII art for errors.

• :1234: *Error Codes*: Diagnostics can now include short, searchable
error codes. Allowing compilers to integrate a [Rust-like error code
index].

• 🤏 *Compact ANSI Errors*: `Grace_ansi_renderer' now supports a
`pp_compact_diagnostic' for concise error messages, displaying only
the file location and the error message.

<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/3/31ba975d2cf17966eb4533c1f6ba441731686d0d.png>

Tap into the power of Grace for your error reporting! Happy hacking
👨‍💻

[grace 0.2.0] <https://github.com/johnyob/grace/releases/tag/0.2.0>

[opam-repository] <https://github.com/ocaml/opam-repository/pull/25956>

[Rust-like error code index]
<https://doc.rust-lang.org/error_codes/error-index.html>

CHANGES:
╌╌╌╌╌╌╌╌

• fix(renderer): remove uncessary underlines when printing a unique
'multi-line `Top' marker' ([#31])
• fix(renderer): replace unicode chars with ASCII in `Config.ascii'
([#27])
• feat(renderer): add `NO_COLOR' and `TERM' support to `Config' ([#8])
• feat(core,renderer): add support for error codes ([#30])
• feat(renderer): add support for UTF8 encoding ([#25])
• feat(renderer): re-introduce support for compact diagnostic
rendering ([#28])
• refactor(renderer)!: move `grace.renderer' library to
`grace.ansi_renderer' ([#29])

[#31] <https://github.com/johnyob/grace/pull/31>

[#27] <https://github.com/johnyob/grace/pull/27>

[#8] <https://github.com/johnyob/grace/pull/8>

[#30] <https://github.com/johnyob/grace/pull/30>

[#25] <https://github.com/johnyob/grace/pull/25>

[#28] <https://github.com/johnyob/grace/pull/28>

[#29] <https://github.com/johnyob/grace/pull/29>

BREAKING CHANGE
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

• `Grace_rendering' has been removed. Use `Grace_ansi_renderer'
instead.

First release of Slipshow on opam!
══════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-first-release-of-slipshow-on-opam/14743/1>

Paul-Elliot announced
─────────────────────

It is my pleasure to announce the first [release] of [slipshow] on
`opam'.

Slipshow is a presentation tool to create presentation that are not
based on slides, but on more continuous transitions, similar to
scrolling.

<https://raw.githubusercontent.com/panglesd/slipshow/master/slip_scroll.gif>

You can find more information and examples on the [project repo] and
on the [documentation].

How is that related to the OCaml community? While the
"runtime"/"engine" is still written in javascript (I did not know
OCaml back then, but there is a [plan] to rewrite it), the compiler is
written in OCaml! And I am really grateful for the many authors of
open source libraries, of very high quality, that I depend on and
could do nothing without them :) **Thanks a lot** to all OCaml library
and tool authors!

┌────
│ $ opam update
│ $ opam install slipshow
│ # create and open ~source.md~ in your editor
│ $ slipshow --serve source.md
└────

Hope it can be useful :D

[release]
<https://github.com/ocaml/opam-repository/pull/25948#issuecomment-2146906766>

[slipshow] <https://github.com/panglesd/slipshow>

[project repo] <https://github.com/panglesd/slipshow>

[documentation] <https://slipshow.readthedocs.io>

[plan] <https://github.com/panglesd/slipshow/issues/32>

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

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

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

• [Effective ML Through Merlin's Destruct Command]

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

[Effective ML Through Merlin's Destruct Command]
<https://tarides.com/blog/2024-05-29-effective-ml-through-merlin-s-destruct-command>

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