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

Alan Schmitt
2025-08-19T12:20:57Z

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

Hello

Here is the latest OCaml Weekly News, for the week of August 12 to 19,
2025.

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

httpcats, ocaml-h1, vif, and hurl: a webstack for OCaml 5
Why Lean 4 replaced OCaml as my Primary Language
Reminder: You Can Still Come to Warsaw for FUN OCaml
Other OCaml News
Old CWN

httpcats, ocaml-h1, vif, and hurl: a webstack for OCaml 5
═════════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/ann-httpcats-ocaml-h1-vif-hurl-a-webstack-for-ocaml-5/17104/1>

Calascibetta Romain announced
─────────────────────────────

I am delighted to announce the release of `httpcats.0.1.0', `ocaml-h1'
(including WebSockets support), and the experimental release of `vif',
a web framework for OCaml 5, and `hurl', an HTTP client in OCaml.

`ocaml-h1'
╌╌╌╌╌╌╌╌╌╌

[`ocaml-h1'] is an authorised fork of [http/af] (after explicit
permission from its author) in order to continue its development and
release process. It was created in May 2024 and now includes support
for websockets (and connection upgrades) thanks to the work of @swrup.

[`ocaml-h1'] <https://github.com/robur-coop/ocaml-h1>

[http/af] <https://github.com/inhabitedtype/httpaf>

`httpcats', a HTTP client/server with [`miou']
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

