caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alan Schmitt <>
To: "lwn" <>, "cwn"  <>,
Subject: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
Date: Tue, 14 Jun 2022 11:29:56 +0200	[thread overview]
Message-ID: <> (raw)

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


Here is the latest OCaml Weekly News, for the week of June 07 to 14,

Table of Contents

Lwt informal user survey
Tutorial: Full-Stack Web Dev in OCaml w/ Dream, Bonsai, and GraphQL
dkml-c-probe: Cross-compiler friendly definitions for C compiling
Htmx/hc web development approach
Engineer and postdoc positions in France (various labs) to work on a proof assistant for crypto protocols
Yojson 2.0.0
opentelemetry 0.2

Lwt informal user survey

  Archive: <>

Continuing this thread, Raphaël Proust said

  Thanks to everyone who took the time to answer the polls above. I've
  now closed them.

  The first pull-request to come out of this poll is
  [<>](removing support for
  OCaml<=4.07). This was the cutoff in the poll. It removes a lot of
  `#if' preprocessing statements and a few workarounds to stay
  compatible with old Stdlib interfaces. Thanks to @hannes for
  contributing most of the commits on this pull-request.  If support for
  OCaml<=4.07 is important to you, please participate in the
  pull-request's discussion or on this thread.

  Stay tuned for more. (But also be patient.)

Tutorial: Full-Stack Web Dev in OCaml w/ Dream, Bonsai, and GraphQL


Continuing this thread, jerben asked and Daniel Bünzli replied

        Very interesting, did you write somewhere about how it
        compares to htmx?

  Not really.

  As far as I can remember I liked the ideas but found their execution
  to be a bit lacking, sometimes ad-hoc in their attribute DSL, focusing
  more on the show off to convince single page application proponents of
  the approach than on a clear conceptual model (which `hc' tries to
  detail in the manual [here]).

  Two other things that come to mind are:

  1. AFAIR their examples relied a lot on unique `id' attributes for
     targeting request results. Unless you find a principled and
     automated way to generate these that's not compositional and
     brittle. In `hc' I [extended the CSS selector syntax] to allow to
     address your ancestors (peace be upon them). That's more
     compositional but now you become sensitive to structural changes in
     your markup – pick your poison[^1].
  2. I'm no longer sure about that, i.e. don't take my word for it, but
     I think their DSL allowed to spread the definition of an
     interaction among many elements which made it more difficult to
     understand what is happening. In `hc' all attributes defining the
     effects of an interaction are always located on a single element,
     the element that performs the request.

  Finally when things go wrong I prefer to have to understand [700 lines
  of ml] rather than [2800 lines of JavaScript] (note that they likely
  have better legacy browser support and more functionality).

  In any case there's a long list of todos in `hc' and it likely needs
  one or two more design rounds before getting to something decent – if
  that's even remotely possible on the web.

        Dang it @dbuenzli one day you’ll run out of letters and
        need to come up with an actual name for your libraries.

  Mind you I tried to use three letters once, but the whole experience
  turned out to be [extremely unpleasant] :–)

  [^1]: Using unique ids reifed in an OCaml EDSL could be a better idea.

[here] <>

[extended the CSS selector syntax]

[700 lines of ml]

[2800 lines of JavaScript]

[extremely unpleasant]

dkml-c-probe: Cross-compiler friendly definitions for C compiling


jbeckford announced

  V3 is available. Its `C_abi' module has some big enhancements:
  • cleaner API (thanks @mseri!)
  • recognizes the BSD family: OpenBSD, FreeBSD, NetBSD and DragonFly on
    x86_64 hardware
  • integration testing now includes OpenBSD, FreeBSD and one
    cross-compiling toolchain (macOS x86_64 host that targets arm64)

  V3 also has a new module `C_conf' which occupies the same problem
  space as `findlib / ocamlfind' and `pkg-config':
  • Unlike `findlib' which is a specification+tool for 3rd party OCaml
    libraries, `C_conf' is a specification+tool for foreign C libraries
  • Unlike `pkg-config' which is a specification+tool for system (host
    ABI) C libraries, `C_conf' is a specification+tool for the multiple
    ABIs that are present when you cross-compile OCaml or C code
  • Unlike `pkg-config' which is designed for Unix, `C_conf' is designed
    for Windows and Unix where paths may have spaces, backslashes and
  • For now the specification is based on environment variables. If it
    proves useful the specification can be extended.

  Examples and doc links for V3 are available at


