<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-07-11 Tue 10:42 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>OCaml Weekly News</title>
<meta name="generator" content="Org Mode" />
<style>
  #content { max-width: 60em; margin: auto; }
  .title  { text-align: center;
             margin-bottom: .2em; }
  .subtitle { text-align: center;
              font-size: medium;
              font-weight: bold;
              margin-top:0; }
  .todo   { font-family: monospace; color: red; }
  .done   { font-family: monospace; color: green; }
  .priority { font-family: monospace; color: orange; }
  .tag    { background-color: #eee; font-family: monospace;
            padding: 2px; font-size: 80%; font-weight: normal; }
  .timestamp { color: #bebebe; }
  .timestamp-kwd { color: #5f9ea0; }
  .org-right  { margin-left: auto; margin-right: 0px;  text-align: right; }
  .org-left   { margin-left: 0px;  margin-right: auto; text-align: left; }
  .org-center { margin-left: auto; margin-right: auto; text-align: center; }
  .underline { text-decoration: underline; }
  #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  p.verse { margin-left: 3%; }
  pre {
    border: 1px solid #e6e6e6;
    border-radius: 3px;
    background-color: #f2f2f2;
    padding: 8pt;
    font-family: monospace;
    overflow: auto;
    margin: 1.2em;
  }
  pre.src {
    position: relative;
    overflow: auto;
  }
  pre.src:before {
    display: none;
    position: absolute;
    top: -8px;
    right: 12px;
    padding: 3px;
    color: #555;
    background-color: #f2f2f299;
  }
  pre.src:hover:before { display: inline; margin-top: 14px;}
  /* Languages per Org manual */
  pre.src-asymptote:before { content: 'Asymptote'; }
  pre.src-awk:before { content: 'Awk'; }
  pre.src-authinfo::before { content: 'Authinfo'; }
  pre.src-C:before { content: 'C'; }
  /* pre.src-C++ doesn't work in CSS */
  pre.src-clojure:before { content: 'Clojure'; }
  pre.src-css:before { content: 'CSS'; }
  pre.src-D:before { content: 'D'; }
  pre.src-ditaa:before { content: 'ditaa'; }
  pre.src-dot:before { content: 'Graphviz'; }
  pre.src-calc:before { content: 'Emacs Calc'; }
  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  pre.src-fortran:before { content: 'Fortran'; }
  pre.src-gnuplot:before { content: 'gnuplot'; }
  pre.src-haskell:before { content: 'Haskell'; }
  pre.src-hledger:before { content: 'hledger'; }
  pre.src-java:before { content: 'Java'; }
  pre.src-js:before { content: 'Javascript'; }
  pre.src-latex:before { content: 'LaTeX'; }
  pre.src-ledger:before { content: 'Ledger'; }
  pre.src-lisp:before { content: 'Lisp'; }
  pre.src-lilypond:before { content: 'Lilypond'; }
  pre.src-lua:before { content: 'Lua'; }
  pre.src-matlab:before { content: 'MATLAB'; }
  pre.src-mscgen:before { content: 'Mscgen'; }
  pre.src-ocaml:before { content: 'Objective Caml'; }
  pre.src-octave:before { content: 'Octave'; }
  pre.src-org:before { content: 'Org mode'; }
  pre.src-oz:before { content: 'OZ'; }
  pre.src-plantuml:before { content: 'Plantuml'; }
  pre.src-processing:before { content: 'Processing.js'; }
  pre.src-python:before { content: 'Python'; }
  pre.src-R:before { content: 'R'; }
  pre.src-ruby:before { content: 'Ruby'; }
  pre.src-sass:before { content: 'Sass'; }
  pre.src-scheme:before { content: 'Scheme'; }
  pre.src-screen:before { content: 'Gnu Screen'; }
  pre.src-sed:before { content: 'Sed'; }
  pre.src-sh:before { content: 'shell'; }
  pre.src-sql:before { content: 'SQL'; }
  pre.src-sqlite:before { content: 'SQLite'; }
  /* additional languages in org.el's org-babel-load-languages alist */
  pre.src-forth:before { content: 'Forth'; }
  pre.src-io:before { content: 'IO'; }
  pre.src-J:before { content: 'J'; }
  pre.src-makefile:before { content: 'Makefile'; }
  pre.src-maxima:before { content: 'Maxima'; }
  pre.src-perl:before { content: 'Perl'; }
  pre.src-picolisp:before { content: 'Pico Lisp'; }
  pre.src-scala:before { content: 'Scala'; }
  pre.src-shell:before { content: 'Shell Script'; }
  pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
  /* additional language identifiers per "defun org-babel-execute"
       in ob-*.el */
  pre.src-cpp:before  { content: 'C++'; }
  pre.src-abc:before  { content: 'ABC'; }
  pre.src-coq:before  { content: 'Coq'; }
  pre.src-groovy:before  { content: 'Groovy'; }
  /* additional language identifiers from org-babel-shell-names in
     ob-shell.el: ob-shell is the only babel language using a lambda to put
     the execution function name together. */
  pre.src-bash:before  { content: 'bash'; }
  pre.src-csh:before  { content: 'csh'; }
  pre.src-ash:before  { content: 'ash'; }
  pre.src-dash:before  { content: 'dash'; }
  pre.src-ksh:before  { content: 'ksh'; }
  pre.src-mksh:before  { content: 'mksh'; }
  pre.src-posh:before  { content: 'posh'; }
  /* Additional Emacs modes also supported by the LaTeX listings package */
  pre.src-ada:before { content: 'Ada'; }
  pre.src-asm:before { content: 'Assembler'; }
  pre.src-caml:before { content: 'Caml'; }
  pre.src-delphi:before { content: 'Delphi'; }
  pre.src-html:before { content: 'HTML'; }
  pre.src-idl:before { content: 'IDL'; }
  pre.src-mercury:before { content: 'Mercury'; }
  pre.src-metapost:before { content: 'MetaPost'; }
  pre.src-modula-2:before { content: 'Modula-2'; }
  pre.src-pascal:before { content: 'Pascal'; }
  pre.src-ps:before { content: 'PostScript'; }
  pre.src-prolog:before { content: 'Prolog'; }
  pre.src-simula:before { content: 'Simula'; }
  pre.src-tcl:before { content: 'tcl'; }
  pre.src-tex:before { content: 'TeX'; }
  pre.src-plain-tex:before { content: 'Plain TeX'; }
  pre.src-verilog:before { content: 'Verilog'; }
  pre.src-vhdl:before { content: 'VHDL'; }
  pre.src-xml:before { content: 'XML'; }
  pre.src-nxml:before { content: 'XML'; }
  /* add a generic configuration mode; LaTeX export needs an additional
     (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
  pre.src-conf:before { content: 'Configuration File'; }

  table { border-collapse:collapse; }
  caption.t-above { caption-side: top; }
  caption.t-bottom { caption-side: bottom; }
  td, th { vertical-align:top;  }
  th.org-right  { text-align: center;  }
  th.org-left   { text-align: center;   }
  th.org-center { text-align: center; }
  td.org-right  { text-align: right;  }
  td.org-left   { text-align: left;   }
  td.org-center { text-align: center; }
  dt { font-weight: bold; }
  .footpara { display: inline; }
  .footdef  { margin-bottom: 1em; }
  .figure { padding: 1em; }
  .figure p { text-align: center; }
  .equation-container {
    display: table;
    text-align: center;
    width: 100%;
  }
  .equation {
    vertical-align: middle;
  }
  .equation-label {
    display: table-cell;
    text-align: right;
    vertical-align: middle;
  }
  .inlinetask {
    padding: 10px;
    border: 2px solid gray;
    margin: 10px;
    background: #ffffcc;
  }
  #org-div-home-and-up
   { text-align: right; font-size: 70%; white-space: nowrap; }
  textarea { overflow-x: auto; }
  .linenr { font-size: smaller }
  .code-highlighted { background-color: #ffff00; }
  .org-info-js_info-navigation { border-style: none; }
  #org-info-js_console-label
    { font-size: 10px; font-weight: bold; white-space: nowrap; }
  .org-info-js_search-highlight
    { background-color: #ffff00; color: #000000; font-weight: bold; }
  .org-svg { }
</style>
<style type="text/css">#table-of-contents h2 { display: none } .title { display: none } .authorname { text-align: right }</style>
<style type="text/css">.outline-2 {border-top: 1px solid black;}</style>
</head>
<body>
<div id="content" class="content">
<h1 class="title">OCaml Weekly News</h1>
<p>
<a href="https://alan.petitepomme.net/cwn/2023.07.04.html">Previous Week</a> <a href="https://alan.petitepomme.net/cwn/index.html">Up</a> <a href="https://alan.petitepomme.net/cwn/2023.07.18.html">Next Week</a>
</p>

<p>
Hello
</p>

<p>
Here is the latest OCaml Weekly News, for the week of July 04 to 11, 2023.
</p>

<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#1">opam 2.2.0~alpha release!</a></li>
<li><a href="#2">Initial Emissions Monitoring of the OCaml.org Infrastructure</a></li>
<li><a href="#3">Autofonce, a modern runner for GNU Autotests suites</a></li>
<li><a href="#4">First beta release of OCaml 5.1.0</a></li>
<li><a href="#5">Dream-html - DSL to build HTML, integrated with Dream</a></li>
<li><a href="#6">ppx_subliner 0.2.0</a></li>
<li><a href="#7">happy-eyeballs, dns, http-{lwt,mirage}-client ++ writeup of happy-eyeballs issue and fix</a></li>
<li><a href="#8">Getting started with ReasonReact and Melange</a></li>
<li><a href="#9">Making OCaml 5 Succeed for Developers and Organisations</a></li>
<li><a href="#10">Llama, an OCaml library for declaratively building software-defined modular synthesizers</a></li>
<li><a href="#11">dune 3.9.0</a></li>
<li><a href="#12">Depending on non-OCaml languages from the opam repository</a></li>
<li><a href="#13">Status of DkML Windows</a></li>
<li><a href="#orgad8b677">Old CWN</a></li>
</ul>
</div>
</div>


<div id="outline-container-1" class="outline-2">
<h2 id="1">opam 2.2.0~alpha release!</h2>
<div class="outline-text-2" id="text-1">
<p>
Archive: <a href="https://discuss.ocaml.org/t/ann-opam-2-2-0-alpha-release/12536/1">https://discuss.ocaml.org/t/ann-opam-2-2-0-alpha-release/12536/1</a>
</p>
</div>

<div id="outline-container-orgf85deb2" class="outline-3">
<h3 id="orgf85deb2">R. Boujbel announced</h3>
<div class="outline-text-3" id="text-orgf85deb2">
<p>
On behalf of the opam dev team, I&rsquo;m happy to announce you the <a href="https://github.com/ocaml/opam/releases/tag/2.2.0-alpha">alpha release of opam
2.2.0</a>. :tada:
</p>
</div>

<div id="outline-container-orgf0fa62e" class="outline-4">
<h4 id="orgf0fa62e">What&rsquo;s new in this alpha ?</h4>
<div class="outline-text-4" id="text-orgf0fa62e">
<ul class="org-ul">
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Windows-Support">🔗</a> Native Windows compatibility, you can now launch opam in your favorite Windows terminal! For the moment, it needs an preexisting Cygwin installation, a limitation that will be lifted for the alpha2.</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Recursive-Pin">🔗</a> Recursive pinning to have opam look for <code>.opam</code> files in subdirectories.</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Tree-View">🔗</a> Tree view of your installed packages dependencies (and reverse dependencies).</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Recommended-Development-Tools">🔗</a> Recommended development tools variable <code>{with-dev-setup}</code> and option <code>--with-dev-setup</code>. It is used the same way as <code>with-doc</code> and <code>with-test</code>. E.g. <code>depends: [ "ocamlformat" {with-dev-setup &amp; = "0.23.0"} ]</code>.</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Software-Heritage-Binding">🔗</a> <a href="https://www.softwareheritage.org">Software Heritage</a> fallback for archive retrieval.</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Formula-Experimental">🔗</a> <code>opam install</code> with formulas, like for for switch creation.</li>
<li><a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#New-Options">🔗</a> Several new options for <code>pin</code>, <code>exec</code>, <code>source</code>, <code>clean</code>, <code>switch</code>, and <code>admin</code>.</li>
<li>And of course numerous enhancements, fixes and updates.</li>
</ul>

<p>
You&rsquo;ll find these features presented in the <a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/">blog post</a>, and for a
more detailed view you can take a look at the <a href="https://github.com/ocaml/opam/releases/tag/2.2.0-alpha">release
note</a> or
<a href="https://github.com/ocaml/opam/blob/2.2.0-alpha/CHANGES">changelog</a>.
</p>

<p>
We encourage you to try out this alpha release, instructions are detailed in the <a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha">blog
post</a>, in particular for
<a href="https://opam.ocaml.org/blog/opam-2-2-0-alpha/#How-to-Test-opam-on-Windows">Windows</a>.
</p>
</div>
</div>
</div>
</div>




<div id="outline-container-2" class="outline-2">
<h2 id="2">Initial Emissions Monitoring of the OCaml.org Infrastructure</h2>
<div class="outline-text-2" id="text-2">
<p>
Archive: <a href="https://discuss.ocaml.org/t/initial-emissions-monitoring-of-the-ocaml-org-infrastructure/12335/7">https://discuss.ocaml.org/t/initial-emissions-monitoring-of-the-ocaml-org-infrastructure/12335/7</a>
</p>
</div>

<div id="outline-container-org4eab172" class="outline-3">
<h3 id="org4eab172">Patrick Ferris announced</h3>
<div class="outline-text-3" id="text-org4eab172">
<p>
The library used for accessing emission information from electricity grids called
&ldquo;<a href="https://github.com/geocaml/carbon-intensity">carbon</a>&rdquo; should now be available on opam. This is an initial release
and might change a bit (e.g. it depends on an alpha release of cohttp-eio).
</p>

<div class="org-src-container">
<pre class="src src-shell">opam update &amp;&amp; opam install carbon
</pre>
</div>

<p>
Here&rsquo;s a simple example to get the emission numbers for Great Britain.
</p>

<div class="org-src-container">
<pre class="src src-ocaml"><span style="color: #444fcf;">Eio_main.</span>run <span style="color: #a52a2a;">@@</span> <span style="color: #006f00; font-weight: bold;">fun</span> <span style="color: #007a9f;">env</span> -&gt;
<span style="color: #444fcf;">Mirage_crypto_rng_eio.</span>run (<span style="color: #006f00; font-weight: bold;">module</span> <span style="color: #444fcf;">Mirage_crypto_rng.Fortuna</span>) env <span style="color: #a52a2a;">@@</span> <span style="color: #006f00; font-weight: bold;">fun</span> <span style="color: #007a9f;">_</span> -&gt;
<span style="color: #444fcf;">Carbon.Gb.</span>get_intensity env#net
<span style="color: #a52a2a;">|&gt;</span> <span style="color: #444fcf;">Eio.</span>traceln <span style="color: #ca3400;">"%a"</span> <span style="color: #444fcf;">Carbon.Gb.Intensity.</span>pp
</pre>
</div>

<p>
Thanks to @emillon for providing a backend for French data and to @reynir for suggesting important changes to the
CO2-signal backend before the release.
</p>
</div>
</div>
</div>




<div id="outline-container-3" class="outline-2">
<h2 id="3">Autofonce, a modern runner for GNU Autotests suites</h2>
<div class="outline-text-2" id="text-3">
<p>
Archive: <a href="https://discuss.ocaml.org/t/autofonce-a-modern-runner-for-gnu-autotests-suites/11727/2">https://discuss.ocaml.org/t/autofonce-a-modern-runner-for-gnu-autotests-suites/11727/2</a>
</p>
</div>

<div id="outline-container-org2d318d6" class="outline-3">
<h3 id="org2d318d6">Fabrice Le Fessant announced</h3>
<div class="outline-text-3" id="text-org2d318d6">
<p>
A recent blog article on the subject:
</p>

<p>
<a href="https://ocamlpro.com/blog/2023_03_18_autofonce/">https://ocamlpro.com/blog/2023_03_18_autofonce/</a>
</p>
</div>
</div>
</div>




<div id="outline-container-4" class="outline-2">
<h2 id="4">First beta release of OCaml 5.1.0</h2>
<div class="outline-text-2" id="text-4">
<p>
Archive: <a href="https://discuss.ocaml.org/t/first-beta-release-of-ocaml-5-1-0/12540/1">https://discuss.ocaml.org/t/first-beta-release-of-ocaml-5-1-0/12540/1</a>
</p>
</div>

<div id="outline-container-orged4908a" class="outline-3">
<h3 id="orged4908a">octachron announced</h3>
<div class="outline-text-3" id="text-orged4908a">
<p>
After two alpha releases, the release of OCaml 5.1.0 is drawing near.
</p>

<p>
We have thus released a first beta version of OCaml 5.1.0 to help you update your softwares and libraries ahead of
the release (see below for the installation instructions).
</p>

<p>
Compared to the last alpha release, this beta contains two subtle internal runtime fixes, and one Windows fix.
Overall, the opam ecosystem looks in a good shape for the first beta release.
</p>

<p>
If you find any bugs, please report them on <a href="https://github.com/ocaml/ocaml/issues">OCaml&rsquo;s issue tracker</a>.
</p>

<p>
Nearly all core development tools supports OCaml 5.1.0, and you can follow the last remaining wrinkles on the <a href="https://github.com/ocaml/opam-repository/issues/23669">opam
readiness for 5.1.0 meta-issue</a>.
</p>

<p>
Currently, the release is planned for the end of July or the beginning of August.
</p>

<p>
If you are interested in full list of features and bug fixes of the new OCaml version, the
updated change log for OCaml 5.1.0 is available <a href="https://github.com/ocaml/ocaml/blob/5.1/Changes">on GitHub</a>.
</p>
</div>

<div id="outline-container-org3882d45" class="outline-4">
<h4 id="org3882d45">Installation Instructions</h4>
<div class="outline-text-4" id="text-org3882d45">
<p>
The base compiler can be installed as an opam switch with the following commands
on opam 2.1:
</p>

<div class="org-src-container">
<pre class="src src-shell">opam update
opam switch create 5.1.0~beta1
</pre>
</div>

<p>
The source code for the alpha is also available at these addresses:
</p>

<ul class="org-ul">
<li><a href="https://github.com/ocaml/ocaml/archive/5.1.0-beta1.tar.gz">GitHub</a></li>
<li><a href="https://caml.inria.fr/pub/distrib/ocaml-5.1/ocaml-5.1.0~beta1.tar.gz">OCaml archives at Inria</a></li>
</ul>
</div>

<ul class="org-ul">
<li><a id="org25346f1"></a>Fine-Tuned Compiler Configuration<br />
<div class="outline-text-5" id="text-org25346f1">
<p>
If you want to tweak the configuration of the compiler, you can switch to the option variant with:
</p>

<div class="org-src-container">
<pre class="src src-shell">opam update
opam switch create &lt;switch_name&gt; ocaml-variants.5.1.0~beta1+options &lt;option_list&gt;
</pre>
</div>

<p>
where <code>option_list</code> is a space-separated list of <code>ocaml-option-*</code> packages. For instance, for a <code>flambda</code> and
<code>no-flat-float-array</code> switch:
</p>

<div class="org-src-container">
<pre class="src src-shell">opam switch create 5.1.0~beta1+flambda+nffa ocaml-variants.5.1.0~beta1+options ocaml-option-flambda
ocaml-option-no-flat-float-array
</pre>
</div>

<p>
All available options can be listed with <code>opam search ocaml-option</code>.
</p>
</div>
</li>
</ul>
</div>

<div id="outline-container-org802f9c8" class="outline-4">
<h4 id="org802f9c8">Changes since the last alpha release:</h4>
<div class="outline-text-4" id="text-org802f9c8">
</div>
<ul class="org-ul">
<li><a id="org143d103"></a>Runtime System Bugfix<br />
<div class="outline-text-5" id="text-org143d103">
<ul class="org-ul">
<li><a href="https://github.com/ocaml/ocaml/issues/12037">#12037</a>: Fix some data races by using volatile when necessary
(Fabrice Buoro and Olivier Nicole, review by Guillaume Munch-Maccagnoni,
Gabriel Scherer and Luc Maranget)</li>
<li><a href="https://github.com/ocaml/ocaml/issues/12253">#12253</a>, <a href="https://github.com/ocaml/ocaml/issues/12342">#12342</a>: Fix infinite loop in signal handling.
(Guillaume Munch-Maccagnoni, report by Thomas Leonard, review by
 KC Sivaramakrishnan and Sadiq Jaffer)</li>
</ul>
</div>
</li>
<li><a id="orge3fa960"></a>Windows Bugfix<br />
<div class="outline-text-5" id="text-orge3fa960">
<ul class="org-ul">
<li><a href="https://github.com/ocaml/ocaml/issues/12184">#12184</a>, <a href="https://github.com/ocaml/ocaml/issues/12320">#12320</a>: Sys.rename Windows fixes on directory corner cases.
(Jan Midtgaard, review by Anil Madhavapeddy)</li>
</ul>
</div>
</li>
</ul>
</div>
</div>


<div id="outline-container-org4646936" class="outline-3">
<h3 id="org4646936">octachron added</h3>
<div class="outline-text-3" id="text-org4646936">
<p>
After spending some time trying to map the current package build failures with the current beta release on the opam
repository, I have written down a short topography of such build failures at
<a href="http://gallium.inria.fr/blog/florian-compiler-weekly-2023-07-05">http://gallium.inria.fr/blog/florian-compiler-weekly-2023-07-05</a> .
</p>
</div>
</div>
</div>




<div id="outline-container-5" class="outline-2">
<h2 id="5">Dream-html - DSL to build HTML, integrated with Dream</h2>
<div class="outline-text-2" id="text-5">
<p>
Archive: <a href="https://discuss.ocaml.org/t/ann-dream-html-dsl-to-build-html-integrated-with-dream/12032/4">https://discuss.ocaml.org/t/ann-dream-html-dsl-to-build-html-integrated-with-dream/12032/4</a>
</p>
</div>

<div id="outline-container-orgb749e53" class="outline-3">
<h3 id="orgb749e53">Yawar Amin announced</h3>
<div class="outline-text-3" id="text-orgb749e53">
<p>
Just released 0.1.0 with a couple of small helpers:
</p>

<ul class="org-ul">
<li><code>Hx.__</code> can be used to render the <code>_</code> attribute, which is used for <a href="https://htmx.org/docs/#hyperscript">Hyperscript</a></li>
<li><code>attr "attr-name"</code> can be used to create a new attribute which does not carry a payload (what is usually called a boolean attribute)</li>
</ul>
</div>
</div>
</div>




<div id="outline-container-6" class="outline-2">
<h2 id="6">ppx_subliner 0.2.0</h2>
<div class="outline-text-2" id="text-6">
<p>
Archive: <a href="https://discuss.ocaml.org/t/ann-ppx-subliner-0-2-0/12544/1">https://discuss.ocaml.org/t/ann-ppx-subliner-0-2-0/12544/1</a>
</p>
</div>

<div id="outline-container-org4a995c9" class="outline-3">
<h3 id="org4a995c9">Boning announced</h3>
<div class="outline-text-3" id="text-org4a995c9">
<p>
I am very happy to announce the second release (<a href="https://github.com/bn-d/ppx_subliner/releases/tag/v0.2.0">v0.2.0</a>)
of <a href="https://github.com/bn-d/ppx_subliner"><code>ppx_subliner</code> </a>! The new version is available through
<a href="https://opam.ocaml.org/packages/ppx_subliner/">OPAM</a>.
</p>

<p>
The extension had been greatly enhanced since the <a href="https://discuss.ocaml.org/t/ann-first-release-of-ppx-pyformat-0-1-1/9321">first
release</a>.
</p>

<p>
Now, the user is able to generate a multi-subcommand application from a single variant type with inline records.
And the new version does not need to rely on other extensions.
</p>

<div class="org-src-container">
<pre class="src src-ocaml"><span style="color: #000000; font-weight: bold;">type</span> <span style="color: #444fcf;">params</span> = <span style="color: #242521; background-color: #fcf7ef;">Foo</span> <span style="color: #006f00; font-weight: bold;">of</span> { my_arg : string } | <span style="color: #242521; background-color: #fcf7ef;">Bar</span>
<span style="color: #a2604f;">[@@deriving subliner]</span>

<span style="color: #000000; font-weight: bold;">let</span> <span style="color: #a7601f;">handle</span> = <span style="color: #006f00; font-weight: bold;">function</span>
  | <span style="color: #242521; background-color: #fcf7ef;">Foo</span> { my_arg } -&gt; print_endline (<span style="color: #ca3400;">"Foo "</span> <span style="color: #a52a2a;">^</span> my_arg)
  | <span style="color: #242521; background-color: #fcf7ef;">Bar</span> -&gt; print_endline <span style="color: #ca3400;">"Bar"</span>

<span style="color: #a2604f; background-color: #ebebeb;">[%%subliner.cmds</span>
eval.params &lt;- handle<span style="color: #a2604f; background-color: #ebebeb;">]</span>
<span style="color: #4f677f; font-style: italic;">(** Some docs *)</span>
</pre>
</div>

<p>
The user is also able to generate <code>Cmdliner.Term.t</code> from a record type, and the signature is fully compatible with
the generated value of <a href="https://github.com/hammerlab/ppx_deriving_cmdliner"><code>ppx_deriving_cmdliner</code> </a>. The deriver
support various attributes, such as <code>[@pos]</code>, <code>[@pos_all]</code>, <code>[@pos_left]</code>, <code>[@non_empty]</code>, <code>[@conv]</code>, <code>[@term]</code>,
<code>[@file]</code>, to support different kinds of positional arguments and types, and give the user great flexibility.
</p>

<div class="org-src-container">
<pre class="src src-ocaml"><span style="color: #000000; font-weight: bold;">type</span> <span style="color: #444fcf;">foo</span> = { my_arg : string } <span style="color: #a2604f;">[@@deriving subliner]</span>
</pre>
</div>

<p>
This release should cover majority of <a href="https://github.com/dbuenzli/cmdliner"><code>Cmdliner</code></a>. Please see the
<a href="https://boni.ng/ppx_subliner/ppx_subliner/index.html">documentation </a> for the full feature set.
</p>

<p>
Happy hacking!
</p>
</div>
</div>
</div>




<div id="outline-container-7" class="outline-2">
<h2 id="7">happy-eyeballs, dns, http-{lwt,mirage}-client ++ writeup of happy-eyeballs issue and fix</h2>
<div class="outline-text-2" id="text-7">
<p>
Archive: <a href="https://discuss.ocaml.org/t/ann-happy-eyeballs-dns-http-lwt-mirage-client-writeup-of-happy-eyeballs-issue-and-fix/12550/1">https://discuss.ocaml.org/t/ann-happy-eyeballs-dns-http-lwt-mirage-client-writeup-of-happy-eyeballs-issue-and-fix/12550/1</a>
</p>
</div>

<div id="outline-container-org347400f" class="outline-3">
<h3 id="org347400f">Hannes Mehnert announced</h3>
<div class="outline-text-3" id="text-org347400f">
<p>
Dear OCaml people,
</p>

<p>
some time ago we encountered issues in the connection establishment of http-lwt-client in a GitHub action (using a
pre-commit.com) hook. It was quite some journey from surfacing issue &ldquo;HTTP connection timeout&rdquo; to the actual issue,
so we wrote it up at <a href="https://semgrep.dev/blog/2023/http-request-failed-timeout-issue-in-ocaml">https://semgrep.dev/blog/2023/http-request-failed-timeout-issue-in-ocaml</a> &#x2013; it reminds me of
an issue surfacing as &ldquo;bad record mac&rdquo; in the TLS stack some years ago (see
<a href="https://hannes.robur.coop/Posts/BadRecordMac">https://hannes.robur.coop/Posts/BadRecordMac</a>).
</p>

<p>
This lead to the releases of happy-eyeballs{,-lwt,-mirage} 0.6.0 and dns* 7.0.3. In related news, we just release
http-lwt-client 0.2.5 with further fixes (related to HTTP2) and http-mirage-client 0.0.5.
</p>

<p>
This debugging and fixing work was sponsored by semgrep.com &#x2013; a great open source utility to statically analyse
your codebase :D
</p>

<p>
All the best, and please report issues and feedback either here, via eMail, or in the issue tracker(s). Enjoy your
day!
</p>
</div>
</div>
</div>




<div id="outline-container-8" class="outline-2">
<h2 id="8">Getting started with ReasonReact and Melange</h2>
<div class="outline-text-2" id="text-8">
<p>
Archive: <a href="https://discuss.ocaml.org/t/getting-started-with-reasonreact-and-melange/12566/1">https://discuss.ocaml.org/t/getting-started-with-reasonreact-and-melange/12566/1</a>
</p>
</div>

<div id="outline-container-org43c36b4" class="outline-3">
<h3 id="org43c36b4">psb announced</h3>
<div class="outline-text-3" id="text-org43c36b4">
<p>
A short blog post on getting started with ReasonReact and Melange:
<a href="https://dev.to/psb/getting-started-with-reasonreact-and-melange-13hd">https://dev.to/psb/getting-started-with-reasonreact-and-melange-13hd</a>
</p>
</div>
</div>
</div>




<div id="outline-container-9" class="outline-2">
<h2 id="9">Making OCaml 5 Succeed for Developers and Organisations</h2>
<div class="outline-text-2" id="text-9">
<p>
Archive: <a href="https://discuss.ocaml.org/t/making-ocaml-5-succeed-for-developers-and-organisations/12567/1">https://discuss.ocaml.org/t/making-ocaml-5-succeed-for-developers-and-organisations/12567/1</a>
</p>
</div>

<div id="outline-container-org776400a" class="outline-3">
<h3 id="org776400a">KC Sivaramakrishnan announced, spawning a big thread</h3>
<div class="outline-text-3" id="text-org776400a">
<p>
I wrote up a summary of the various efforts at Tarides aimed at making OCaml 5 succeed for developers:
<a href="https://tarides.com/blog/2023-07-07-making-ocaml-5-succeed-for-developers-and-organisations/">https://tarides.com/blog/2023-07-07-making-ocaml-5-succeed-for-developers-and-organisations/</a>.
</p>

<p>
The post gives an idea of how we&rsquo;ve been approaching this challenge. It would be great to hear what the community
thinks about our approach and whether we are missing something impactful that we should be focussing on.
</p>

<p>
Also, I hope you give OCaml 5 a try if you haven&rsquo;t already :-)
</p>
</div>
</div>
</div>




<div id="outline-container-10" class="outline-2">
<h2 id="10">Llama, an OCaml library for declaratively building software-defined modular synthesizers</h2>
<div class="outline-text-2" id="text-10">
<p>
Archive: <a href="https://discuss.ocaml.org/t/llama-an-ocaml-library-for-declaratively-building-software-defined-modular-synthesizers/12578/1">https://discuss.ocaml.org/t/llama-an-ocaml-library-for-declaratively-building-software-defined-modular-synthesizers/12578/1</a>
</p>
</div>

<div id="outline-container-orgec352a9" class="outline-3">
<h3 id="orgec352a9">Steve Sherratt announced</h3>
<div class="outline-text-3" id="text-orgec352a9">
<p>
<a href="https://github.com/gridbugs/llama"><code>llama</code></a> is a library for building audio synthesizers using a declarative EDSL.
It contains a collection of combinators which consume and produce streams of values (usually ~float~s for audio
signals and ~bool~s for control signals) which can be composed much in the same way as one would <a href="https://www.youtube.com/watch?v=UsW2EDGbDqg">patch a modular
synthesizer</a>. The library also contains a player which can play a
stream of ~float~s (treated as audio samples) through your sound card.
</p>

<p>
An additional library <code>llama_interactive</code> can be used to connect synthesizers to input events and to render
oscilloscope visualizations:
</p>


<div id="orgb300603" class="figure">
<p><img src="https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/8/8a5c6d13b4d812cb798a8e27255ff1bb0b342f91.png" alt="8a5c6d13b4d812cb798a8e27255ff1bb0b342f91.png" />
</p>
</div>

<p>
Some demos (from the <a href="https://github.com/gridbugs/llama/tree/main/examples">examples</a> directory):
</p>

<ul class="org-ul">
<li><a href="https://youtu.be/A8a1Dem2eKs">Midi file player</a></li>
<li><a href="https://youtu.be/O8oc7MhG4uE">Interactive synth played with computer keyboard</a></li>
</ul>

<p>
There are more demo videos linked from the <a href="https://github.com/gridbugs/llama/blob/main/README.md">readme</a>.
</p>

<p>
Get <code>llama</code> with <code>opam install llama</code> or <code>opam install llama_interactive</code>. A third package <code>llama_core</code> contains
just the core type definitions and combinators but not the player. Use this if you just want to make more effects,
filters, etc without depending on additional packages needed to play audio.
</p>

<p>
Note that <code>llama</code> (and <code>llama_interactive</code>) depends on <code>conf-rust-2021</code> as interacting with the sound card is done
using the <a href="https://crates.io/crates/cpal">cpal</a> rust library. If you don&rsquo;t want to install rust system-wide (e.g.
because you use rustup) then run <code>opam install conf-rust-2021 --assume-depexts</code> before installing <code>llama</code>.
</p>
</div>

<div id="outline-container-orgd2dc5d2" class="outline-4">
<h4 id="orgd2dc5d2">Code Example</h4>
<div class="outline-text-4" id="text-orgd2dc5d2">
<p>
This will play repeating pulses of a 440Hz sine wave.
</p>
<div class="org-src-container">
<pre class="src src-ocaml"><span style="color: #000000; font-weight: bold;">open </span><span style="color: #444fcf;">Llama</span>
<span style="color: #000000; font-weight: bold;">open </span><span style="color: #444fcf;">Dsl</span>

<span style="color: #8f6f4a; font-style: italic;">(* </span><span style="color: #8f6f4a; font-style: italic;">[osc] represents a signal whose value varies between -1 and 1 according</span>
<span style="color: #8f6f4a; font-style: italic;">   to a 440Hz sine wave.</span><span style="color: #8f6f4a; font-style: italic;"> *)</span>
<span style="color: #000000; font-weight: bold;">let</span> <span style="color: #007a9f;">osc</span> :<span style="color: #444fcf;"> float </span><span style="color: #444fcf;">Signal.</span><span style="color: #444fcf;">t </span>= oscillator (const <span style="color: #242521; background-color: #fcf7ef;">Sine</span>) (const <span style="color: #00824f;">440.0</span>)

<span style="color: #8f6f4a; font-style: italic;">(* </span><span style="color: #8f6f4a; font-style: italic;">[note_clock] represents a signal whose value is either [true] or [false]</span>
<span style="color: #8f6f4a; font-style: italic;">   which changes from [false] to [true] twice per second, and spends 30% of the</span>
<span style="color: #8f6f4a; font-style: italic;">   time on. This is often used to communicate the fact that a key is pressed to</span>
<span style="color: #8f6f4a; font-style: italic;">   a module that responds to such events.</span><span style="color: #8f6f4a; font-style: italic;"> *)</span>
<span style="color: #000000; font-weight: bold;">let</span> <span style="color: #007a9f;">note_clock</span> :<span style="color: #444fcf;"> bool </span><span style="color: #444fcf;">Signal.</span><span style="color: #444fcf;">t </span>=
  pulse <span style="color: #00824f;">~frequency_hz</span>:(const <span style="color: #00824f;">2.0</span>) <span style="color: #00824f;">~duty_01</span>:(const <span style="color: #00824f;">0.3</span>)

<span style="color: #8f6f4a; font-style: italic;">(* </span><span style="color: #8f6f4a; font-style: italic;">[envelope] is a signal which is 0 while its [gate] argument is producing</span>
<span style="color: #8f6f4a; font-style: italic;">   [false] values, but which raises to 1 over the course of [attack_s] seconds</span>
<span style="color: #8f6f4a; font-style: italic;">   when [gate] transitions to [true], and transitions back to [false] when</span>
<span style="color: #8f6f4a; font-style: italic;">   [gate] transitions to [false]. Note that even though it is also a [float</span>
<span style="color: #8f6f4a; font-style: italic;">   Signal.t] like [osc] is, it doesn't contain audio data. Instead an envelope</span>
<span style="color: #8f6f4a; font-style: italic;">   is typically used to modulate a signal in response to a key press, which we</span>
<span style="color: #8f6f4a; font-style: italic;">   are simulating here with [note_clock].</span><span style="color: #8f6f4a; font-style: italic;"> *)</span>
<span style="color: #000000; font-weight: bold;">let</span> <span style="color: #007a9f;">envelope</span> :<span style="color: #444fcf;"> float </span><span style="color: #444fcf;">Signal.</span><span style="color: #444fcf;">t </span>=
  asr_linear <span style="color: #00824f;">~gate</span>:note_clock <span style="color: #00824f;">~attack_s</span>:(const <span style="color: #00824f;">0.01</span>) <span style="color: #00824f;">~release_s</span>:(const <span style="color: #00824f;">0.2</span>)

<span style="color: #8f6f4a; font-style: italic;">(* </span><span style="color: #8f6f4a; font-style: italic;">Multiply the oscillator with the envelope to produce a repeating</span>
<span style="color: #8f6f4a; font-style: italic;">   burst of volume which gradually tapers off twice per second.</span><span style="color: #8f6f4a; font-style: italic;"> *)</span>
<span style="color: #000000; font-weight: bold;">let</span> <span style="color: #007a9f;">output</span> :<span style="color: #444fcf;"> float </span><span style="color: #444fcf;">Signal.</span><span style="color: #444fcf;">t </span>= osc *.. envelope

<span style="color: #8f6f4a; font-style: italic;">(* </span><span style="color: #8f6f4a; font-style: italic;">Play the sound!</span><span style="color: #8f6f4a; font-style: italic;"> *)</span>
<span style="color: #000000; font-weight: bold;">let</span> () = play_signal output
</pre>
</div>
</div>
</div>
</div>
</div>




<div id="outline-container-11" class="outline-2">
<h2 id="11">dune 3.9.0</h2>
<div class="outline-text-2" id="text-11">
<p>
Archive: <a href="https://discuss.ocaml.org/t/ann-dune-3-9-0/12530/3">https://discuss.ocaml.org/t/ann-dune-3-9-0/12530/3</a>
</p>
</div>

<div id="outline-container-orgf8eb292" class="outline-3">
<h3 id="orgf8eb292">Continuing this thread, Tim McGilchrist said and Etienne Millon announced</h3>
<div class="outline-text-3" id="text-orgf8eb292">
<blockquote>
<p>
Thank you to the Dune team for all your fantastic work.
</p>

<p>
For anyone using macOS there is a know bug with this version <a href="https://github.com/ocaml/dune/issues/8083">https://github.com/ocaml/dune/issues/8083</a> that you
might want to hold off until it is fixed before upgrading.
</p>
</blockquote>

<p>
To expand on that:
</p>

<p>
In Dune 3.9.0, we added a feature that offloads some computations to background threads. Unfortunately, this has a
bad interaction on macOS, where we fork processes to implement the RPC server and watch mode.
</p>

<p>
We marked Dune 3.9.0 unavailable on macOS, and released 3.9.1 with some mitigations: we don&rsquo;t offload these
computations on macOS, and we only fork when necessary.
</p>

<p>
The plan for the next release is to stop forking processes on macOS.
</p>

<p>
The first alpha for Dune 3.10.0 is planned to happen around 2023-07-25.
</p>

<p>
Here&rsquo;s the changelog for 3.9.1:
</p>
</div>

<div id="outline-container-orge2a5fc4" class="outline-4">
<h4 id="orge2a5fc4">Fixes</h4>
<div class="outline-text-4" id="text-orge2a5fc4">
<ul class="org-ul">
<li>Disable background operations and threaded console on MacOS and other Unixes where we rely on fork. (#8100, #8121, fixes #8083, @rgrinberg, @emillon)</li>
<li>Initialize async IO thread lazily. (#8122, @emillon)</li>
</ul>
</div>
</div>
</div>
</div>




<div id="outline-container-12" class="outline-2">
<h2 id="12">Depending on non-OCaml languages from the opam repository</h2>
<div class="outline-text-2" id="text-12">
<p>
Archive: <a href="https://discuss.ocaml.org/t/depending-on-non-ocaml-languages-from-the-opam-repository/12585/1">https://discuss.ocaml.org/t/depending-on-non-ocaml-languages-from-the-opam-repository/12585/1</a>
</p>
</div>

<div id="outline-container-org6690c2a" class="outline-3">
<h3 id="org6690c2a">Anil Madhavapeddy announced</h3>
<div class="outline-text-3" id="text-org6690c2a">
<p>
I&rsquo;m currently reviewing feature requests for the opam repository, and one of the most common ones is for us to
<b>support non-OCaml toolchains as dependencies from OCaml packages submitted to our package repository</b>.  In
recent years, there have been a number of OCaml libraries that depend on Rust, Python or Node, and cannot be easily
tested in our automated infrastructure (which currently uses a fixed base image per distribution).
</p>

<p>
I&rsquo;ve put together a prototype way we might solve this easily, without taking on the burden of maintaining non-OCaml
toolchains ourselves with limited maintainer resources.  Opinions and ideas welcome on this thread, and the
repository is at: <a href="https://github.com/avsm/opam-lang-repo">https://github.com/avsm/opam-lang-repo</a>
</p>
</div>

<div id="outline-container-org558f192" class="outline-4">
<h4 id="org558f192">A multi-language devcontainer package repository</h4>
<div class="outline-text-4" id="text-org558f192">
<p>
<a href="https://containers.dev">Devcontainers</a> are an emerging mechanism to use container runtimes as a full-fledged
development environment.  They can support multiple programming languages in one filesystem by means of
<a href="https://containers.dev/implementors/features/">features</a>, which allow for the activation of a given toolchain
alongside others. For example, using features allows for the simultaneous use of Python, Rust and OCaml within one
container image, whereas with traditional devcontainers there would be a separate container for each toolchain.
</p>
</div>
</div>

<div id="outline-container-org8285ad7" class="outline-4">
<h4 id="org8285ad7">Using the opam solver to manage feature selection</h4>
<div class="outline-text-4" id="text-org8285ad7">
<p>
The <a href="https://opam.ocaml.org">opam</a> package manager integrates a builtin constraint solver that allows for the
selection of a compatible set of dependencies from a package repository that contains all released versions of all
packages.
</p>

<p>
This repository translates published devcontainers into opam packages, such that devcontainer features can be
selected by simply adding dependencies to an opam package.  Additionally, version constraints on the desired
tooling can be added to pick the required versions. For example:
</p>

<pre class="example" id="org719bdeb">
depends: [ "dev-rust" {&gt;="1.68"}
           "dev-ocaml" {&gt;="4.12" &amp; &lt; "5.0"}
           "dev-python"
           "dev-python-optimize" ]
</pre>

<p>
This picks a version of Rust greater than 1.68, and any OCaml compiler between 4.12-4.14, and any Python compiler
with the <code>optimize</code> flag activated for more efficient code generation.
</p>
</div>
</div>

<div id="outline-container-org9f8c21c" class="outline-4">
<h4 id="org9f8c21c">The Good News</h4>
<div class="outline-text-4" id="text-org9f8c21c">
<p>
This solution frees the opam-repo maintainers from having to support the myriad other toolchains, and lets us
depend on them freely from opam. By adding explicit dependencies like this, we can continue to run automated
end-to-end tests for new and existing packages in the OCaml ecosystem, even when they do not exclusively use OCaml.
</p>
</div>
</div>

<div id="outline-container-org7f2dac9" class="outline-4">
<h4 id="org7f2dac9">The Bad News</h4>
<div class="outline-text-4" id="text-org7f2dac9">
<p>
There are still some limitations to figure out before this is production worthy:
</p>

<ul class="org-ul">
<li>The devcontainer installation busts the opam security sandbox, and
so cannot be installed simultaneously with normal packages.  It would be
ok in a CI system where sandboxing is normally disabled.  Another option
is for these packages to not actually perform the installation, but generate
a single <code>install.sh</code> with all the right environment variables.  An image
generator could then run that script to generate a base image.</li>
<li>opam doesn&rsquo;t currently support composing remote repositories, so
some strategy is needed for how to keep this generated repo in sync
with anything included in the central repository.</li>
<li>Need to support devcontainer boolean defaults correctly (e.g. Python feature), and figure out what to do about arbitrary string options. Env variables could be used to pass in values, but opam can&rsquo;t recompile if these variables change. Dune does support systematic env variable tracking and recompile if it changes, so this would work in a monorepo.</li>
<li>Need to extract feature dependencies into the opam formula as well.</li>
<li>Something, something, Nix, instead?</li>
</ul>
</div>
</div>
</div>
</div>




<div id="outline-container-13" class="outline-2">
<h2 id="13">Status of DkML Windows</h2>
<div class="outline-text-2" id="text-13">
<p>
Archive: <a href="https://discuss.ocaml.org/t/status-of-dkml-windows/12589/1">https://discuss.ocaml.org/t/status-of-dkml-windows/12589/1</a>
</p>
</div>

<div id="outline-container-org2036409" class="outline-3">
<h3 id="org2036409">jbeckford announced</h3>
<div class="outline-text-3" id="text-org2036409">
<p>
I&rsquo;m preparing to release the next semi-annual version of DkML (the MSVC/Windows distribution for OCaml). Among
other things new in this version, it has been completely decoupled from the deprecated fdopen repository (thanks
@fdopen for doing it for so long!). And from my perspective Windows looks good for OCaml going forward:
</p>

<ul class="org-ul">
<li>opam 2.2 will be able to stand up a Cygwin / OCaml compiler from the main opam repository</li>
<li>opam CI + repository are getting mechanisms so that the number of safe-for-Windows packages should grow over time</li>
<li>OCaml 5 will be getting full MinGW (GCC) and then MSVC support</li>
<li>Many many packages have accepted MSVC patches</li>
</ul>

<p>
There is one structural problem with DkML &#x2026; it is tightly coupled to my company (Diskuv) and that is not healthy.
In particular, seemingly minor decisions on my part (ex. sticking with OCaml 4 for the foreseeable future) have a
large blast radius on the OCaml community.
</p>

<p>
Are there any Windows users who want to use MSVC + OCaml 5 on a daily basis, and who are also willing to maintain
the OCaml 5 part of the distribution? The DkML distribution will <i>still be actively developed</i> (ie. the repository,
installer, ease-of-use shims, hosting, testing, and release system), so your maintenance responsibilities should
not be excessive. If so, please contact me in the next few days so you can see what goes into the release process.
</p>
</div>
</div>
</div>




<div id="outline-container-orgad8b677" class="outline-2">
<h2 id="orgad8b677">Old CWN</h2>
<div class="outline-text-2" id="text-orgad8b677">
<p>
If you happen to miss a CWN, you can <a href="mailto:alan.schmitt@polytechnique.org">send me a message</a> and I&rsquo;ll mail it to you, or go take a look at <a href="https://alan.petitepomme.net/cwn/">the archive</a> or the <a href="https://alan.petitepomme.net/cwn/cwn.rss">RSS feed of the archives</a>.
</p>

<p>
If you also wish to receive it every week by mail, you may subscribe <a href="http://lists.idyll.org/listinfo/caml-news-weekly/">online</a>.
</p>

<div class="authorname" id="org0573711">
<p>
<a href="https://alan.petitepomme.net/">Alan Schmitt</a>
</p>

</div>
</div>
</div>
</div>
</body>
</html>