It was in 2023 that we began experimenting with OCaml 5 and HTTP
requests withthe [`httpcats'] project:

<https://x.com/Dinoosaure/status/1710320603113095538>

This project allowed us to consolidate some of our libraries, such
as~mirage-crypto~, in order to move beyond OCaml 5 and, in particular,
to resolve the few data-races we had (having started some of our
projects before OCaml multicore was even mentioned).

After some fairly extensive maintenance work, we were finally able to
lay the groundwork for an OCaml HTTP client that can make parallel
requests using Miou.

`httpcats' has therefore improved over time and offers a fairly simple
way to make HTTP requests in OCaml (thanks to our experience with
[http-lwt-client]) and to implement an HTTP server that can handle
incoming HTTP requests in parallel. The [documentation] has been
improved and is particularly comprehensive (with examples) so that
users have complete control over all the protocol layers required for
communication with web service: from the Unix socket to the TLS
/handshake/ (including ALPN negotiation), including domain name
resolution.

`httpcats' also partially synthesizes our work on
protocols. Everything needed to communicate with web services is
implemented in OCaml:

• [`ocaml-tls'] is used for the TLS protocol
• [`ocaml-h1'] and [`ocaml-h2'] are used for the HTTP protocol
(`http/1.1' and `h2')
• [`ocaml-dns'] and [`happy-eyeballs'] are used for domain name
resolution and the ability to prefer IPv6 connections or, at best,
the fastest TCP/IP connections

Finally, benchmarking work has been initiated, the origins of which
can be found [here], showing the results that can be achieved with
`httpcats' as a server. The benchmark is reproducible and available
[here], and here are the results we obtained (on AMD Ryzen 9 7950X
16-Core Processor):

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
clients threads latencyAvg latencyMax latencyStdev totalRequests
───────────────────────────────────────────────────────────────────────
16 16 47.43us 2.27ms 38.48us 5303700
32 32 71.73us 1.04ms 47.58us 7016729
64 32 140.29us 5.72ms 121.50us 7658146
128 32 279.73us 11.35ms 287.92us 7977306
256 32 519.02us 16.89ms 330.20us 7816435
512 32 1.06ms 37.42ms 534.14us 7409781
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[`miou'] <https://github.com/robur-coop/miou>

[`httpcats'] <https://github.com/robur-coop/httpcats>

[http-lwt-client] <https://github.com/robur-coop/http-lwt-client>

[documentation]
<https://ocaml.org/p/httpcats/latest/doc/httpcats/Httpcats/index.html>

[`ocaml-tls'] <https://github.com/mirleft/ocaml-tls>

[`ocaml-h1'] <https://github.com/robur-coop/ocaml-h1>

[`ocaml-h2'] <https://github.com/anmonteiro/ocaml-h2>

[`ocaml-dns'] <https://github.com/mirage/ocaml-dns>

[`happy-eyeballs'] <https://github.com/robur-coop/happy-eyeballs>

[here]
<https://discuss.ocaml.org/t/lwt-multi-processing-much-more-performant-than-eio-multi-core/16395>

[here] <https://github.com/TechEmpower/FrameworkBenchmarks/pull/10009>

`hurl', a command-line tool to make HTTP requests in OCaml
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

To complete our work, we have developed a tool that allows HTTP
requests to be made from the command line: [`hurl']. This tool is
still in the experimental phase, but it allows us to activate an
improvement loop between `httpcats' and the real world by testing
certain types of requests.

Here is a screenshot of the tool (`hurl https://discuss.ocaml.org
--print dishHrR'):

<https://us1.discourse-cdn.com/flex020/uploads/ocaml/optimized/2X/c/c4ad56b5362ea166e3ca365e0ea4355a47ef3d11_2_1004x1000.png>

The purpose of this tool is to facilitate the tests we would like to
perform with a web server by allowing the user to specify the content
of requests (and whether this content should be JSON or
`multipart/form-data') and obtain a whole bunch of information such as
the response given by the service, the server’s IP address, and the
result of the TLS handshake.

[`hurl'] <https://github.com/robur-coop/hurl>

`vif', a simple web framework for OCaml 5
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Finally, to complete our work, we have also developed a new web
framework based on `httpcats' and `miou' in order to obtain a web
server capable of handling parallel requests: [`vif']. Like `hurl',
`vif' is still in the experimental stage. However, we are currently
able to produce small web applications and we will present this
project at the next [FUN OCaml session] (come along!).

A tutorial explaining how to make a chatroom in OCaml is available
[here].

The objective of vif is to provide a small framework for developing
web applications. In addition, it offers a tool called `vif', which is
a *native* OCaml interpreter that allows you to launch a web server
from an OCaml script. Here is a simple example from the command line:

┌────
│ $ opam install -y vif hurl
│ $ cat >main.ml <<EOF
│ #require "vif" ;;
│
│ let default req server () =
│ let open Vif.Response.Syntax in
│ let field = "content-type" in
│ let* () = Vif.Response.add ~field "text/html; charset=utf-8" in
│ let* () = Vif.Response.with_string req "Hello World!" in
│ Vif.Response.respond `OK
│ ;;
│
│ let routes =
│ let open Vif.Uri in
│ let open Vif.Route in
│ [ get (rel /?? nil) --> default ]
│
│ let () =
│ Miou_unix.run @@ fun () ->
│ Vif.run routes ()
│ ;;
│ EOF
│ $ vif --pid vid.pid main.ml &
│ $ hurl http://localhost:8080/ -p b
│ Hello World!
│ $ kill -SIGINT $(cat vid.pid)
└────

Like all projects in our cooperative, it is open to contributions and
improvements. The workshop we will be hosting at FUN OCaml will be an
opportunity for us and for you to participate in these projects.

[`vif'] <https://github.com/robur-coop/vif>

[FUN OCaml session] <https://fun-ocaml.com/>

[here] <https://robur-coop.github.io/vif/>

Conclusion
╌╌╌╌╌╌╌╌╌╌

Based on the dates provided, it is clear that this was a substantial
and lengthy undertaking. It is the result of the work of several
individuals and our cooperative (both technical and social).

We would like to thank everyone who participated in any way in the
development of this software and its integration into the OCaml
ecosystem (notably through miou’s support for certain libraries such
as [caqti]).

We hope that many of you will attend our workshop (for the FUN OCaml
itself, and also to meet us) and hope that you will enjoy Vif in
particular. If you like our work, you can also make a donation to our
cooperative (via [GitHub] or directly using [an IBAN]).

Happy hacking!

[caqti] <https://github.com/paurkedal/ocaml-caqti/pull/117>

[GitHub] <https://github.com/sponsors/robur-coop>

[an IBAN] <https://robur.coop/Donate>

Why Lean 4 replaced OCaml as my Primary Language
════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/why-lean-4-replaced-ocaml-as-my-primary-language/17109/1>

Shon announced
──────────────

<https://kirancodes.me/posts/log-ocaml-to-lean.html>

Reminder: You Can Still Come to Warsaw for FUN OCaml
════════════════════════════════════════════════════

Archive:
<https://discuss.ocaml.org/t/reminder-you-can-still-come-to-warsaw-for-fun-ocaml/17110/1>

Sabine Schmaltz announced
─────────────────────────

Hey everyone,

we still have a few tickets left for FUN OCaml
(<https://fun-ocaml.com>)!

This is your chance to meet a lot of great OCaml folks, attend the
talks on day 1, have some interesting discussions, and learn a lot in
the hands-on workshops offered on day 2.

If you haven’t used OCaml before: no problem, we have a beginner
workshop to get you started!

Best of all it’s free for attendees (admission + food included),
thanks to our generous sponsors.

Cheers Sabine

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

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

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

• [Upcoming OCaml Events]
• [Why I chose OCaml as my primary language]

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

[Upcoming OCaml Events] <https://ocaml.org/events>

[Why I chose OCaml as my primary language]
<https://xvw.lol/en/articles/why-ocaml.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: 23328 bytes --]