OCaml Weekly News
Hello
Here is the latest OCaml Weekly News, for the week of December 12 to 19, 2023.
Table of Contents
- Welcoming a new
ppxlib
maintainer - Learn-OCaml 1.0 approaching – call for testers
- cmarkit 0.3.0 – CommonMark parser and renderer for OCaml
- dream-html 2.0.0
- CAISAR release 1.0, a platform for characterizing AI safety and robustness
- Web Analytics on OCaml.org
- Tutorial on Mutability, Loops, and Imperative Programming
- RFSM version 2.0
- riot 0.0.5
- tty 0.0.1
- hooke 0.0.1 – spring-based animations library
- “OCaml on Github” bot posting on the fediverse
- Mint Tea (minttea 0.0.1) – a little TUI framework for OCaml
- Welcoming our new Outrechy interns
- zbg v0.2.0: A new version of Zero Bullshit Git
- Ppxlib dev meetings
- Other OCaml News
- Old CWN
Welcoming a new ppxlib
maintainer
Sonja Heinze announced
Hello everyone :wave: Some very good news for ppxlib
: @NathanReb will join us back as a maintainer! His maintenance work will partly be funded by the
OCaml Software Foundation.
We, the current maintainers, haven’t had much time for ppxlib
lately as we’re pretty tied up with our other projects as well. However,
ppxlib
is an important project: It’s a (transitive) dependency of about half of the
opam
ecosystem, so it should receive a good amount of maintenance attention. So it’s very reassuring to have a new maintainer with us and it’s super super nice that it’s @NathanReb, since we know that we enjoy working together and that he’ll be
a very active, thoughtful, and pragmatic maintainer.
We’ve already discussed what would currently be the most appreciated to work on, and, together with typical general maintenance, it will be to upstream
Astlib
to the compiler. Thanks to past work already done, upstreaming
Astlib
is a technically straightforward plan. Among others, it would make
ppxlib
continuously coinstallable with OCaml trunk
, and it would considerably simplify
ppxlib
maintenance. We know that it’s often confused with a different and a lot more complex plan from the past that we’ve abandoned. We’ll communicate well about this.
@NathanReb will also help during the next compiler release phase when we bump the
ppxlib
-exposed parsetree
to match the new compiler version. When we do so, as always, we’ll break a few PPXs, and we’ll make sure to patch those.
All that being said, we, the current maintainers, will keep on maintaining
ppxlib
as well. We’ve done that as part of our job at
Tarides for a while now and we know it’s important for the community and enjoy doing so. It will be nice to maintain
ppxlib
in collaboration with people from within Tarides and from outside Tarides, similarly as it is the case for other OCaml Platform tools.
Welcome back, Nathan, and thanks a lot! :slight_smile: @panglesd and @pitag
Learn-OCaml 1.0 approaching – call for testers
Louis Gesbert announced
Hello all,
It has been long maturing, but Learn-OCaml 1.0 is about to be released.
Learn-OCaml is a web platform for exercises in OCaml programming, with automated grading, originally developped for the OCaml MOOC. The interface features a code editor and client-side evaluation and grading ; it can be served statically, but if running the bundled server there are also server-side saves, facilities for teachers to follow the progress of students, give assignments, get grades, etc.
What’s new
This first major release, along with a lot of quality-of-life improvements, features a significant rewrite of the evaluation engine. The main visible consequences are:
- a nice speedup to the grading of exercises in the browser
- a huge (x100) speedup to the pre-processing of the exercises (when running
learn-ocaml build
) - exercise solutions can no longer leak (the server only provides the already compiled jsoo version to the client), making the platform more suitable for evaluations
- error messages when compiling exercises are much, much better
A few other most-wanted features have also been added, like a reworked exercise choice page, and the ability to update a running instance with minimal downtime (learn-ocaml build serve --replace
)
Future versions
Another most-wanted feature is a proper login system (with choice between email/password or a Moodle server) ; we expect it to land shortly in 1.1, once we work on the remaining rough edges of our already working prototype.
Porting to more recent versions of OCaml is also planned.
Testers required!
As this version features large internal changes, we would be very grateful to teachers who agreeing to try it out and report any regressions before publication (expected by the end of the year).
There are two recommended ways to test the upcoming version:
-
>From source: follow the online instructions, or use the following for creating a temporary installation in a local opam switch that you can easily remove afterwards:
opam update opam source learn-ocaml --dev --dir=learn-ocaml-beta && \ cd learn-ocaml-beta && \ opam switch create . --locked && \ export OPAMSWITCH=$PWD && \ eval $(opam env) learn-ocaml build serve --repo=REPOSITORY
-
Using a pre-built Docker image (with REPOSITORY an absolute path, to e.g. a local clone of the corpus — see below)
docker run --rm \ -v REPOSITORY:/repository:ro \ -v learn-ocaml-beta-sync:/sync \ -p 80:8080 \ --name learn-ocaml-beta \ ocamlsf/learn-ocaml:master
Please report in Github, or contact us directly for feedback.
Development static builds are also available at https://ocaml-sf.org/learn-ocaml/artifacts/ ; tests on the standalone client and server would be helpful (the main binary requires a host OCaml installation with the appropriate learn-ocaml libraries in order to compile the exercises, so the stand-alone version is unlikely to be of use)
The Learn-ocaml Corpus
I’d also like to take the opportunity to point out the new contributions to the public exercise corpus by Simão Melo de Sousa and Hugo Férée, which complete the existing exercises from the OCaml MOOC and the more advanced ones from François Pottier, as well as the curation work by Mohamed Hernouf and Dario Pinto.
You can test the corpus with
git clone https://github.com/ocaml-sf/learn-ocaml-corpus learn-ocaml build serve --repo=./learn-ocaml-corpus
A live version is also available.
— Louis Gesbert (OCamlPro), on behalf of the Learn-OCaml team
With thanks to the OCaml Foundation for funding the major part of this work.
cmarkit 0.3.0 – CommonMark parser and renderer for OCaml
Archive: https://discuss.ocaml.org/t/ann-cmarkit-0-3-0-commonmark-parser-and-renderer-for-ocaml/13622/1
Daniel Bünzli announced
Hello,
There’s a new release of cmarkit
, an ISC-licensed CommonMark parser and renderer for OCaml.
This is a bug fix release but it also adds a -f
option to cmarkit html
to render full-featured documents with all extensions enabled including math rendering and section anchors without hassle with
cmarkit html -f mydoc.md > mydoc.html
– before that an insane amount of options had to be specified, see
cmarkit html --help
for details.
All the details are in the release notes. Thanks to @jchavarri and @3Rafal for reporting issues.
- Homepage: https://erratique.ch/software/cmarkit
- Docs: https://erratique.ch/software/cmarkit/doc (or
odig doc cmarkit
) - Install:
opam install cmarkit
A big thanks to my donators. I welcome and thank the new donator @zbaylin.
dream-html 2.0.0
Yawar Amin announced
Hi, dream-html 2.0.0 has been released to opam: https://ocaml.org/p/dream-html/latest
Repo: https://github.com/yawaramin/dream-html API docs: https://yawaramin.github.io/dream-html/dream-html/Dream_html/index.html
Dream-html is a library for generating HTML, closely integrated with Dream. It can be used as an alternative to Dream’s built-in Embedded ML templating language. Here’s the Dream home page example using dream-html:
let hello who = let open Dream_html in let open HTML in html [] [ body [] [ h1 [] [txt "Hello, %s!" who]]] let () = Dream.run @@ Dream.logger @@ Dream.router [Dream.get "/" (fun _ -> Dream_html.respond (hello "world"))]
In this release, I made a breaking change (hence major version bump) to restrict the
capture
attribute to only the values `user
or `environment
. Previously it was accepting any format string.
Plus a small addition, the autocomplete
attribute now also accepts the
`webauthn
value.
CAISAR release 1.0, a platform for characterizing AI safety and robustness
Julien Girard announced
Dear all,
on the occasion of the 68th birthday of the Flag or Europe, we are delighted to release the version 1.0 of CAISAR. The release source is available under our
gitlab. You can install it via opam with
opam install caisar
. We also have a docker image hosted on Dockerhub packaging CAISAR and some dedicated provers. You can pull it with
docker pull laiser/caisar:pub
.
Extensions of specification language and interpretation capabilities
We extended the WhyML specification language to take into account common machine learning constructs. It is now possible to model machine learning computations using vectors and datasets. Parts of this specification can be interpreted directly by CAISAR. CAISAR can then instanciate the specification with concrete values provided by the user. CAISAR can also compute the results of operations on vectors such as getting an index on a concrete vector, or normalizing a dataset. Finally, this language allows to perform transformations on the proof goals that makes them more amenable for provers.
The end result is a cleaner modelling language that behaves “as expected” for the user, bridging the gap between the specification and the actual system to verify. We believe that this will surely be helpful for the community.
Check the updated documentation examples to get a grasp on the new language.
Usability
It is now possible to specify which theories and/or goals to check within a specification. CAISAR is now available as a Nix flake. We plan to make it available on nixpkgs in a future release. We added a contribution guide in the manual, under the “Contributing” section.
Merry end-of-year celebrations!
Web Analytics on OCaml.org
Thibaut Mattio announced
I’m pleased to announce that we’ve rolled out the Plausible instance on the OCaml.org infrastructure.
The public dashboard is currently accessible at https://plausible.ci.dev/ocaml.org, and we plan to update the OCaml.org DNS to provide a plausible.ocaml.org URL.
This is already showing very interesting results (the new Getting Started documentation are the most visited pages of the site!), and we can’t wait to see how the improvements we’re making to OCaml.org are reflected in the usage of the site.
As a reminder, Plausible is a privacy-focused Web analytics service, which we self-host on the OCaml.org infrastructure. No personal data is collected and we remain fully compliant with GDPR, CCPA and PECR. The information you have on the public dashboard is the information we have, and as you can see, this is all aggregated information which is never traced to individuals. Don’t hesitate to read more about what Plausible does to respect your privacy at https://plausible.io/privacy-focused-web-analytics.
Thank you all!
Tutorial on Mutability, Loops, and Imperative Programming
Archive: https://discuss.ocaml.org/t/tutorial-on-mutability-loops-and-imperative-programming/13644/1
Cuihtlauac Alvarado announced
Dear OCamlers,
The OCaml.org is happy to announce the release of the Mutability, Loops, and Imperative Programming tutorial which was discussed here a couple of weeks ago. We’ve included feedback from that thread.
The target audience is developers learning OCaml. No functional programming knowledge is assumed. However, it comes after the updated “Get Started” series:
And it comes at the end of the “Introduction” series (currently being updated too):
- Values and Functions
- Basic Datatypes and Pattern Matching
- If Statements and Recursions
- Lists
- Labelled & Optional Arguments
- Mutability, Loops, and Imperative Programming
The initial PR is now closed, but this is open source. We’re happy to receive feedback here or in GitHub, as issues or PR. You can also use the “Contribute” link at the bottom of the staging page.
Thanks to @zbaylin, @silene and @K_N for their feedback on the draft.
Hope it helps
RFSM version 2.0
jserot announced
It’s my pleasure to announce the availability of version 2.0
of the
RFSM
language and compiler.
RFSM
is a domain specific language for describing, simulating and generating code from
reactive finite state machines.
>From a description of a system composed of a set of reactive FSMs, the
RFSM
compiler can generate
- graphical description of the system in the
.dot
format - execution traces in the
.vcd
file format - code in
C
,SystemC
andVHDL
for simulation or implementation on a target platform
The most significant changes since version 1.7 are
- an entirely recrafted, modular implementation
- a full formal semantics for the “core” version of the language
- a documentation now splitted in a User Manual and a Reference Manual
RFSM
is available from this
GH page or as an OPAM package.
Comments, feedbacks and bug reports welcome !
riot 0.0.5
ostera announced
Hi folks :wave: just released Riot v0.0.5 on opam with some quality of life improvements, and a bunch of bug fixes:
- You can now do communication by name by registering a pid. Names are currently strings – this helps in situations where you need a globally known process but you can’t thread the actual process id everywhere.
- Timers should be working correctly now :upside_down_face:
- I/O should behave more reasonably when reading/writing to closed fds – no more pesky SIGPIPEs killing your app without reason.
You can read the changelog here.
If you’re interested in contributing, there’s a few issues tagged with `help wanted`, but don’t hesitate to reach out to me on Discord/X: @leostera
Happy hacking! :tada:
Richard Huxton then added
Riot is an actor-model multi-core scheduler for OCaml 5. It brings Erlang-style concurrency to the language, where lightweight processes communicate via message-passing.
Just to give some context.
tty 0.0.1
ostera announced
Hi folks :wave: just released tty v0.0.1 on opam.
tty
is a pure OCaml library for directly interacting with the terminal, that I’m using to build
Mint Tea:
This first release includes:
- High-level
Terminal
module for controlling a terminal (with functions likecursor_up n
) - Non-blocking reading of UTF-8 input from stdin in the
Stdin
module - Terminal ~Profile~s for determining what color palettes are available
- A
Color
module for parsing and working with RGB/ANSI/ANSI256 colors - A collection of 60 escape sequence functions in
Escape_seq
- a lot of room for improvement!
If you’re interested in contributing, there’s a few issues tagged with help wanted
, but don’t hesitate to reach out to me on Discord/X: @leostera
Happy hacking! :tada:
hooke 0.0.1 – spring-based animations library
ostera announced
Hi folks :wave: just released hooke v0.0.1 on opam.
hooke
is a simple, efficient spring animation library for smooth, natural motion. It can be used for many things, including TUI applications or games:
If you’re interested in contributing don’t hesitate to reach out on Discord/X: @leostera
Happy hacking! :tada:
“OCaml on Github” bot posting on the fediverse
Zoggy announced
Hello,
I’m glad to announce a new bot which might be of interest for people on the Fediverse: the OCaml on Github bot.
This bot checks for events on the `ocaml/ocaml` Github project and publishes some of them on the Fediverse. By now only some issue events are published (comment creation,deletion,update and opening/closing of issues).
The bot is implemented using an ActivtyPub library not released yet. It acts as a client for a self-hosted federated server developed using the same library. Both should be released soon (maybe february).
Do not hesitate to follow the bot :slight_smile: The server is not a Mastodon server, so you won’t be able to follow it from the html page. You can follow it from this post for example. (Mastodon is not an Activitypub client, but a server capturing users)
Mint Tea (minttea 0.0.1) – a little TUI framework for OCaml
Archive: https://discuss.ocaml.org/t/ann-mint-tea-minttea-0-0-1-a-little-tui-framework-for-ocaml/13650/1
ostera announced
Hi folks :wave: just released minttea v0.0.1 on opam.
Mint Tea is a fun, functional, and stateful way to build terminal apps in OCaml heavily inspired by BubbleTea. Mint Tea is built on Riot and uses The Elm Architecture.
It includes plenty of examples of what you can build with it:
Toggling AltScreen
Stopwatch
Multiple Views/Pages
Bouncing Ball / Spring-based physics
Alongside this release there’s also its sibling packages:
- spices v0.0.1 – a styling library for TUI applications
- and leaves v0.0.1 – a reusable component library
You can read the full changelog here.
If you’re interested in contributing to any of these, there’s a few good first issues open already, and don’t hesitate to reach out on Discord/X: @leostera :slight_smile:
Happy hacking! :tada:
Welcoming our new Outrechy interns
Guillaume Petiot announced
Hello everyone :) We’ve just started an amazing new round of Outreachy internships. Outreachy is a non-profit organization providing a structure for people underrepresented in open-source to do 3 months long internships in an open-source community. In the OCaml community, this Outreachy round, we’ve come up with four internship projects from different contexts. For three of them, we are fortunate to now have the following highly dedicated and enthusiastic interns working and being actively engaged in them:
- @Seun is working on implementing a dark mode on ocaml.org. The project idea is to implement a dark theme for the website, and to choose a dark or light theme on the website based on the system preferences of the user. Mentors: @SaySayo and @punchagan
- @fay is working on ocaml-joy, a creative coding library to draw geometric objects in OCaml. This is inspired by the python library of the same name. Joy offers the ability to draw simple shapes, perform transformations on them, and compose those transformations. This will be a great tool for teaching programming as well as creating art in a functional way. Mentors: @nikochiko and @sudha
- @idara_nabuk is working on improving the GUI experience in OCaml. This has been inspired by Rust’s Are We GUI Yet?, and aims at doing a survey of the GUI libraries, writing documentation, tutorials and examples to benefit the community and make OCaml more GUI-friendly. Mentors: @gpetiot and @moazzammoriani
- Unfortunately no intern was selected for the OCaml R*-tree project this round, but lots of great features, examples and tests were added during the contribution period.
It’s very gratifying to work as mentors and organizers on those projects and to see both the interns and the projects grow every day. As to who we are: We’re a mixed group of OCaml enthusiasts, some of whom work at Tarides and others don’t. Tarides has been letting employees be engaged in Outreachy internships and do other diversity and/or mentoring work as part of our job for a while now! And since last Outreachy round, the Tarides-external mentors are funded for their mentor efforts from Jane Street and Tarides. We appreciate both a lot!
Please, welcome @Seun, @fay and @idara_nabuk to the community! We’re looking forward to how the internships are going to evolve, @moazzammoriani, @gpetiot, @punchagan, @SaySayo, @nikochiko, @sudha, @pitag
zbg v0.2.0: A new version of Zero Bullshit Git
Dmitrii Kovanikov announced
Hi everyone :wave:
8 months ago I announced my first ever open-source OCaml project
After quite a while, I’m happy to announce the second release!
Version 0.2.0 brings the new command zbg done
and fixes several pitfalls in the initial implementation. The full changelog can be found on GitHub:
Remarkably, all the improvements and bug fixes in this version were made by external contributors! :exploding_head:
It warms my heart to be a part of such a vibrant and supportive community :orange_heart: I’m using
zbg
as a project to learn OCaml and scratch my personal itch. Imagine my surprise when I learned that other people not only use
zbg
as well but also contribute important improvements!
Anyway, happy coding everyone and let me know any feedback you have :hugs:
Ppxlib dev meetings
Sonja Heinze announced
@panglesd and I are going to have a probably quite quick December dev meeting tomorrow, concretely [date=2023-12-19 time=18:00:00 timezone=“Europe/Madrid”]. Here’s our agenda:
- 0.32.0 release
- Reason for the release:
Attribute
API addition. - Preparation for the release: What else to merge before the release?
- Caution for the release:
Caml
->Stdlib
change.
- Reason for the release:
- Compiler change of AST context format.
- Are there still use cases where the ppx driver is compiled on a different OCaml version than the project is compiled with? In those cases, that compiler change would affect us.
- Change of philosophy for
trunk-support
branch.
As always, we’re happy to add anything to the agenda! And also, as always, we’re happy if anyone wants to join: https://meet.google.com/yxw-ejnu-cju . That’s true in general and particularly if you have insight about the use case question in point 2 from the agenda (also happy to hear about it here on discuss).
Other OCaml News
From the ocaml.org blog
Here are links from many OCaml blogs aggregated at the ocaml.org blog.
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.