Marcello Seri asked and jbeckford replied

        Thanks a lot for the update! Can you say a bit more about
        how `C_conf' works?

  C_conf has a detailed problem statement and spec at
  (which is linked to on the dkml-c-probe README).

  I probably shouldn't regurgitate the doc here, so I'll take a few key
  pieces from the doc and then post some things here that I didn't put
  on that doc page …

  1. Here is my configuration for locating the "gmp" library on my Apple
     Silicon host machine that cross-compiles to x86_64:

     │ CP_GMP_CC_DEFAULT                 = -IZ:/build/darwin_arm64/vcpkg_installed/arm64-osx/include
     │ CP_GMP_CC_DEFAULT_DARWIN_X86_64   = -IZ:/build/darwin_x86_64/vcpkg_installed/x64-osx/include
     │ CP_GMP_LINK_DEFAULT               = -LZ:/build/darwin_arm64/vcpkg_installed/arm64-osx/lib;-lgmp
     │ CP_GMP_LINK_DEFAULT_DARWIN_X86_64 = -LZ:/build/darwin_x86_64/vcpkg_installed/x64-osx/lib;-lgmp

     • The other direction may be more interesting, since the free
       GitHub Actions only supports x86_64. The scenario of taking a
       macOS x86_64 GitHub host and cross-compiling to Apple Silicon is
       [implemented and partially tested].
  2. I am using a C package manager (vcpkg) to give me cross-compiled
     libraries and the flags for the target ABI (in this case
     darwin_x86_64 is the target ABI). In general it doesn't matter
     where you get your target ABI compatible libraries from. Example:
     When I'm cross-compiling to Android on a Windows x86_64 host, the
     Android Studio environment gives me some libraries for an Android
     Emulator (host ABI) and also prebuilt libraries for 4 Android
     device ABIs:

     │ Directory: C:\Users\xxx\AppData\Local\Android\Sdk\ndk\23.1.7779620\prebuilt
     │ Mode                 LastWriteTime         Length Name
     │ ----                 -------------         ------ ----
     │ d-----        10/20/2021   8:27 PM                android-arm
     │ d-----        10/20/2021   8:27 PM                android-arm64
     │ d-----        10/20/2021   8:27 PM                android-x86
     │ d-----        10/20/2021   8:26 PM                android-x86_64
     │ d-----        10/20/2021   8:27 PM                windows-x86_64
  3. The `CP_clibrary_CC_DEFAULT_abi' configuration relies on `abi' (the
     ocamlfind toolchain name) being standardized. The `gmp' library,
     for example, is used by many OCaml packages; I wanted one
     configuration for `gmp', not one configuration for each `(gmp,
     OCaml package)' combination. In fact, getting a consistent `abi'
     naming was one of my motivations for releasing `dkml-c-probe'. I
     don't think the prior art got this right … the very stale
     [opam-cross-android] project uses [`abi = "android"'] which is
     insufficient to differentiate the 5+ sets of libraries available in
     Android Studio.
  4. The "gmp" (etc.) configuration is done once in a familiar syntax
     (`-L, -I, -l'). However the `C_conf' library will parse and print
     the configuration in the appropriate C compiler syntax. When the
     MSVC compiler is used you get MSVC style linking:
     │ [
     │   "-LIBPATH:Z:/build/darwin_x86_64/vcpkg_installed/x64-osx/lib";
     │   "gmp.lib"
     │ ]
     MSVC and GCC conventions are supported today in `C_conf'.
  5. A real example of using `C_conf' is in my customization of [zarith
     library]. It checks `C_conf' first to see whether the user has the
     host/target ABI configuration; if it doesn't it falls back to

  The trend of using `pkg-config' in OCaml packages makes both native
  Windows and cross-compilation difficult. At the moment *we
  unintentionally shoot ourselves in the foot* because [Dune
  documentation encourages `pkg-config'] for understandable reasons. I
  hope `dkml-c-probe' can break that trend.

[implemented and partially tested]

[opam-cross-android] <>

[`abi = "android"']

[zarith library]

[Dune documentation encourages `pkg-config']

Htmx/hc web development approach


Vladimir Keleshev announced asked

  @cemerick, @yawaramin, @dbuenzli, and others who've used htmx/hc with
  OCaml back-end: what is your experience with templating? It seems that
  htmx/hc puts high requirements on a flexible HTML templating/DSL. What
  did you choose and is it working out for you?

Daniel Bünzli replied

  I'm using OCaml and an absolutely [trivial HTML generation
  library]. If you want to see a real world example head to the
  `*_html.{ml,mli}' files in [this directory] (more on the structure
  found there [here])

  Works quite well for me but I'd say the problem is not really
  templating it's rather non-brittle URL management. For that I use
  [this module] which while I'm not entirely convinced by it yet, allows
  me to type them and avoid the stringly unchecked dependendencies so
  characteristic of the web development world.

[trivial HTML generation library]

[this directory]


[this module]

Chas Emerick also replied

  Yeah, you're right on that point.

  I'm using tyxml for 99% of my HTML generation, specifically its jsx
  ppx. I am judicious about keeping the main logics of the project in
  OCaml proper; `.re' files exist exclusively to hold markup. The end
  result is a _very_ pleasant environment IMO. In the end, I dearly wish
  there was a way to get actual HTML syntax into `.ml' files (I am no
  fan of reason syntax outside of jsx, and I suspect the sorta-legacy
  jsx toolchain leftover from reasonml will end up being a tech risk
  over time), but as things stand, it's the best option I've found.

Yawar Amin also replied

  I'm just using Dream's 'built-in' templating, 'Embedded ML (.eml)', it
  works reasonably well–each template or partial is just a function that
  you define to take some arguments and return some markup. It even
  auto-escapes to prevent injection attacks. E.g.,

  │ let card name =
  │   <div class="card"><%s name %></div>

  There are a couple of tricks to be aware of with the EML syntax but in
  general it works well.

Simon Cruanes also replied

  For the little webdev I do (internal tools mostly for myself), I've
  also been using server side html generation, with my own `wheels'
  tools and a bit of htmx.

  Here's an excerpt from a personal project, with my own httpd and html
  combinators; it adds a root to handle `/thy/<some string>':

  │ let h_thy (self:state) : unit =
  │   H.add_route_handler self.server
  │     H.Route.(exact "thy" @/ string_urlencoded @/ return) @@ fun thy_name req ->
  │   let@ () = top_wrap_ req in
  │   let thy = Idx.find_thy thy_name in
  │   let res =
  │     let open Html in
  │     [
  │       div[cls "container"][
  │ 	h3[][txtf "Theory %s" thy_name];
  │ 	Thy_file.to_html thy;
  │ 	div [
  │ 	  "hx-trigger", "load";
  │ 	  "hx-get", (spf "/eval/%s" @@ H.Util.percent_encode thy_name);
  │ 	  "hx-swap", "innerHtml"] [
  │ 	  span[cls "htmx-indicator"; "ind"][
  │ 	    txt "[evaluating…]";
  │ 	  ]
  │ 	];
  │       ]
  │     ]
  │   in
  │   reply_page ~title:(spf "theory %s" thy_name) req res

Engineer and postdoc positions in France (various labs) to work on a proof assistant for crypto protocols


David Baelde announced

  We are looking for engineers and postdocs to work on Squirrel, a proof
  assistant dedicated to proving cryptographic protocols. We have a
  broad range of projects in mind, ranging from pure OCaml development
  to involved protocol formalizations, with several theoretical
  questions in between. If you'd like to work on some of these aspects
  for one or more years, please get in touch with us!

  More details can be found here:


Yojson 2.0.0

  Archive: <>

Marek Kubica announced

  This Friday, it is my pleasure to announce the release of Yojson
  2.0.0. You can get it [in your local OPAM repository].

  Key highlights include:

  • Fewer dependencies: Given Yojson is a common dependency we cut down
    on its dependencies so you have to install less and have less
    transitive dependencies
  • `Seq' interface: Since OCaml 4.14 deprecates `Stream' and 5.0
    removes it, this was a good time to change to this interface
  • `Buffer' interface: coming along with #1, we changed Yojson to use
    `Buffer' wherever it was using `Biniou' types before

  Thanks to everybody involved in this release!

  If Yojson sounds like an interesting project for you to contribute,
  [join us].

  Full changelog follows:

[in your local OPAM repository]

[join us] <>




  • Removed dependency on easy-format and removed `pretty_format' from
    `Yojson', `Yojson.Basic', `Yojson.Safe' and `Yojson.Raw'. (@c-cube,
  • Removed dependency on `biniou', simplifying the chain of
    dependencies. This changes some APIs:
    ‣ `Bi_outbuf.t' in signatures is replaced with `Buffer.t'
    ‣ `to_outbuf' becomes `to_buffer' and `stream_to_outbuf' becomes
    (@Leonidas, #74, and @gasche, #132)
  • Removed `yojson-biniou' library
  • Removed deprecated `json' type aliasing type `t' which has been
    available since 1.6.0 (@Leonidas, #100).
  • Removed `json_max' type (@Leonidas, #103)
  • Removed constraint that the "root" value being rendered (via either
    `pretty_print' or `to_string') must be an object or
    array. (@cemerick, #121)
  • Removed `validate_json' as it only made sense if the type was called
    `json'.  (@Leonidas, #137)


  • Add an opam package `yojson-bench' to deal with benchmarks
    dependency (@tmcgilchrist, #117)
  • Add a benchmark to judge the respective performance of providing a
    buffer vs letting Yojson create an internal (#134, @Leonidas)
  • Add an optional `suf' keyword argument was added to functions that
    write serialized JSON, thus allowing NDJSON output. Most functions
    default to not adding any suffix except for `to_file' (#124,
    @panglesd) and functions writing sequences of values where the
    default is `\n' (#135, @Leonidas)


  • The `stream_from_*' and `stream_to_*' functions now use a `Seq.t'
    instead of a `Stream.t', and they are renamed into `seq_from_*' and
    `seq_to_*' (@gasche, #131).


  • Avoid copying unnecessarily large amounts of strings when parsing
    (#85, #108, @Leonidas)
  • Fix `stream_to_file' (#133, @tcoopman and @gasche)

opentelemetry 0.2

  Archive: <>

Simon Cruanes announced

  It is my pleasure to announce the release of [ocaml-opentelemetry]
  0.2. This library provides a core instrumentation library, as well as
  exporters, for the [opentelemetry] standard for observability; it
  encompasses distributed tracing, metrics, and (more recently) log
  export. A lot of tools are compatible with opentelemetry these days,
  including Grafana, DataDog, jaeger, etc.

  This is still very early days for ocaml-opentelemetry, feedback and
  contributions are welcome.


[opentelemetry] <>



Gerd Stolpmann announced

  I just released omake-0.10.5, the build utility, which fixes the
  broken installation of version 0.10.4 from last week.

  For docs and the download link see
  <>. opam is underway.



Gerd Stolpmann announced

  findlib-1.9.5 is out, fixing some scripting errors in the version
  1.9.4 from last week.

  For manual, download, manuals, etc. see here:


  An updated OPAM package will follow soon.


  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

  If you also wish to receive it every week by mail, you may subscribe

  [Alan Schmitt]

[send me a message] <>

[the archive] <>

[RSS feed of the archives] <>

[online] <>

[Alan Schmitt] <>

[-- Attachment #2: Type: text/html, Size: 36894 bytes --]

             reply	other threads:[~2022-06-14  9:30 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14  9:29 Alan Schmitt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-26 17:54 Alan Schmitt
2022-07-19  8:58 Alan Schmitt
2022-07-12  7:59 Alan Schmitt
2022-07-05  7:42 Alan Schmitt
2022-06-28  7:37 Alan Schmitt
2022-06-21  8:06 Alan Schmitt
2022-06-07 10:15 Alan Schmitt
2022-05-31 12:29 Alan Schmitt
2022-05-24  8:04 Alan Schmitt
2022-05-17  7:12 Alan Schmitt
2022-05-10 12:30 Alan Schmitt
2022-05-03  9:11 Alan Schmitt
2022-04-26  6:44 Alan Schmitt
2022-04-19  5:34 Alan Schmitt
2022-04-12  8:10 Alan Schmitt
2022-04-05 11:50 Alan Schmitt
2022-03-29  7:42 Alan Schmitt
2022-03-22 13:01 Alan Schmitt
2022-03-15  9:59 Alan Schmitt
2022-03-01 13:54 Alan Schmitt
2022-02-22 12:43 Alan Schmitt
2022-02-08 13:16 Alan Schmitt
2022-02-01 13:00 Alan Schmitt
2022-01-25 12:44 Alan Schmitt
2022-01-11  8:20 Alan Schmitt
2022-01-04  7:56 Alan Schmitt
2021-12-28  8:59 Alan Schmitt
2021-12-21  9:11 Alan Schmitt
2021-12-14 11:02 Alan Schmitt
2021-11-30 10:51 Alan Schmitt
2021-11-16  8:41 Alan Schmitt
2021-11-09 10:08 Alan Schmitt
2021-11-02  8:50 Alan Schmitt
2021-10-19  8:23 Alan Schmitt
2021-09-28  6:37 Alan Schmitt
2021-09-21  9:09 Alan Schmitt
2021-09-07 13:23 Alan Schmitt
2021-08-24 13:44 Alan Schmitt
2021-08-17  6:24 Alan Schmitt
2021-08-10 16:47 Alan Schmitt
2021-07-27  8:54 Alan Schmitt
2021-07-20 12:58 Alan Schmitt
2021-07-06 12:33 Alan Schmitt
2021-06-29 12:24 Alan Schmitt
2021-06-22  9:04 Alan Schmitt
2021-06-01  9:23 Alan Schmitt
2021-05-25  7:30 Alan Schmitt
2021-05-11 14:47 Alan Schmitt
2021-05-04  8:57 Alan Schmitt
2021-04-27 14:26 Alan Schmitt
2021-04-20  9:07 Alan Schmitt
2021-04-06  9:42 Alan Schmitt
2021-03-30 14:55 Alan Schmitt
2021-03-23  9:05 Alan Schmitt
2021-03-16 10:31 Alan Schmitt
2021-03-09 10:58 Alan Schmitt
2021-02-23  9:51 Alan Schmitt
2021-02-16 13:53 Alan Schmitt
2021-02-02 13:56 Alan Schmitt
2021-01-26 13:25 Alan Schmitt
2021-01-19 14:28 Alan Schmitt
2021-01-12  9:47 Alan Schmitt
2021-01-05 11:22 Alan Schmitt
2020-12-29  9:59 Alan Schmitt
2020-12-22  8:48 Alan Schmitt
2020-12-15  9:51 Alan Schmitt
2020-12-01  8:54 Alan Schmitt
2020-11-03 15:15 Alan Schmitt
2020-10-27  8:43 Alan Schmitt
2020-10-20  8:15 Alan Schmitt
2020-10-06  7:22 Alan Schmitt
2020-09-29  7:02 Alan Schmitt
2020-09-22  7:27 Alan Schmitt
2020-09-08 13:11 Alan Schmitt
2020-09-01  7:55 Alan Schmitt
2020-08-18  7:25 Alan Schmitt
2020-07-28 16:57 Alan Schmitt
2020-07-21 14:42 Alan Schmitt
2020-07-14  9:54 Alan Schmitt
2020-07-07 10:04 Alan Schmitt
2020-06-30  7:00 Alan Schmitt
2020-06-16  8:36 Alan Schmitt
2020-06-09  8:28 Alan Schmitt
2020-05-19  9:52 Alan Schmitt
2020-05-12  7:45 Alan Schmitt
2020-05-05  7:45 Alan Schmitt
2020-04-28 12:44 Alan Schmitt
2020-04-21  8:58 Alan Schmitt
2020-04-14  7:28 Alan Schmitt
2020-04-07  7:51 Alan Schmitt
2020-03-31  9:54 Alan Schmitt
2020-03-24  9:31 Alan Schmitt
2020-03-17 11:04 Alan Schmitt
2020-03-10 14:28 Alan Schmitt
2020-03-03  8:00 Alan Schmitt
2020-02-25  8:51 Alan Schmitt
2020-02-18  8:18 Alan Schmitt
2020-02-04  8:47 Alan Schmitt
2020-01-28 10:53 Alan Schmitt
2020-01-21 14:08 Alan Schmitt
2020-01-14 14:16 Alan Schmitt
2020-01-07 13:43 Alan Schmitt
2019-12-31  9:18 Alan Schmitt
2019-12-17  8:52 Alan Schmitt
2019-12-10  8:21 Alan Schmitt
2019-12-03 15:42 Alan Schmitt
2019-11-26  8:33 Alan Schmitt
2019-11-12 13:21 Alan Schmitt
2019-11-05  6:55 Alan Schmitt
2019-10-15  7:28 Alan Schmitt
2019-09-03  7:35 Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).