OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of March 10 to 17, 2020.

Table of Contents

Unicode 13.0.0 update for Uucd, Uucp, Uunf and Uuseg

Daniel Bünzli announced

Unicode 13.0.0 was released on the 10th of march.

It adds 5390 characters to the standard including graphic symbols for legacy computing. If you were looking for characters representing seven-segment decimal digits, now you have them. For the curious, the encoding proposal has the motivation and source of these new symbols. For more information about all the other additions, see this page.

Accordingly the libraries mentioned at the end of this message had to be updated, consult the individual release notes for details. Both Uucd and Uucp are incompatible releases sinces new script and block enumerants had to be added.

Uucp has a new Emoji module with the new emoji properties introduced in 13.0.0 which are now used by Uuseg to improve emoji segmentation. The overall compiled size of Uucp shrinked a bit; here uucp.cmxs went from 7.8Mo to 4.6Mo. Further reduction can likely be achieved with more work. Thanks to David Kaloper Meršinjak for helping on this.

A periodic reminder, if Unicode still puzzles you, read an absolute minimal Unicode introduction and OCaml Unicode tips on this page (also available via odig doc uucp).

Happy retro computing,

Daniel

P.S. The OCaml compiler detected an obsolete rule in the 13.0.0 update of the Unicode line breaking algorithm.

Uucd 13.0.0 Unicode character database decoder for OCaml.

http://erratique.ch/software/uucd

Uucp 13.0.0 Unicode character properties for OCaml.

http://erratique.ch/software/uucp

Uunf 13.0.0 Unicode text normalization for OCaml.

http://erratique.ch/software/uunf

Uuseg 13.0.0 Unicode text segmentation for OCaml.

http://erratique.ch/software/uuseg

Introducing dune describe

Jérémie Dimino announced

Just a quick post to introduce the new dune describe command in Dune 2.4.0. If you'd like to write a tool that needs to understand the structure of a dune project, figure out where the cmt files are located, etc…, this is the command to look at.

The command is not production ready yet, but the infrastructure is in place. If you are interested in releasing tools that rely on it, please let us know so that we can discuss what information you need out of dune and also so that we can stabilise it.

https://dune.build/blog/dune-describe/

Introducing Model_quickcheck. Quickcheck for stateful, imperative code

suttonshire announced

I'm sharing a small project I've been working on that I hope will be interesting or useful to the community. Model_quickcheck is a model-based testing system that allows you to validate the "properties" of stateful, imperative OCaml programs. It's built on Jane Street's Base_quickcheck.

I just started learning OCaml and one of the first projects I've been working on is a user-space reliable transport protocol. Writing tests for this system became unwieldy because I was trying to validate certain properties of the protocol by thinking up very specific sequences of actions that would invoke behaviors that relied on that property. I got tired of it and got curious if there was a way to generate these interesting sequences. My research turned up frameworks like QCSTM and PropEr for state machine property-based testing. This seemed to be exactly what I needed so I started building something similar.

To use Model_quickcheck you specify a set of actions to apply to your program, a model that describes the state of you program and a set of predicates that define the properties of you system. The model is hopefully a simpler representation of your system e.g. a map instead of a key-value database, or a queue instead of a reliable network protocol. Model_quickcheck then generates a random sequences of actions applies them to your system and verifies the properties.

This has been an exciting and useful project. I've learned a bunch about the Base library, Quickcheck, first class modules, and inline tests. I'm just getting started, but I just wanted to share the project with the community since I've learned a lot by lurking here.

Odig 0.0.5

Daniel Bünzli announced

odig has a new release. See the release notes for details.

Installation: opam install ocaml-manual odig

Tutorial: https://erratique.ch/software/odig/doc/manual.html

odig is a command line tool to lookup documentation of installed OCaml packages. It shows package metadata, readmes, change logs, licenses, cross-referenced odoc API documentation and manuals.

Suggestions for ocaml documentation

sanette announced

The "OCaml API", which is the documentation for the standard library, is now complete for all versions 4.00–4.10, with a quick search field, on the demo site:

https://sanette.github.io/ocaml-api/

Introducing Gopcaml mode - structural OCaml editing

Kiran Gopinathan announced

Hi all, I am pleased to announce the first release of Gopcaml-mode, a new emacs library that aims to extend the existing OCaml editing experience with structural editing capabilities.

A picture is worth a thousand words, so I'll cut to the chase, and start with a few demonstrations:

Examples

  • AST-based code navigation - C-M-n, C-M-p, C-M-u, C-M-d, C-M-f, C-M-b

gopcaml_move_expression_example.gif

  • AST-based code transformation -C-M-N, C-M-P, C-M-F, C-M-B

gopcaml_move_function_example.gif

  • Mark exp - C-M-SPC

gopcaml_mark_sexp.gif

  • Extract expression into letdef - C-c C-e

gopcaml_extraction_expressions.gif

This is just a small sample of the features - a full listing is provided at the project readme, which can be found at the project page.

Notes

This plugin is quite faithful to the OCaml specification and doesn't reimplement a separate OCaml parser as some other plugins do - instead I use the Ecaml package (which allows interfacing with Emacs from OCaml code) to allow delegating to the OCaml parser (from Ocaml-compiler-libs) directly.

It's in the process of being published to opam, and should be available to download soon.

Try OCaml 2.0 (beta)

Louis Gesbert announced

OCamlPro is happy to announce the release of a new version of the venerable Try OCaml tool.

This tool allows you to quickly test OCaml snippets from anywhere, directly from your browser. It's still in beta, so any issues or comments are welcome below.

The new version is a complete refactor and redesign, based on the backend of Learn-OCaml.

Original announcement: http://www.ocamlpro.com/2020/03/16/new-version-of-try-ocaml-in-beta/

jose 0.2.0

Ulrik Strid announced

I recently released a JavaScript Object Signing and Encryption library to opam.

The main usecase for JOSE is JWT and JWK and is a comprehensive library for both unlike some other libraries that currently exist in the ecosystem. It uses mirage-crypto and supports RSA and OCT keys currently and will support EC when mirage-crypto does.

I have not really implemented the encryption part yet but if anyone needs JWE I'll gladly do the work or accept PRs.

The project was initially developed in Reason but I changed over to OCaml at some point because of limitations in Reason at the time but the repo still has the old name.

The docs can be found here: https://ulrikstrid.github.io/reason-jose/

The repo can be found here: https://github.com/ulrikstrid/reason-jose/

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 online.