caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-01-19 14:28 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-01-19 14:28 UTC (permalink / raw)
  To: lwn, cwn, caml-list, comp

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

Hello

Here is the latest OCaml Weekly News, for the week of January 12 to 19,
2021.

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

Irmin 2.3.0
Dune 2.8.0
lwt-canceler.0.3
Interesting OCaml Articles
OCaml 4.12.0, first beta release
OCaml for ARM MacOS
Talk on OCaml Batteries at Houston Functional Programmers
Other OCaml News
Old CWN


Irmin 2.3.0
═══════════

  Archive: <https://discuss.ocaml.org/t/ann-irmin-2-3-0/7084/1>


Craig Ferguson announced
────────────────────────

  I'm very happy to announce the release of the Irmin 2.3.0 family of
  packages, including:

  • [`irmin-pack.2.3.0'], a storage backend for Irmin designed for and
    used by Tezos. This release contains a host of performance
    improvements as well as offline CLI features such as integrity
    checking. It also contains a number of high-level design changes,
    which were discussed in a recent [Tarides blog post].

    Finally, `irmin-pack.2.3.0' also contains a prototype of the
    [_layered_] `irmin-pack' store, which provides an [OverlayFS]-esque
    mode of operation for `irmin-pack' in which the causal history of
    the store can be chunked into independently-accessable
    substores. This feature will eventually be deployed in a [future
    version of Tezos].

  • [`irmin-containers'], a collection of pre-defined mergeable data
    structures built using Irmin and compatible with any backend. These
    were originally provided by @kayceesrk as part of [`ezirmin'], and
    has since been modernised and upstreamed by Anirudh S.

  • `irmin-bench', a suite of benchmarks for Irmin for use with
    [`current-bench'], an experimental continuous benchmarking
    infrastructure for OCaml projects. Lots of work has been going on
    behind the scenes to make this a general benchmarking infrastructure
    for the Mirage ecosystem, including a recent [fancy UI overhaul] by
    new contributor @rizo.

  • [`repr'], an extraction of the `Irmin.Type' type representation
    library for use in other packages. This package contains a set of
    combinators for building run-time representations of types, along
    with various generic operations defined over those representations,
    including: equality, comparison, pretty-printing, JSON / binary
    codecs, etc. The API of this library is currently a
    work-in-progress, but we hope to use it more widely in the Mirage
    ecosystem soon.

  • [`semaphore-compat'], an extraction of the `Semaphore' library in
    OCaml 4.12, for libraries that want to maintain compatibility with
    earlier versions of OCaml.

  The full list of changes to Irmin can be found [here].

  Many thanks to our open-source contributors and collaborators. Happy
  hacking!


[`irmin-pack.2.3.0'] <https://www.youtube.com/watch?v=v1lfMUM332w>

[Tarides blog post]
<https://tarides.com/blog/2020-09-08-irmin-september-2020-update>

[_layered_]
<https://gist.github.com/icristescu/1afb7f9f862f8e989b8b6c195908e7d0>

[OverlayFS] <https://en.wikipedia.org/wiki/OverlayFS>

[future version of Tezos]
<https://gitlab.com/tezos/tezos/-/merge_requests/2127>

[`irmin-containers']
<https://mirage.github.io/irmin/irmin-containers/Irmin_containers/index.html>

[`ezirmin'] <https://github.com/kayceesrk/ezirmin>

[`current-bench'] <https://github.com/ocurrent/current-bench/>

[fancy UI overhaul] <https://github.com/ocurrent/current-bench/pull/20>

[`repr'] <https://github.com/mirage/repr>

[`semaphore-compat'] <https://github.com/mirage/semaphore-compat>

[here]
<https://github.com/mirage/irmin/blob/master/CHANGES.md#230-2020-01-12>


Dune 2.8.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-2-8-0/7090/1>


Rudi Grinberg announced
───────────────────────

  On behalf of the dune, I'm pleased to announce the release of dune
  2.8.0. This release contains many bug fixes, performance improvements,
  and interesting new features. I'll point out two new features that I'm
  most excited about.

  First is the experimental `dune_site' extension that makes it possible
  to register and load plugins at runtime. This feature is quite
  involved, but we've documented it extensively [in the manual].

  Another cool feature is that we've eliminated the need for .merlin
  files and all the caveats that came with them.  Now, merlin talks to
  dune directly to get precise configuration for every module. Say
  goodbye to all those "approximate .merlin file" warnings!

  I encourage everyone to upgrade as soon as possible, as earlier
  versions are not compatible with OCaml 4.12. Happy Hacking.

  Full change log:


[in the manual] <https://dune.readthedocs.io/en/stable/sites.html>

2.8.0 (13/01/2021)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • `dune rules' accepts aliases and other non-path rules (#4063,
    @mrmr1993)

  • Action `(diff reference test_result)' now accept `reference' to be
    absent and in that case consider that the reference is empty. Then
    running `dune promote' will create the reference file. (#3795,
    @bobot)

  • Ignore special files (BLK, CHR, FIFO, SOCKET), (#3570, fixes #3124,
    #3546, @ejgallego)

  • Experimental: Simplify loading of additional files (data or code) at
    runtime in programs by introducing specific installation sites. In
    particular it allow to define plugins to be installed in these
    sites. (#3104, #3794, fixes #1185, @bobot)

  • Move all temporary files created by dune to run actions to a single
    directory and make sure that actions executed by dune also use this
    directory by setting `TMPDIR' (or `TEMP' on Windows). (#3691, fixes
    #3422, @rgrinberg)

  • Fix bootstrap script with custom configuration. (#3757, fixes #3774,
    @marsam)

  • Add the `executable' field to `inline_tests' to customize the
    compilation flags of the test runner executable (#3747, fixes #3679,
    @lubegasimon)

  • Add `(enabled_if ...)' to `(copy_files ...)' (#3756, @nojb)

  • Make sure Dune cleans up the status line before exiting (#3767,
    fixes #3737, @alan-j-hu)

  • Add `{gitlab,bitbucket}' as options for defining project sources
    with `source' stanza `(source (<host> user/repo))' in the
    `dune-project' file.  (#3813, @rgrinberg)

  • Fix generation of `META' and `dune-package' files when some targets
    (byte, native, dynlink) are disabled. Previously, dune would
    generate all archives for regardless of settings. (#3829, #4041,
    @rgrinberg)

  • Do not run ocamldep to for single module executables &
    libraries. The dependency graph for such artifacts is trivial
    (#3847, @rgrinberg)

  • Fix cram tests inside vendored directories not being interpreted
    correctly.  (#3860, fixes #3843, @rgrinberg)

  • Add `package' field to private libraries. This allows such libraries
    to be installed and to be usable by other public libraries in the
    same project (#3655, fixes #1017, @rgrinberg)

  • Fix the `%{make}' variable on Windows by only checking for a `gmake'
    binary on UNIX-like systems as a unrelated `gmake' binary might
    exist on Windows.  (#3853, @kit-ty-kate)

  • Fix `$ dune install' modifying the build directory. This made the
    build directory unusable when `$ sudo dune install' modified
    permissions. (fix #3857, @rgrinberg)

  • Fix handling of aliases given on the command line (using the `@' and
    `@@' syntax) so as to correctly handle relative paths. (#3874, fixes
    #3850, @nojb)

  • Allow link time code generation to be used in preprocessing
    executable. This makes it possible to use the build info module
    inside the preprocessor.  (#3848, fix #3848, @rgrinberg)

  • Correctly call `git ls-tree' so unicode files are not quoted, this
    fixes problems with `dune subst' in the presence of unicode
    files. Fixes #3219 (#3879, @ejgallego)

  • `dune subst' now accepts common command-line arguments such as
    `--debug-backtraces' (#3878, @ejgallego)

  • `dune describe' now also includes information about executables in
    addition to that of libraries. (#3892, #3895, @nojb)

  • instrumentation backends can now receive arguments via
      `(instrumentation (backend <name> <args>))'. (#3906, #3932, @nojb)

  • Tweak auto-formatting of `dune' files to improve
    readability. (#3928, @nojb)

  • Add a switch argument to opam when context is not default. (#3951,
    @tmattio)

  • Avoid pager when running `$ git diff' (#3912, @AltGr)

  • Add `(root_module ..)' field to libraries & executables. This makes
    it possible to use library dependencies shadowed by local modules
    (#3825, @rgrinberg)

  • Allow `(formatting ...)' field in `(env ...)' stanza to set
    per-directory formatting specification. (#3942, @nojb)

  • [coq] In `coq.theory', `:standard' for the `flags' field now uses
    the flags set in `env' profile flags (#3931 , @ejgallego @rgrinberg)

  • [coq] Add `-q' flag to `:standard' `coqc' flags , fixes #3924,
    (#3931 , @ejgallego)

  • Add support for Coq's native compute compilation mode (@ejgallego,
    #3210)

  • Add a `SUFFIX' directive in `.merlin' files for each dialect with no
    preprocessing, to let merlin know of additional file extensions
    (#3977, @vouillon)

  • Stop promoting `.merlin' files. Write per-stanza Merlin
    configurations in binary form. Add a new subcommand `dune
    ocaml-merlin' that Merlin can use to query the configuration
    files. The `allow_approximate_merlin' option is now useless and
    deprecated. Dune now conflicts with `merlin < 3.4.0' and
    `ocaml-lsp-server < 1.3.0' (#3554, @voodoos)

  • Configurator: fix a bug introduced in 2.6.0 where the configurator
    V1 API doesn't work at all when used outside of dune. (#4046,
    @aalekseyev)

  • Fix `libexec' and `libexec-private' variables. In cross-compilation
    settings, they now point to the file in the host context. (#4058,
    fixes #4057, @TheLortex)

  • When running `$ dune subst', use project metadata as a fallback when
    package metadata is missing. We also generate a warning when `(name
    ..)' is missing in `dune-project' files to avoid failures in
    production builds.

  • Remove support for passing `-nodynlink' for executables. It was
    bypassed in most cases and not correct in other cases in particular
    on arm32.  (#4085, fixes #4069, fixes #2527, @emillon)

  • Generate archive rules compatible with 4.12. Dune longer attempt to
    generate an archive file if it's unnecessary (#3973, fixes #3766,
    @rgrinberg)

  • Fix generated Merlin configurations when multiple preprocessors are
    defined for different modules in the same folder. (#4092, fixes
    #2596, #1212 and #3409, @voodoos)

  • Add the option `use_standard_c_and_cxx_flags' to `dune-project' that
    1.  disables the unconditional use of the `ocamlc_cflags' and
    `ocamlc_cppflags' from `ocamlc -config' in C compiler calls, these
    flags will be present in the `:standard' set instead; and 2. enables
    the detection of the C compiler family and populates the `:standard'
    set of flags with common default values when building CXX
    stubs. (#3875, #3802, fix #3718 and #3528, @voodoos)


lwt-canceler.0.3
════════════════

  Archive: <https://discuss.ocaml.org/t/ann-lwt-canceler-0-3/7092/1>


Raphaël Proust announced
────────────────────────

  On behalf of [Nomadic Labs], I'm happy to announce the release of
  Lwt-canceler version 0.3. Lwt-canceler is a small library to help
  programs written using Lwt to synchronise promises around resource
  clean-up. This library was developed as part of the [Tezos codebase]
  before being released.

  With this version, the code has matured significantly (including
  tests, documentation and some refactoring); the next release will
  probably be a version 1.0 at which point a more robust versioning
  scheme will be used.

  The documentation is available online:
  <https://nomadic-labs.gitlab.io/lwt-canceler/lwt-canceler/Lwt_canceler/index.html>
  The code is released under MIT License and hosted on Gitlab:
  <https://gitlab.com/nomadic-labs/lwt-canceler> The new version is
  available on opam: `opam install lwt-canceler'

  Happy hacking!


[Nomadic Labs] <https://nomadic-labs.com/>

[Tezos codebase] <https://gitlab.com/tezos/tezos>


Interesting OCaml Articles
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/interesting-ocaml-articles/1867/90>


Weng Shiwei announced
─────────────────────

  Let me share my new blog post on understanding `format6' with
  examples.  <https://blog.tail.moe/2021/01/13/format6.html>

  It's almost my reading note for the paper Format Unraveled (on module
  Format) and experiments on utop. I tried not to be too verbose though.


Weng Shiwei later said
──────────────────────

  Well, I made a sequel of `format6' post, *Understanding `format6' in
  OCaml by diagrams*
  <https://blog.tail.moe/2021/01/15/format6-diagram.html>

  This time I just use four examples with four diagrams e.g. it's the
  one for `Scanf.sscanf'

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/f/f18093391072f739d70c68c2ccf4be92441078c2_2_1034x432.png>

  p.s. It's a pity that I missed Gabriel's post [The 6 parameters of
  (’a, ’b, ’c, ’d, ’e, ’f) format6] after writing that one.


[The 6 parameters of (’a, ’b, ’c, ’d, ’e, ’f) format6]
<http://gallium.inria.fr/blog/format6/>


OCaml 4.12.0, first beta release
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-12-0-first-beta-release/7099/1>


octachron announced
───────────────────

  The release of OCaml 4.12.0 is close.

  The set of new features has been stabilized, and core opam packages
  already work with this release. After three alpha releases, we have
  created a first beta version to help you adapt your software to the
  new features ahead of the release. Compared to the last alpha, this
  beta contains only three new bug fixes and one change to the standard
  library.

  The base compiler can be installed as an opam switch with the
  following commands
  ┌────
  │ opam update
  │ opam switch create 4.12.0~beta1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────

  If you want to tweak the configuration of the compiler, you can pick
  configuration options with
  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.12.0~beta1+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  where <option_list> is a comma separated list of ocaml-option-*
  packages. For instance, for a flambda and afl enabled switch:
  ┌────
  │ opam switch create 4.12.0~beta1+flambda+afl
  │ --packages=ocaml-variants.4.12.0~beta1+options,ocaml-option-flambda,ocaml-option-afl
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  All available options can be listed with "opam search ocaml-option".

  The source code is available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/4.12.0-beta1.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0~beta1.tar.gz>

  If you want to test this version, you may want to install the alpha
  opam repository

  <https://github.com/kit-ty-kate/opam-alpha-repository>

  with

  opam repo add alpha
  git://github.com/kit-ty-kate/opam-alpha-repository.git

  This alpha repository contains various packages patched with fixes in
  the process of being upstreamed. Once the repository installed, these
  patched packages will take precedence over the non-patched version.

  If you find any bugs, please report them here:
   <https://github.com/ocaml/ocaml/issues>


Changes from the third alpha release
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Postponed features
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [9533], [10105], [10127] : Added String.starts_with and
    String.ends_with. (Bernhard Schommer, review by Daniel Bünzli,
    Gabriel Scherer and Alain Frisch)


[9533] <https://github.com/ocaml/ocaml/issues/9533>

[10105] <https://github.com/ocaml/ocaml/issues/10105>

[10127] <https://github.com/ocaml/ocaml/issues/10127>


Additional bug fixes
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [9096], [10096]: fix a 4.11.0 performance regression in
    classes/objects declared within a function (Gabriel Scherer, review
    by Leo White, report by Sacha Ayoun)

  • [10106], [10112]: some expected-type explanations where forgotten
    after some let-bindings (Gabriel Scherer, review by Thomas Refis and
    Florian Angeletti, report by Daniil Baturin)

  • [9326], [10125]: Gc.set incorrectly handles the three `custom_*'
    fields, causing a performance regression (report by Emilio Jesús
    Gallego Arias, analysis and fix by Stephen Dolan, code by Xavier
    Leroy, review by Hugo Heuzard and Gabriel Scherer)


[9096] <https://github.com/ocaml/ocaml/issues/9096>

[10096] <https://github.com/ocaml/ocaml/issues/10096>

[10106] <https://github.com/ocaml/ocaml/issues/10106>

[10112] <https://github.com/ocaml/ocaml/issues/10112>

[9326] <https://github.com/ocaml/ocaml/issues/9326>

[10125] <https://github.com/ocaml/ocaml/issues/10125>


OCaml for ARM MacOS
═══════════════════

  Archive: <https://discuss.ocaml.org/t/ocaml-for-arm-macos/6019/23>


Deep in this thread, Xavier Leroy said
──────────────────────────────────────

  It's quite easy to get up to speed using the precompiled OPAM binary
  for macOS/ARM64.

  • Download [opam-2.0.7-arm64-macos].

  • Move it to some directory in your PATH, rename it to `opam', and
    make it executable.  From a Terminal window:
  ┌────
  │ mv ~/Downloads/opam-2.0.7-arm64-macos /usr/local/bin/opam
  │ chmod +x /usr/local/bin/opam
  └────

  • Try to execute it: `opam init'.  You will be blocked by the macOS
    security checks, as the binary is not signed.

  • Open Preferences / Security and Privacy.  There should be a notice
    "opam was blocked because…" and an "Allow Anyway" button.  Click on
    that button.

  • Try again to execute `opam init'.  You will be blocked again, but
    now there is an "Open" button.  Click on that button. `opam init'
    should run and install the OCaml 4.10.2 compiler.

  • From now on, you can run `opam' without being blocked.  Use this
    freedom to `opam install' the packages you need.

  • Some packages that depend on external C libraries may fail to
    install because these C libraries are not available. Normally we
    would rely on Homebrew or MacPorts to provide these C libraries, but
    these package collections are still being ported to macOS/ARM64.

  As a reward for these minor inconveniences, you'll get excellent
  performance running OCaml software such as Coq.  Single-core
  performance on a MacBook Air M1 is 20% better than the best x86
  workstation I have access to.


[opam-2.0.7-arm64-macos]
<https://github.com/ocaml/opam/releases/download/2.0.7/opam-2.0.7-arm64-macos>


Talk on OCaml Batteries at Houston Functional Programmers
═════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/talk-on-ocaml-batteries-at-houston-functional-programmers/7103/1>


Claude Jager-Rubinson announced
───────────────────────────────

  @UnixJunkie will be speaking (virtually, of course) on *OCaml
  Batteries Included* at Houston Functional Programmers, this coming
  Wednesday, Jan 20 at 7pm (U.S. Central time).  His talk will cover
  Batteries' history, place within the OCaml ecosystem, and comparisons
  with OCaml's other alternative standard libraries.  All are welcome to
  join us, even if you're not from Houston.  Complete details and Zoom
  info are at [hfpug.org].


[hfpug.org] <https://hfpug.org>


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Coq 8.13.0 is out]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Coq 8.13.0 is out] <https://coq.inria.fr/news/coq-8-13-0-is-out.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
  [online].

  [Alan Schmitt]


[send me a message] <mailto:alan.schmitt@polytechnique.org>

[the archive] <http://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <http://alan.petitepomme.net/cwn/cwn.rss>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <http://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-07-26 17:54 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-07-26 17:54 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of July 19 to 26,
2022.

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

Help w. my first GADT : unwrapping Sqlite3.Data.t
DocuLib 3.1.2 and MetaDB 1.0.2 now on OPAM
dune 3.4.0
OCaml 5.0, first normal alpha release
Other OCaml News
Old CWN


Help w. my first GADT : unwrapping Sqlite3.Data.t
═════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/help-w-my-first-gadt-unwrapping-sqlite3-data-t/10202/1>


Philippe Strauss asked
──────────────────────

  I would like to convert sqlite3-ocaml returns from Sqlite3.Data.t
  array to plain ocaml types in a tuple. I guess unwrapping the Data.t
  can be done using a GADT, here's my very very first attempt:

  ┌────
  │ (* simulate Sqlite3.Data.t *)
  │ 
  │ type t =
  │ | NONE
  │ | NULL
  │ | INT of int64
  │ | FLOAT of float
  │ | TEXT of string
  │ | BLOB of string ;;
  │ 
  │ (* a simple GADT to unwrap Sqlite3.Data.t *)
  │ 
  │ type _ dbval =
  │     | INT : int64 -> int64 dbval
  │     | FLOAT : float -> float dbval
  │     | TEXT : string -> string dbval
  │     | BLOB : string -> string dbval
  │     | NONE | NULL ;;
  │ 
  │ let unwrap_data : type a. a dbval -> a = fun dbval ->
  │     match dbval with
  │     | INT x -> x
  │     | FLOAT x -> x
  │     | TEXT str -> str
  │     | BLOB str -> str ;;
  │ 
  │ let tuple_of_array4 (arr: t array) =
  │     assert (Array.length arr = 4) ;
  │     (unwrap_data arr.(0), unwrap_data arr.(1), unwrap_data arr.(2), unwrap_data arr.(3)) ;;
  └────

  Compilation fails with this typing error:

  ┌────
  │ File "database.ml", line 233, characters 17-24:
  │ 233 |     (unwrap_data arr.(0), unwrap_data arr.(1), unwrap_data arr.(2), unwrap_data arr.(3)) ;;
  │ 		       ^^^^^^^
  │ Error: This expression has type t but an expression was expected of type
  │ 	 'a dbval
  └────

  What am I doing wrong? I need to make type t compatible with type 'a
  dbval.  Thanks in advance.


octachron replied
─────────────────

  You cannot make the type `t' and `'a dbval' compatible, there are
  different types.

  A very important point to keep in mind with GADTs is that one cannot
  create type-level information from dynamical values. In other words,
  there are no functions of type ~ x : t -> f(x) dbval~that will infer
  the type of its return from the value of its argument in OCaml.

  Thus the type of the final result must come from your code source
  rather than from the dynamical data.  For instance, you can define
  constructor from the type `t' to the right `dbval' type:
  ┌────
  │ exception Type_error
  │ 
  │ let int: t -> _ dbval = function
  │ | INT x -> INT x
  │ | _ -> raise Type_error
  │ 
  │ let float: t -> _ dbval = function
  │ | FLOAT x -> FLOAT x
  │ | _ -> raise Type_error
  └────
  Then if you know the type of the tuple, you can write it as:
  ┌────
  │ let tuple_of_array4 (arr: t array) =
  │     assert (Array.length arr = 4) ;
  │     int arr.(0), int arr.(1), int arr.(2), int arr.(3)
  └────
  or possibly as
  ┌────
  │ let int4 = int, int, int, int
  │ let tuple (a,b,c,d) arr =
  │   assert (Array.length arr = 4) ;
  │   a arr.(0), b arr.(1), c arr.(2), d arr.(3)
  └────
  There are more complex alternatives based on type witness, that allow
  to implement a form of static matching over the dynamical type of
  data, but the core idea that the types are always present in the
  source code in some way is the same.


Philippe Strauss then said
──────────────────────────

  Oh I didn't noticed it would be dynamical typing! I'm too used to ppx
  (and previously camlp4) written db abstraction layer!

  I'm simply replacing sqlexpr by plain sqlite3-ocaml in some existing
  code of mine. sqlexpr quick doco:

  <https://github.com/mfp/ocaml-sqlexpr>

  But I can live with a Data.t array!


Yawar Amin then added
─────────────────────

  Everybody has their favourite way of wrapping SQLite. Here's mine (no
  PPX): <https://github.com/yawaramin/ocaml_sql_query>

  It has a little data translation layer to convert from `Data.t' array
  to the desired return type.


DocuLib 3.1.2 and MetaDB 1.0.2 now on OPAM
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/doculib-3-1-2-and-metadb-1-0-2-now-on-opam/10204/1>


nguermond announced
───────────────────

  I'm pleased to announce the release of `doculib' and `metadb', now
  available on OPAM.

  *DocuLib* is a GUI for document management, particularly for all the
  textbooks and articles you've accumulated but know you'll never read
  :thinking:. The idea of DocuLib is to keep track of metadata of files
  stored across multiple libraries on your file system in such a way
  that you can move, reorganize, or rename a file without losing your
  metadata. You can additionally lookup metadata on `openlibrary.org' or
  `semanticscholar.org'. DocuLib will also warn about missing and
  duplicate files. Stored metadata presently includes author, title,
  year, tags, and DOI/ISBN.

  <https://global.discourse-cdn.com/standard11/uploads/ocaml/original/2X/f/fa064cd32bce6e52722d30047d8e0ef21fa09684.png>

  For more screenshots and details:
  <https://github.com/nguermond/doculib>

  *Metadb* is the JSON database for manipulating file metadata
  underlying DocuLib, in hopes that it may be useful somewhere
  else. Data is stored in the following way:
  ┌────
  │ path/to/library
  │ |- .metadata
  │    |- ./foo.txt.json
  │    |- ./blah/bar.pdf.json
  │    |- ./foobar.pdf.json
  │ |- ./foo.txt
  │ |- ./blah/bar.pdf
  │ |- ./foobar.pdf
  └────
  For documentation: <https://github.com/nguermond/metadb>


dune 3.4.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-4-0/10211/1>


Etienne Millon announced
────────────────────────

  On behalf of the dune team, I’m pleased to announce the release of
  version 3.4.0.

  Bug fixes, a couple new features, better hints and error messages - I
  won't restate what's in the changelog below.  Thanks to everyone
  involved in this release!

  • Make `dune describe' correctly handle overlapping implementations
    for virtual libraries (#5971, fixes #5747, @esope)

  • Building the `@check' alias should make sure the libraries and
    executables don't have dependency cycles (#5892, @rgrinberg)

  • [ctypes] Add support for the `errno' parameter using the
    `errno_policy' field in the ctypes settings. (#5827, @droyo)

  • Fix `dune coq top' when it is invoked on files from a subdirectory
    of the directory containing the associated stanza (#5784, fixes
    #5552, @ejgallego, @rlepigre, @Alizter)

  • Fix hint when an invalid module name is found. (#5922, fixes #5273,
    @emillon)

  • The `(cat)' action now supports several files. (#5928, fixes #5795,
    @emillon)

  • Dune no longer uses shimmed `META' files for OCaml 5.x, solely using
    the ones installed by the compiler. (#5916, @dra27)

  • Fix handling of the `(deps)' field in `(test)' stanzas when there is
    an `.expected' file. (#5952, #5951, fixes #5950, @emillon)

  • Ignore insignificant filesystem events. This stops RPC in watch mode
    from flashing errors on insignificant file system events such as
    changes in the `.git/' directory. (#5953, @rgrinberg)

  • Fix parsing more error messages emitted by the OCaml compiler. In
    particular, messages where the excerpt line number started with a
    blank character were skipped. (#5981, @rgrinberg)

  • env stanza: warn if some rules are ignored because they appear after
    a wildcard rule. (#5898, fixes #5886, @emillon)

  • On Windows, XDG_CACHE_HOME is taken to be the
    `FOLDERID_InternetCache' if unset, and XDG_CONFIG_HOME and
    XDG_DATA_HOME are both taken to be `FOLDERID_LocalAppData' if unset.
    (#5943, fixes #5808, @nojb)


Etienne Millon then added
─────────────────────────

  This broke 32-bit cygwin installations, so 3.4.1 was released with a
  fix.


OCaml 5.0, first normal alpha release
═════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-5-0-first-normal-alpha-release/10216/1>


octachron announced
───────────────────

  The stabilisation of OCaml 5.0 has been progressing well during the
  last month.  We have thus released a first normal alpha release of
  OCaml 5.0.0 to help fellow hackers join us early in our bug hunting
  and opam ecosystem fixing fun (see below for the installation
  instructions).

  You can follow the progress in stabilising the opam ecosystem on

  <https://github.com/ocaml/opam-repository/issues/21526>

  If you find any bugs, please report them here:

  <https://github.com/ocaml/ocaml/issues>

  Compared to the zeroth alpha release, this alpha release restores the
  support for the bytecode debugger, and integrates a change of type in
  the FFI API that might trigger some warnings in FFI code.

  We also have a change in the installed files: the compiler distributes
  now its own META files rather than relying on either findlib or dune
  to provide those files. This should simplify the tasks of both tools
  in future version.

  Note there are still some changes expected in the Effect module before
  the next candidate release. Generally, both the Effect and Domain
  modules are still experimental and might change API even during the
  beta releases.

  If you are interested by the ongoing list of bug fixes, the updated
  change log for OCaml 5.0.0 is available at:

  <https://github.com/ocaml/ocaml/blob/5.0/Changes>

  A short summary of the changes since the zeroth alpha release is also
  available below.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands on opam 2.1:
  ┌────
  │ opam update
  │ opam switch create 5.0.0~alpha1
  └────
  For previous version of opam, the switch creation command line is
  slightly more verbose:
  ┌────
  │ opam update
  │ opam switch create 5.0.0~alpha1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  If you want to test this version, it is strongly advised to install
  the alpha opam repository

  <https://github.com/kit-ty-kate/opam-alpha-repository>

  with
  ┌────
  │ opam repo add alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git
  └────
  You can check that the alpha repository has been correctly installed
  with

  ┌────
  │ $ opam repo
  │ 
  │ <><> Repository configuration for switch 5.0.0~alpha1 <><><><><><><><><><><><><>
  │  1 alpha   git+https://github.com/kit-ty-kate/opam-alpha-repository.git
  │  2 default https://opam.ocaml.org
  └────

  This alpha repository contains various fixes in the process of being
  upstreamed which vastly increases the number of opam packages
  currently compatible with OCaml 5.0.0 .

  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌────
  │ opam update
  │ opam switch create <switch_name> ocaml-variants.5.0.0~alpha1+options <option_list>
  └────

  where `option_list' is a comma separated list of `ocaml-option-*'
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 5.0.0~alpha1+flambda+nffa ocaml-variants.5.0.0~alpha1+options ocaml-option-flambda
  │ ocaml-option-no-flat-float-array
  └────
  The command line above is slightly more complicated for opam version
  anterior to 2.1:
  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.5.0.0~alpha1+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────

  In both cases, all available options can be listed with `opam search
  ocaml-option'.

  The source code for the alpha is also available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/5.0.0-alpha1.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~alpha1.tar.gz>


Changes since the zeroth alpha release:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Runtime system:
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#11400]: Runtime events counters fixes Fixes mismatch between OCaml
    and C APIs, removes events from 4.x that are not present in the 5.0
    GC and adds some missing probes.  (Sadiq Jaffer, review by Gabriel
    Scherer, Florian Angeletti)

  • [#11368]: Runtime events buffer size OCAMLRUNPARAMS fix The runtime
    events buffer size can now be set via the 'e' OCAMLRUNPARAM.  This
    is previously mistakenly enabled/disabled tracing instead.  (Sadiq
    Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien
    Doligez)

  • [#11304]: Fix data race on Windows file descriptors (Olivier Nicole
    and Xavier Leroy, review by Xavier Leroy, David Allsopp, and Sadiq
    Jaffer)

  • *breaking change* [#11337]: pass 'flags' metadata to root scanners,
     to optimize stack scanning in the bytecode interpreter. Changes the
     interface of user-provided root-scanning hooks. (Gabriel Scherer,
     review by Xavier Leroy, Guillaume Munch-Maccagnoni, Sadiq Jaffer
     and Tom Kelly)

  • [#11144]: Restore frame-pointers support for amd64 (Fabrice Buoro,
    review by Frederic Bour and KC Sivaramakrishnan)

  • *breaking change* [#11255]: in the C interface, `&Field(v, i)' now
     has type `volatile value *' instead of `value *' in OCaml 4.  This
     makes the memory model for mixed OCaml/C code better defined, but
     can cause warnings or type errors in user C code. (KC
     Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and
     Guillaume Munch-Maccagnoni, additional discussions with Stephen
     Dolan and Luc Maranget)


[#11400] <https://github.com/ocaml/ocaml/issues/11400>

[#11368] <https://github.com/ocaml/ocaml/issues/11368>

[#11304] <https://github.com/ocaml/ocaml/issues/11304>

[#11337] <https://github.com/ocaml/ocaml/issues/11337>

[#11144] <https://github.com/ocaml/ocaml/issues/11144>

[#11255] <https://github.com/ocaml/ocaml/issues/11255>


Standard library:
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#10867], +[#11345]: Remove deprecated values: …, the infix operator
    (.[ ]<-). (Nicolás Ojeda Bär, review by Damien Doligez)

  • [#11309], [#11424], [#11427]: Add
    Domain.recommended_domain_count. (Christiano Haesbaert, Konstantin
    Belousov, review by David Allsopp, KC Sivaramakrishnan, Gabriel
    Scherer, Nicolas Ojeda Bar)


[#10867] <https://github.com/ocaml/ocaml/issues/10867>

[#11345] <https://github.com/ocaml/ocaml/issues/11345>

[#11309] <https://github.com/ocaml/ocaml/issues/11309>

[#11424] <https://github.com/ocaml/ocaml/issues/11424>

[#11427] <https://github.com/ocaml/ocaml/issues/11427>


Tools:
┄┄┄┄┄┄

  • [#11065]: Port the bytecode debugger to 5.0, adding support for
    effect handlers. (Damien Doligez and fabbing, review by fabbing and
    Xavier Leroy)

  • [#11382]: OCamlmktop use a new initialization module
    "OCamlmktop_init" to preserve backward-compatibility with
    user-module provided modules that install toplevel printers.
    (Florian Angeletti, review by Gabriel Scherer and David Allsopp)


[#11065] <https://github.com/ocaml/ocaml/issues/11065>

[#11382] <https://github.com/ocaml/ocaml/issues/11382>


Installation:
┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#11007], [#11399]: META files for the stdlib, compiler-libs and
    other libraries (unix, dynlink, str, runtime_events, threads,
    ocamldoc) are now installed along with the compiler. (David Allsopp,
    Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer, review
    by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel
    Scherer)


[#11007] <https://github.com/ocaml/ocaml/issues/11007>

[#11399] <https://github.com/ocaml/ocaml/issues/11399>


Bug fixes:
┄┄┄┄┄┄┄┄┄┄

  • [#10768], [#11340]: Fix typechecking regression when combining first
    class modules and GADTs. (Jacques Garrigue, report by François
    Thiré, review by Matthew Ryan)

  • [#10790]: don't drop variance and injectivity annotations when
    pretty printing `with' constraints (for example, `with type +!'a t =
    ...'). (Florian Angeletti, report by Luke Maurer, review by Matthew
    Ryan and Gabriel Scherer)

  • [#11289], [#11405]: fix some leaks on systhread termination (Fabrice
    Buoro, Enguerrand Decorne, Gabriel Scherer, review by Xavier Leroy
    and Florian Angeletti, report by Romain Beauxis)

  • [#11314], [#11416]: fix non-informative error message for module
    inclusion (Florian Angeletti, report by Thierry Martinez, review by
    Gabriel Scherer)

  • [#11358], [#11379]: Refactor the initialization of bytecode
    threading, This avoids a "dangling pointer" warning of GCC
    12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel
    Scherer)

  • [#11387], module type with constraints no longer crash the compiler
    in presence of both shadowing warnings and the `-bin-annot' compiler
    flag. (Florian Angeletti, report by Christophe Raffalli, review by
    Gabriel Scherer)


[#10768] <https://github.com/ocaml/ocaml/issues/10768>

[#11340] <https://github.com/ocaml/ocaml/issues/11340>

[#10790] <https://github.com/ocaml/ocaml/issues/10790>

[#11289] <https://github.com/ocaml/ocaml/issues/11289>

[#11405] <https://github.com/ocaml/ocaml/issues/11405>

[#11314] <https://github.com/ocaml/ocaml/issues/11314>

[#11416] <https://github.com/ocaml/ocaml/issues/11416>

[#11358] <https://github.com/ocaml/ocaml/issues/11358>

[#11379] <https://github.com/ocaml/ocaml/issues/11379>

[#11387] <https://github.com/ocaml/ocaml/issues/11387>


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

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

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

  • [Tarides is on the Wavestone Radar!]


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

[Tarides is on the Wavestone Radar!]
<https://tarides.com/blog/2022-07-19-tarides-is-on-the-wavestone-radar>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-07-19  8:58 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-07-19  8:58 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of July 12 to 19,
2022.

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

Gopcaml-mode and Gopcaml-mode merlin (0.0.6) - Phoenix release (Support for OCaml 4.14.0!)
Sandmark Nightly - Benchmarking as a Service
OCamlFormat Web Configurator
Jane Street is Hiring Front End Engineers
BAP 2.5.0 Release
Why I used OCaml to developed a utility to download Jira items
Liquidsoap 2.1.0
Vim now highlights types, feedback welcome
Other OCaml News
Old CWN


Gopcaml-mode and Gopcaml-mode merlin (0.0.6) - Phoenix release (Support for OCaml 4.14.0!)
══════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-gopcaml-mode-and-gopcaml-mode-merlin-0-0-6-phoenix-release-support-for-ocaml-4-14-0/10164/1>


Kiran Gopinathan announced
──────────────────────────

  Like the *phoenix*, /Gopcaml-mode/ *rises* again from the ashes!…

  …this time with support for OCaml 4.14.0 and OCaml 4.13.0 (by popular
  demand)

  See the [original release post ] for detailed instructions on how you
  can install it.


[original release post ]
<https://discuss.ocaml.org/t/introducing-gopcaml-mode-structural-ocaml-editing/5310>

Screenshots (if you haven't seen them before)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  <https://global.discourse-cdn.com/standard11/uploads/ocaml/original/2X/a/abc1ff0b5dbbefe2beb150f2c09148cb5472ece2.gif>

  <https://global.discourse-cdn.com/standard11/uploads/ocaml/original/2X/1/1d43e0f42cc17a30053ee4c71460e70e4061f711.gif>


Video
╌╌╌╌╌

  <https://www.youtube.com/watch?v=KipRuiLXYEo>


What's next?
╌╌╌╌╌╌╌╌╌╌╌╌

  • Support for OCaml 5.0
  • Better ergonomics for piping (i.e `_ |> _')
  • … you decide! (feature requests/pull requests welcome!)


Sandmark Nightly - Benchmarking as a Service
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-sandmark-nightly-benchmarking-as-a-service/10174/1>


Shakthi Kannan announced
────────────────────────

  Tarides is happy to announce Sandmark Nightly benchmarking as a
  service. tl;dr OCaml compiler developers can now point development
  branches at the service and get sequential and parallel benchmark
  results at <https://sandmark.tarides.com>.

  [Sandmark] is a collection of sequential and parallel OCaml
  benchmarks, its dependencies, and the scripts to run the benchmarks
  and collect the results. Sandmark was developed for the Multicore
  OCaml project in order to (a) ensure that OCaml 5 (with multicore
  support) does not introduce regressions for sequential programs
  compared to sequential OCaml 4 and (b) OCaml 5 programs scale well
  with multiple cores. In order to reduce the noise and get actionable
  results, Sandmark is typically run on [tuned machines].  This makes it
  harder for OCaml developers to use Sandmark for development who may
  not have tuned machines with a large number of cores.

  To address this, we introduce Sandmark Nightly service which runs the
  sequential and parallel benchmarks for a set of compiler /variants/
  (branch/commit/PR + compiler & runtime options) on two tuned machines:

  • Turing (28 cores, Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz, 64 GB
    RAM)
  • Navajo (128 cores, AMD EPYC 7551 32-Core Processor, 504 GB RAM)

  OCaml developers can request their development branches to be added to
  the nightly runs by adding it to [sandmark-nightly-config]. The
  results will appear the following day at
  <https://sandmark.tarides.com>.

  Here is an illustration of sequential benchmark results from the
  service:

  <https://i.imgur.com/Mn7VZky.png>

  You should first specify the `number of variants' that you want for
  comparison, and then select either the `navajo' or `turing'
  hostnames. The dates for which benchmark results are available are
  then listed in the `date' column. If there are more than one result on
  a given day, then the specific variant name, SHA1 commit and date are
  displayed together for selection. You need to choose one of the
  variants as a baseline for comparison. In the following graph, the
  `5.1.0+trunk+sequential_20220712_920fb8e' build on the `navajo' server
  has been chosen as the baseline, and you can see the normalized time
  (seconds) comparison for the various Sandmark benchmarks for both
  `5.1.0+trunk+sequential_20220713_c759890' and
  `5.1.0+trunk+sequential_20220714_606abe8' variants. We observe that
  the `matrix_multiplication' and `soli' benchmark have become 5% slower
  as compared to the July 12, 2022 nightly run.

  <https://i.imgur.com/7b0yS0h.png>

  Similarly, the normalized MaxRSS (KB) graph for the same baseline and
  variants chosen for comparison is illustrated below:

  <https://i.imgur.com/SfMbEiu.png>

  The `mandelbrot6' and `fannkuchredux' benchmarks have increased the
  MaxRSS (KB) by 3% as compared to the baseline variant, whereas, the
  metric has significantly improved for the `lexifi-g2pp' and
  `sequence_cps' benchmarks.

  The parallel benchmark speedup results are also available from the
  Sandmark nightly runs.

  <https://i.imgur.com/uKFDXCv.png>

  <https://i.imgur.com/24BGXVZ.png>

  We observe from the speedup graph that there is not much difference
  between `5.1.0+trunk+parallel_20220714_606abe8' and the
  `5.1.0+trunk+decouple_20220706_eb7a38d' developer branch results. The
  x-axis in the graph represents the number of domains, while the y-axis
  corresponds to the speedup. The number in the parenthesis against each
  benchmark refers to the corresponding running time of the sequential
  benchmark. These comparison results are useful to observe any
  performance regressions over time. It is recommended to use the
  `turing' machine results for the parallel benchmarks as it is tuned.

  If you would like to use Sandmark nightly for OCaml compiler
  development, please do ping us for access to the
  [sandmark-nightly-config] repository so that you may add your own
  compiler variants.


[Sandmark] <https://github.com/ocaml-bench/sandmark>

[tuned machines]
<https://github.com/ocaml-bench/ocaml_bench_scripts#notes-on-hardware-and-os-settings-for-linux-benchmarking>

[sandmark-nightly-config]
<https://github.com/ocaml-bench/sandmark-nightly-config>


OCamlFormat Web Configurator
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocamlformat-web-configurator/10103/6>


Louis Roché announced
─────────────────────

  Thanks to [Pomba Magar] we now have a code editor with
  highlighting. It hopefully should also solve the lack of monospace
  font on safari.

  <https://global.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/9/96fb3536409c5553926228f097812d5b63bd6db8_2_1380x798.jpeg>


[Pomba Magar] <https://github.com/pjmp>


Jane Street is Hiring Front End Engineers
═════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/jane-street-is-hiring-front-end-engineers/10183/1>


Matt Russell announced
──────────────────────

  Jane Street is looking to hire Front End Engineers that want to design
  and build our next-generation of browser-based tools for operating our
  trading infrastructure (in OCaml).  We’re building tools for expert
  users, and want to maintain a high UX bar while building tools that
  are powerful and flexible, so it’s a challenging domain.

  Ron Minsky wrote a bit more about the role here:
  <https://twitter.com/yminsky/status/1541605410691596289?s=20&t=yyrhGx7TnNwPIwdZoArpGw>

  And you can find a link to the job descriptions and the application
  page here:

  • NYC: [Front End Software Engineer: Experienced: Jane Street]
  • LDN: [Front End Software Engineer: Experienced: Jane Street]


[Front End Software Engineer: Experienced: Jane Street]
<https://www.janestreet.com/join-jane-street/position/6184529002/>

[Front End Software Engineer: Experienced: Jane Street]
<https://www.janestreet.com/join-jane-street/position/6236002002/>


BAP 2.5.0 Release
═════════════════

  Archive: <https://discuss.ocaml.org/t/ann-bap-2-5-0-release/10185/1>


Ivan Gotovchits announced
─────────────────────────

  We are proud to announce the 2.5.0 release of the Carnegie Mellon
  University Binary Analysis Platform (CMU BAP). This is one of the
  biggest releases of BAP with lots of new [features and bug fixes]. In
  this release, we significantly improved BAP performance (in some use
  cases by a factor of three) and reduced memory consumption (up to a
  factor of two). In addition, we devised a new method for representing
  floating-point operations that is scalable and efficient and now we
  enable floating-point lifters for all x86 binaries with little to no
  extra overhead. The floating-point support for other targets is
  coming! We also rewrote the ABI specifications and now support dozens
  of different ABI.  The new ABIs support calling conventions for
  structures and floating-point values and the `bap-c` library was
  significantly expanded with lots of new functions and types to
  describe C types and C object layouts.

  You can install bap with

  ┌────
  │ opam install bap.2.5.0
  └────

  Do not forget to `opam update' before that.


[features and bug fixes]
<https://github.com/BinaryAnalysisPlatform/bap/releases/tag/v2.5.0>


Why I used OCaml to developed a utility to download Jira items
══════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/why-i-used-ocaml-to-developed-a-utility-to-download-jira-items/10186/1>


Willem Hoek announced
─────────────────────

  Not a technical post – but my notes on why I decided to used OCaml to
  develop a small utility that download Jira items to SQLite
  [https://whoek.com/b/jira-to-sqlite-with-scrumdog]

  The Hacker News comments here
  [https://news.ycombinator.com/item?id=32109461]


[https://whoek.com/b/jira-to-sqlite-with-scrumdog]
<https://whoek.com/b/jira-to-sqlite-with-scrumdog>

[https://news.ycombinator.com/item?id=32109461]
<https://news.ycombinator.com/item?id=32109461>


Liquidsoap 2.1.0
════════════════

  Archive: <https://discuss.ocaml.org/t/ann-liquidsoap-2-1-0/10192/1>


Romain Beauxis announced
────────────────────────

  Liquidsoap `2.1.0' was just released, some `10 months after the
  initial release of the ~2.0.x' release cycle!

  The release is available here:
  <https://github.com/savonet/liquidsoap/releases/tag/v2.1.0> and should
  be coming through `opam' pretty soon.


🤔  What is liquidsoap?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Liquidsoap is a statically-typed, type-inferred, functional scripting
  language equipped with specialized operators to build audio and video
  stream automation.

  The liquidsoap language offers all the flexibility and expressivity of
  a fully featured programming language to help build your media
  streams.

  Using liquidsoap, one can very quickly stand up a media streaming
  platform that can rotate files from playlists, accept live DJ input,
  mux audio and video, encode (or not!) and send the resulting data to
  youtube, icecast, HLS and more..


:white_check_mark: Why liquidsoap?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  While there are many tools that offer competing features, the real
  difference with liquidsoap is its scripting language.

  Setting up tools using configuration files is often easier and more
  straight forward, however, when it comes to the finer details, such as
  inserting jingles between shows, defining crossfades between tracks
  and more, potentially, each project has its own set of expectations,
  and this is where liquidsoap becomes really useful!


:zap:️ What's new in Liquidsoap 2.1.0?                              :zap:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Lots of things have been brewing since the `2.0.0' release. This new
  release branch is intended to bring up some of the breaking changes
  that were introduced while we keep working on more exciting future
  changes that we have on our [roadmap]

  Some noticeable changes include:


[roadmap] <https://github.com/savonet/liquidsoap/blob/main/ROADMAP.md>

Improved JSON parsing
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  You should now be able to do:
  ┌────
  │ let json.parse ({
  │   foo,
  │   bla,
  │   gni
  │ } : {
  │   foo: string,
  │   bla: float,
  │   gni: bool
  │ }) = '{ "foo": "aabbcc", "bla": 3.14, "gni": true }'
  └────
  For any one who has ever tried to parse json in their liquidsoap
  scripts, this is gonna be a game changer. We have a detailed article
  [here]


[here] <https://www.liquidsoap.info/doc-dev/json.html>


Regular expressions are now first-class entities.
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  This should be familiar to anyone used to working with Javascript's
  regular expression. So, now, instead of doing:

  ┌────
  │ string.match(pattern="\\d+", s)
  └────

  You will now do:

  ┌────
  │ r/\d+/.test(s)
  └────

  There's a detailed description of this new feature [here].


[here]
<https://www.liquidsoap.info/doc-dev/language.html#regular_expressions>


Vim now highlights types, feedback welcome
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/vim-now-highlights-types-feedback-welcome/10198/1>


Maëlan announced
────────────────

  [A patch] just made its way to [the community-maintained Vim files for
  OCaml] (not propagated to the [official Vim distribution], yet), that
  tries to highlight types. IMHO the patch is large and hacky so you may
  want to try it cautiously, and *feedback would be appreciated*. :-)

  The former behavior was to highlight identifiers that happened to be
  the name of a builtin type (such as `int' or `list'), regardless of
  where they appeared. Now, in principle, all type expressions can be
  highlighted, and be so only when in a type context. By default, only
  builtin types are highlighted, but you can unleash the full power of
  the new linter:

  ┌────
  │ " put this in ~/.vim/after/syntax/ocaml.vim for instance:
  │ hi link ocamlTypeConstr   Type
  │ hi link ocamlTypeBuiltin  Type
  │ hi link ocamlTypeVar      Type
  │ hi link ocamlTypeAnyVar   Type
  └────

  or fancier (if you like excess :rainbow:):

  ┌────
  │ " 112 = light green (the color of the “Type“ hl group with my theme)
  │ hi ocamlTypeConstr       ctermfg=112
  │ hi ocamlTypeBuiltin      ctermfg=112 cterm=bold
  │ hi ocamlTypeVar          ctermfg=112 cterm=italic
  │ hi ocamlTypeAnyVar       ctermfg=112 cterm=bold
  └────

  Even if you don’t care about highlighting types, allowing the linter
  to discriminate between types and exceptions has some tangential
  benefits.


[A patch] <https://github.com/ocaml/vim-ocaml/pull/76>

[the community-maintained Vim files for OCaml]
<https://github.com/ocaml/vim-ocaml>

[official Vim distribution]
<https://github.com/vim/vim/tree/master/runtime>


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

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

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

  • [Faster Incremental Builds with Dune 3]


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

[Faster Incremental Builds with Dune 3]
<https://tarides.com/blog/2022-07-12-faster-incremental-builds-with-dune-3>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-07-12  7:59 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-07-12  7:59 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of July 05 to 12,
2022.

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

Dune how to define custom build task
Timedesc 0.8.0 - modern date time handling
containers 3.9
OBazl 2.0.0-alpha-1 (Building OCaml SW with Bazel)
QCheck 0.19
Opam-cross-windows now supports OCaml 4.14.0!
Other OCaml News
Old CWN


Dune how to define custom build task
════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/dune-how-to-define-custom-build-task/10092/1>


cnmade explained
────────────────

  dune has very powerful extensions, but the documentation doesn't tell
  you directly. Today I'll share a specific example of how we can make
  dune do many things with a dune configuration.

  For example

  • Publish compiled documents to our documentation server
  • Sending email notifications to email groups
  • Sending SMS notifications to administrators
  • Build a document and open a browser to preview the document page

  Let's start with an example, we create a dune file in the root
  directory of our project, which you may not have originally, you have
  to create a new one, we enter the following

  ┌────
  │ ; now we tell you how to define a custom rule
  │ ; rule start with (rule )
  │ (rule
  │ ; (alias is point  the command name , so you can run this rule by call  dune build @docopen
  │  (alias docopen)
  │  ; following line is very important, it tell dune do not cache this build command, so it will running every call
  │ without any cache
  │  (deps (universe))
  │  ; action  (system  to told system run command by `sh` in your Linux/MacOS, windows user may running cmd.exe
  │  ; cd ../.. is change the base directory of the running command ,or the default directory will be _build/default
  │  (action (system "cd ../.. && pwd &&  dune build @doc && open _build/default/_doc/_html/index.html" ))
  │ )
  │ ; end of one piece of rule
  │ 
  │ ; and we define more and more rule as we want
  │ (rule
  │   (alias whoami)
  │   (deps (universe))
  │   (action (system "uname -a;whoami"))
  │ )
  └────

  In this example, we define two rules, the rules are the tasks that
  dune can recognize, in dune, it is called rules

  Because it is a custom build command, we use alias to take a unique
  and non-repeating alias.

  The first build command is to build the document and open the browser
  preview.

  Our alias is docopen

  Then deps we add universe to tell dune that you don't want to cache
  and give me a new build every time. If you don't add this line, dune
  will only give you one build, and then because of the cache, you won't
  be able to execute it later.

  action following by system here, action is the command to start,
  system means to use the system shell (windows is cmd, linux macos is
  sh) to give you the execution of the code you specify.

  You can see the first we are first change the directory to the project
  root directory [because the default directory is _build/default], and
  then we perform the build document generation, and then open open the
  generated html page.

  The first build command is this, if you want to perform the first
  build task, you can type

  `dune build @docopen'

  Then our second build command, relatively simple, with reference to
  the first, we can add a lot of build commands we want to add inside
  this dune configuration file.

  We just need to specify different alias aliases for them, no
  duplication.

  The official documentation also specifies some other available
  commands, I won't go into them one by one. Since I prefer to use shell
  scripts, I really only need the system to execute my shell scripts for
  me.


Timedesc 0.8.0 - modern date time handling
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-timedesc-0-8-0-modern-date-time-handling/10138/1>


Darren announced
────────────────

  I'm pleased to announce the release of Timedesc 0.8.0.

  Timedesc is a very comprehensive date time handling library with good
  support of time zone.

  [Homepage]


[Homepage] <https://github.com/daypack-dev/timere>

Features
╌╌╌╌╌╌╌╌

  • Timestamp and date time handling with platform independent time zone
    support
    • Subset of the IANA time zone database is built into this library
  • Supports Gregorian calendar date, ISO week date, and ISO ordinal
    date
  • Supports nanosecond precision
  • ISO8601 parsing and RFC3339 printing


Main changes since 0.6.0
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Significantly reduced size of time zone database by using a custom
    compression scheme
    • Many thanks to @glennsl for the proposed scheme at issue [#46]
    • This yields reduction of roughly 82% for same date period. The
      exact range of years included has been tuned slightly as well and
      I've lost track of the exact size after compilation.
  • Significantly reduced the number of dependencies, and moved JS, JSON
    code into separate packages
    • Removed dependencies: `fmt', `containers', `oseq'
      • Introduced `sexplib' dependency for sexp handling consequently
        as previously containers `CCSexp' was used
    • Moved JSON code into `timedesc-json' package along with Yojson
      dependency
    • Moved `tzlocal' and `tzdb' stuff into their own separate packages
      (`timedesc-tzlocal' and `timedesc-tzdb' respectively)
    • Moved JS tzlocal backend into `timedesc-tzlocal-js' (along with JS
      specific dependencies)


[#46] <https://github.com/daypack-dev/timere/issues/46>


Quality of life changes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Updated string conversion functions based on pretty printers which
    raise `Date_time_cannot_deduce_offset_from_utc' to raise the
    exception instead of returning `None'
    • This simplifies the handling as return type is now simply just
      `string'
    • And for serious stuff users are expected to use only unambiguous
      date times anyway, which would not trigger this exception
  • Added ISO8601 printing facilities to `Timestamp' module for
    consistency
    • They are just aliases to the RFC3339 printers


containers 3.9
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-containers-3-9/10140/1>


Simon Cruanes announced
───────────────────────

  I'm happy to announce that containers 3.9 has just been
  released. Containers is a lightweight, modular extension of the stdlib
  that tries to remains compatible with it.

  Containers is starting to sprout some serialization primitives: it now
  has codecs for Bencode and CBOR. This release also contains a revamp
  of the testlib system (bye qtest) and the use of ocamlformat, for
  potential contributors who enjoy that. Containers should also be
  compatible with OCaml 5.0.


OBazl 2.0.0-alpha-1 (Building OCaml SW with Bazel)
══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/obazl-2-0-0-alpha-1-building-ocaml-sw-with-bazel/10142/1>


Gregg Reynolds announced
────────────────────────

  I've tagged alpha versions of OBazl [rules_ocaml] and [tools_opam].
  The best way to start exploring is via [demos_obazl], which contains
  over 100 mostly simple demo/test programs, many of which are
  commented.  Three simple commands get you configured and then `bazel
  test test' runs all the tests.

  Tested on MacOS 12.4 and Ubuntu 20.

  Documentation is still in progress but there is useful info at [The
  OBazl Book].

  Lot's of things to say about this version but I'll stick to one point
  of interest.  The four basic OCaml compilers are modeled by Bazel's
  platforms and toolchains mechanisms.  Two of the compilers are
  actually cross-compilers (e.g.  `ocamlc.opt' runs on the system arch
  but targets the OCaml vm), so to pick a compiler you tell OBazl which
  buildhost and targethost platforms you want.  I've predefined
  configurations in [.bazelrc]; for example:

  ┌────
  │ build:bcnc --host_platform=@opam//tc/host/build:bc
  │ build:bcnc --platforms=@opam//tc/host/target:nc
  └────
  which means to select the `ocamlopt.byte' (cross-)compiler, pass
  `--config=bcnc'.

  Kinda cool IMHO. Maybe overkill for the basic compilers, but the
  mechanism is essential to support remote builds, custom compiler
  implementations and genuine cross-compilers.

  Feedback welcome.


[rules_ocaml] <https://github.com/obazl/rules_ocaml>

[tools_opam] <https://github.com/obazl/tools_opam>

[demos_obazl]
<https://github.com/obazl/demos_obazl/blob/main/rules_ocaml/README.adoc>

[The OBazl Book] <https://obazl.github.io/docs_obazl/>

[.bazelrc]
<https://github.com/obazl/demos_obazl/blob/main/rules_ocaml/.bazelrc>


QCheck 0.19
═══════════

  Archive: <https://discuss.ocaml.org/t/ann-qcheck-0-19/10149/1>


Jan Midtgaard announced
───────────────────────

  I'm happy to share the release of QCheck 0.19 - a library for
  property-based testing in OCaml in the style of Haskell's QuickCheck.

  • GitHub repo: <https://github.com/c-cube/qcheck>
  • Documentation: <https://c-cube.github.io/qcheck/0.19/>

  The 0.19 release brings a range of new features and improvements
  detailed below and combines the effort of several individual
  contributors.

  It is now available on opam.

  Release notes:

  • new features and feature extensions
    • add optional `debug_shrink' parameters in alcotest interface and
      expose default `debug_shrinking_choices' in test runners
    • add missing `?handler' parameter to `Test.check_cell_exn'
    • add an option `retries' parameter to `Test.make' et al. for
      checking a property repeatedly while shrinking.  This can be
      useful when testing non-deterministic code.
    • add `tup2' to `tup9' for generators
    • add `Test.make_neg' for negative property-based tests, that are
      expected not to satisfy the tested property.
    • add environment variable `QCHECK_LONG_FACTOR' similar to
      `QCHECK_COUNT'
    • rename `Gen.opt' to `Gen.option' but keep the old binding for
      compatibility.
    • shrinker changes
      • recursive `list' shrinker with better complexity
      • `string' shrinker reuses improved `list' shrinker and adds
        `char' shrinking
      • function shrinker now shrinks default entry first and benefits
        from `list' shrinker improvements
      • replacing the linear-time `char' shrinker with a faster one
        reusing the bisecting `int' shrinker algorithm
      • add `Shrink.char_numeral' and `Shrink.char_printable'
      • add shrinking for `char arbitrary~s ~char', `printable_char',
        and `numeral_char'

  • bug fixes
    • fix function generation affecting reproducability
    • fix distribution of `QCheck2.printable' which would omit certain
      characters
    • use `Float.equal' for comparing `float~s in the ~Observable'
      module underlying function generators.

  • documentation updates:
    • clarify upper bound inclusion in `Gen.int_bound' and
      `Gen.int_range'
    • clarify `printable_char' and `Gen.printable' distributions
    • add missing `string_gen_of_size' and `small_printable_string'
      documentation
    • document `QCheck_alcotest.to_alcotest'
    • fix documented size distribution for `arbitrary' generators
      `string_gen', `string', `printable_string', `numeral_string',
      `list', and `array'
    • fix exception documentation for `check_result', `check_cell_exn',
      and `check_exn'
    • fix documentation for the distribution of `Gen.printable' and
      `printable_char'
    • fix documentation for the shrinking behaviour of
      `QCheck2.printable'

  • internal and test suite changes
    • add additional expect and unit tests and refactor expect test
      suite
    • add a shrinker performance benchmark
    • remove `--no-buffer' option on `dune runtest' to avoid garbling
      the test output
    • make test suite run on 32-bit architectures


Opam-cross-windows now supports OCaml 4.14.0!
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/opam-cross-windows-now-supports-ocaml-4-14-0/10159/1>


Romain Beauxis announced
────────────────────────

  Bit of a late announcement but the `opam-cross-windows' project now
  supports the OCaml compiler version `4.14.0':
  <https://github.com/ocaml-cross/opam-cross-windows>

  The `opam-cross-windows' project is part of an initiative started by
  @whitequark to provide cross-compilation support to existing `opam'
  packages. This allows users to compile binaries for windows but also
  android and ios on a linux or macos host.

  Support for packages is a on best-effort basis and is always looking
  for more contributors. Adding a package can be a little tricky at
  times but, if your package uses `dune', the cross-compilation support
  there is pretty wonderful and makes it pretty easy to add
  cross-compiled packages.


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

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

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

  • [The Magic of Merlin]
  • [Thales Cyber@Station F Selection]
  • [Team Tarides Visits a 17th Century Chateau]
  • [Functional Conf 2022]
  • [OCaml 5 Alpha Release]
  • [Adding Merkle Proofs to Tezos]
  • [OCaml Matrix: A Virtual World]
  • [Tarides Sponsors 12th Annual Journées Franciliennes]
  • [OCaml.org Reboot: User-Centric Design & Content]
  • [Lightning Fast with Irmin: Tezos Storage is 6x faster with 1000 TPS
    surpassed]
  • [Tarides Partners with 50inTech!]
  • [What's New in MirageOS 4!]


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

[The Magic of Merlin]
<https://tarides.com/blog/2022-07-05-the-magic-of-merlin>

[Thales Cyber@Station F Selection]
<https://tarides.com/blog/2022-06-28-thales-cyber-station-f-selection>

[Team Tarides Visits a 17th Century Chateau]
<https://tarides.com/blog/2022-06-23-team-tarides-visits-a-17th-century-chateau>

[Functional Conf 2022]
<https://tarides.com/blog/2022-06-21-functional-conf-2022>

[OCaml 5 Alpha Release]
<https://tarides.com/blog/2022-06-15-ocaml-5-alpha-release>

[Adding Merkle Proofs to Tezos]
<https://tarides.com/blog/2022-06-13-adding-merkle-proofs-to-tezos>

[OCaml Matrix: A Virtual World]
<https://tarides.com/blog/2022-06-09-ocaml-matrix-a-virtual-world>

[Tarides Sponsors 12th Annual Journées Franciliennes]
<https://tarides.com/blog/2022-06-02-tarides-sponsors-12th-annual-journ-e-francilienne>

[OCaml.org Reboot: User-Centric Design & Content]
<https://tarides.com/blog/2022-05-02-ocaml-org-reboot-user-centric-design-content>

[Lightning Fast with Irmin: Tezos Storage is 6x faster with 1000 TPS
surpassed]
<https://tarides.com/blog/2022-04-26-lightning-fast-with-irmin-tezos-storage-is-6x-faster-with-1000-tps-surpassed>

[Tarides Partners with 50inTech!]
<https://tarides.com/blog/2022-04-19-tarides-partners-with-50intech>

[What's New in MirageOS 4!]
<https://tarides.com/blog/2022-04-14-what-s-new-in-mirageos-4>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-07-05  7:42 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-07-05  7:42 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 28 to July
05, 2022.

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

An amusing use of first-class modules: reading from plaintext and compressed files
TLS signature with opam:tls
Open Source tooling engineer at Jane Street
Dune how to define custom build task
Lwt.5.6.0 (and other Lwt packages)
Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
OCamlFormat Web Configurator
Release of optiml-transport
Old CWN


An amusing use of first-class modules: reading from plaintext and compressed files
══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/an-amusing-use-of-first-class-modules-reading-from-plaintext-and-compressed-files/10073/9>


Continuing this thread, Maëlan asked and Simon Cruanes replied
──────────────────────────────────────────────────────────────

        You got me curious: what’s the reason for using a
        first-class module here instead of a record or an object?

  Of course!

  • compared to records, I find first-class modules to be a lot more
    convenient for this use case. I still use records for _data_, but a
    record-of-function is often less convenient. For example, modules
    allow you to use `include', they directly handle down-casting as a
    way to hide internal state (whereas for modules you need to close
    over values created before the record); module types are structural,
    so I don't need to worry about disambiguation, whereas records need
    more care there. In terms of performance both seem exactly the same,
    from my toy benchmarks.
  • compared to objects, first-class modules are a bit less convenient
    (no runtime-free cast, no true inheritance/mixin), but LSP and other
    tools are fragile. In addition, invoking an object method seems to
    be roughly twice as slow as a record/module field access — I suppose
    it's because the latter is just an access via offset. That's on a
    micro benchmark so in reality it might be worse.


TLS signature with opam:tls
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/tls-signature-with-opam-tls/9399/10>


Marcus Rohrmoser announced
──────────────────────────

  just implemented key generation
  <https://codeberg.org/mro/seppo/src/branch/develop/lib/as2.ml#L95>


Open Source tooling engineer at Jane Street
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-open-source-tooling-engineer-at-jane-street/10083/1>


Yaron Minsky announced
──────────────────────

  We're looking to hire someone to join our build-systems team with a
  focus on open-source tooling. We currently release almost a million
  lines of code of our internal libraries and tools, including things
  like Sexplib, Base, Core, Async, Incremental, Bonsai, Hardcaml,
  memtrace-viewer, and patdiff.

  We have internal tooling for moving code from our internal
  repositories to Github and for publishing to opam, and for ferrying
  information back from Github to our internal tools, so that developers
  can more easily and promptly respond to PRs and issues coming from the
  outside.

  We want to make open-sourcing our code better and faster, so it's
  easier for us to work with outside contributors, and improvements can
  get out to the community more quickly. Your work would be to make our
  releases delightfully easy and reliable!

  I wrote a bit more about it here:

  <https://twitter.com/yminsky/status/1536766031313739776?s=20&t=sCyUlHGHO1y3znBh4pl0Xw>

  If you're interested, go ahead and make an [ordinary application] to
  our software engineering role, and mention that you're interested in
  "open-source tooling". We're happy to hire for this role in both
  London and New York.


[ordinary application]
<https://www.janestreet.com/join-jane-street/apply/>


Dune how to define custom build task
════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/dune-how-to-define-custom-build-task/10092/1>


cnmade explained
────────────────

  dune has very powerful extensions, but the documentation doesn't tell
  you directly. Today I'll share a specific example of how we can make
  dune do many things with a dune configuration.

  For example

  • Publish compiled documents to our documentation server
  • Sending email notifications to email groups
  • Sending SMS notifications to administrators
  • Build a document and open a browser to preview the document page

  Let's start with an example, we create a dune file in the root
  directory of our project, which you may not have originally, you have
  to create a new one, we enter the following

  ┌────
  │ ; now we tell you how to define a custom rule
  │ ; rule start with (rule )
  │ (rule
  │ ; (alias is point  the command name , so you can run this rule by call  dune build @docopen
  │  (alias docopen)
  │  ; following line is very important, it tell dune do not cache this build command, so it will running every call
  │ without any cache
  │  (deps (universe))
  │  ; action  (system  to told system run command by `sh` in your Linux/MacOS, windows user may running cmd.exe
  │  ; cd ../.. is change the base directory of the running command ,or the default directory will be _build/default
  │  (action (system "cd ../.. && pwd &&  dune build @doc && open _build/default/_doc/_html/index.html" ))
  │ )
  │ ; end of one piece of rule
  │ 
  │ ; and we define more and more rule as we want
  │ (rule
  │   (alias whoami)
  │   (deps (universe))
  │   (action (system "uname -a;whoami"))
  │ )
  └────

  In this example, we define two rules, the rules are the tasks that
  dune can recognize, in dune, it is called rules

  Because it is a custom build command, we use alias to take a unique
  and non-repeating alias.

  The first build command is to build the document and open the browser
  preview.

  Our alias is docopen

  Then deps we add universe to tell dune that you don't want to cache
  and give me a new build every time. If you don't add this line, dune
  will only give you one build, and then because of the cache, you won't
  be able to execute it later.

  action following by system here, action is the command to start,
  system means to use the system shell (windows is cmd, linux macos is
  sh) to give you the execution of the code you specify.

  You can see the first we are first change the directory to the project
  root directory [because the default directory is _build/default], and
  then we perform the build document generation, and then open open the
  generated html page.

  The first build command is this, if you want to perform the first
  build task, you can type

  `dune build @docopen'

  Then our second build command, relatively simple, with reference to
  the first, we can add a lot of build commands we want to add inside
  this dune configuration file.

  We just need to specify different alias aliases for them, no
  duplication.

  The official documentation also specifies some other available
  commands, I won't go into them one by one. Since I prefer to use shell
  scripts, I really only need the system to execute my shell scripts for
  me.


Lwt.5.6.0 (and other Lwt packages)
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-lwt-5-6-0-and-other-lwt-packages/10077/2>


Raphaël Proust announced
────────────────────────

Lwt 5.6.1
╌╌╌╌╌╌╌╌╌

  Version 5.6.1 of the Lwt package has been released. This version
  contains a fix for a bug introduced in 5.6.0 whereby devnull file
  descriptor would be closed during some uses of `Lwt_process'.

  <https://github.com/ocsigen/lwt/releases/tag/5.6.1>


Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
═════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-windows-friendly-ocaml-4-12-distribution-diskuv-ocaml-0-1-0/8358/21>


jbeckford announced
───────────────────

  The 0.4.0 release of Diskuv OCaml for Windows users is available! It
  is usable enough that I've let my school-age kids (elementary through
  high school) install it and go through some tutorials.

  <https://github.com/diskuv/dkml-installer-ocaml#readme>

  The links to the documentation are available from the above link as
  well.

  Here are the one-time inconveniences if you install this release:
  1. The built-in antivirus Windows Defender treats newly signed
     binaries like spam. There needs to be enough people who "Report
     this file as safe" before the binaries are trusted. /If you do
     nothing but mark it safe or install it on Windows, you are helping
     others!/
  2. The installer will automatically install the Visual Studio compiler
     if needed. But Visual Studio sometimes requires a reboot. The
     instructions will tell you if you need the reboot.
  3. The Visual Studio Code OCaml plugin defaults to expecting a legacy
     `ocamlenv' program on Windows. You have to search for `ocamlenv' in
     Visual Studio Code Settings and disable it. This should have a fix,
     but not in time for this release.


Windows parity with Unix
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  1. `opam' commands like `opam install' should work without any
     wrappers. But you should create new switches with `opam dkml init'
     (see `--help' for options).
  2. `dune' commands like `dune build' should work without any
     wrappers. The only hiccup is that aliases like `dune build
     @runtest' need to be escaped in PowerShell like:
     ┌────
     │ dune build `@runtest
     └────
  3. You have partial support if your home directory has spaces, since
     it is very common on Windows to have your username be `FirstName
     LastName'. So far I've configured/patched most things to work with
     spaces, but there could be common packages that were missed, and
     only NTFS drives work.
  4. OCaml 4.12.1. I'd like to upgrade to 4.13 or 4.14, but having
     support for Visual Studio Code debugging with [4.12-only
     ocamlearlybird] is more important, especially for traditional
     Windows users.
  5. Dune 2.9.3. I've bundled in support in 2.9.3 for fswatch/inotify so
     that `dune build --watch' works on Windows. Nothing is blocking an
     upgrade to 3.x except time (ie. not now) and a reason.
  6. Opam 2.1.2 plus some PRs that are pending the not-yet-released
     version 2.2.
  7. Git performance on Windows just sucks. It is like someone designed
     it for a Linux kernel 🤨. Apparently [Git FSMonitor in 2.37.0] can
     be enabled to speed things up, but I don't have real-world
     experience with it because it was just released yesterday.
  8. MSYS2, which can be accessed with `with-dkml bash', now uses the
     CLANG64 variant. There are thousands of up-to-date third-party
     libraries available and, unlike MinGW, they are ABI compatible with
     the dominant Windows compiler (MSVC). And if you are interested
     there is an [ocamlverse Help Wanted] to add the CLANG64 compiler as
     an alternative to the Administrator-requiring, reboot-needing MSVC
     compiler.

  Thanks to OCaml Software Foundation for sponsoring this!

  0.4.x will be the last minor versions of the "preview". I'll be
  shifting to closing out any show-stopping bugs, and updating the
  various Windows onboarding guides for OCaml to officially include
  Diskuv OCaml.


[4.12-only ocamlearlybird]
<https://github.com/hackwaly/ocamlearlybird/issues/38>

[Git FSMonitor in 2.37.0]
<https://github.blog/2022-06-29-improve-git-monorepo-performance-with-a-file-system-monitor/>

[ocamlverse Help Wanted]
<https://ocamlverse.github.io/content/help_wanted.html>


OCamlFormat Web Configurator
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocamlformat-web-configurator/10103/1>


Louis Roché announced
─────────────────────

  It is my pleasure to share with you the [ocamlformat configurator] as
  a web page.

  Ocamlformat is a great tool that really makes editing code a more
  pleasant experience. It has a bunch of different built in profiles and
  many additional options to fine tune how the code should look
  like. While I would encourage most people and new projects to use one
  of the default profiles, the many options are helpful when
  transitioning an existing codebase. Unfortunately it is not super easy
  to figure out which options to use and how to combine them.  There are
  [58 parameters]! I've spent a long time trying different combinations
  by changing an option in my .ocamlformat, running `dune build @fmt`,
  checking the code, going back to the first step… It is a tedious
  work. So I decided to make a simple web interface with all of the
  options available and a faster feedback loop.

  <https://global.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/2/24e891e9e1400d4a47debf9e34b3ea414bebf418_2_1380x826.jpeg>

  Thanks to js_of_ocaml the task was not too complicated. Ocamlformat
  can be compiled to javascript, there is nothing special to do. Which
  means everything can be done in the browser, the code won't leak to
  anyone, there is no need to maintain a server, and the result will be
  guaranteed to be identical as a formatting with the cli tool.

  The configuration can be set through text (just put the content of
  your `.ocamlformat` in the text box) and through a bunch of
  dropdown. They will be combined together. The dropdown takes
  precedence over the textual configuration if an option is set in both.

  The project has been started as part of the "open source day" at
  Ahrefs (we try to dedicate some time to open source projects that we
  use internally). It is still in its infancy. Please pardon the
  terrible style, I am not a web developer and didn't have time to make
  it look nicer yet. There are some annoying things to fix (no feedback
  when the code is invalid and can't be formatted), and many
  improvements to come (a way to download the configuration for
  example). But I think that it is already working well enough to be
  used by others.

  You can find the configurator at
  <https://ahrefs.github.io/ocamlformat/>
  The source code is on github at
  <https://github.com/ahrefs/ocamlformat/tree/ahrefs/web-ui/bin/web-ui>

  If you like ocaml and want to look for a job, we have some [positions
  available]


[ocamlformat configurator] <https://ahrefs.github.io/ocamlformat/>

[58 parameters]
<https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/main/ocamlformat-help.txt>

[positions available] <https://ahrefs.com/jobs>


Release of optiml-transport
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-optiml-transport/10128/1>


Igarnier announced
──────────────────

  Hi! [optiml-transport] was just released on opam. This library binds
  C++ primitives to solve the [optimal
  transportation](<https://en.wikipedia.org/wiki/Transportation_theory_(mathematics)>)
  problem between finite weighted point clouds (i.e. finite
  measures). Concretely, this allows to lift any [metric] on a base
  space to a metric on finitely supported probability measures over that
  base space. (In fact, the library works with cost functions more
  general than that satisfying the metric axioms.) The library also
  outputs an optimal coupling between any two such measures. Optimal
  transportation has many applications in statistics, graphics,
  optimization, etc.

  The library consists in bindings to
  <https://github.com/nbonneel/network_simplex>


[optiml-transport] <https://github.com/igarnier/optiml-transport>

[metric] <https://en.wikipedia.org/wiki/Metric_space>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-06-28  7:37 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-06-28  7:37 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 21 to 28,
2022.

The mailing list mode of discuss.ocaml.org seems to have been down for a
few days, so I had to manually scrape the messages. My apologies if I
missed any.

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

An amusing use of first-class modules: reading from plaintext and compressed files
Lwt.5.6.0 (and other Lwt packages)
Old CWN


An amusing use of first-class modules: reading from plaintext and compressed files
══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/an-amusing-use-of-first-class-modules-reading-from-plaintext-and-compressed-files/10073>


Chet_Murthy explained
─────────────────────

  I was recently trying to write a thing in Rust, and having problems,
  so I wrote the same thing in OCaml, just to make sure that it was
  doable. I thought I’d post about it, b/c maybe it’s an example of what
  we’ll find more tractable, once we have modular implicits.

  The problem: I have both compressed and plaintext files, and I want to
  run a function over the uncompressed contents. I’d like a combinator
  that I can apply to the filename and the function, that will do the
  work of opening the file, calling the function, closing the file, etc.

  This isn’t so hard.

  1. define a type of READER (and two instances for plaintext and
     gzipped). This is the equivalent of Rust’s “io::BufRead”.

     ┌────
     │ module type READER =
     │   sig
     │     type in_channel
     │     val open_in : string -> in_channel
     │     val input_char : in_channel -> char
     │     val close_in : in_channel -> unit
     │   end
     │ let stdreader = (module Stdlib : READER) ;;
     │ let gzreader = (module Gzip : READER) ;;
     └────

  2. then define a type of “in channel user” (“ICUSER”) and the generic
     version of it

     ┌────
     │ module type ICUSER = sig
     │   type in_channel
     │   val use_ic : in_channel -> unit
     │ end
     │ module type GENERIC_ICUSER = functor (R : READER) -> (ICUSER with type in_channel = R.in_channel)
     └────

  3. then define our function that takes a generic in_channel, and uses
     it – “Cat”

     ┌────
     │ module Cat(R : READER) : ICUSER with type in_channel = R.in_channel = struct
     │   type in_channel = R.in_channel
     │   let use_ic ic =
     │   let rec rerec () =
     │     match R.input_char ic with
     │       c -> print_char c ; rerec ()
     │     | exception End_of_file -> ()
     │   in rerec ()
     │ end
     └────

  4. And then write our “with_input_file” function, that takes a
     filename, the function from #3, and applies it to either a normal
     in_channel, or one produced from a gzip-reader.

     ┌────
     │ let with_input_file fname (module R : GENERIC_ICUSER) =
     │   let (module M : READER) =
     │     if Fpath.(fname |> v |> has_ext "gz") then
     │       gzreader
     │     else stdreader in
     │   let open M in
     │   let ic = M.open_in fname in
     │   let module C = R(M) in
     │   try let rv = C.use_ic ic in close_in ic ; rv
     │   with e -> close_in ic ; raise e
     └────

  And now we can use it:

  ┌────
  │ with_input_file "/etc/passwd" (module Cat) ;;
  │ with_input_file "foo.gz" (module Cat) ;;
  └────

  Easy-peasy. I don’t remember enough about the modular implicits
  proposal to remember if this can be cast in the supported language
  there, so I suppose I should get some version of that code (or the
  newer versions from others) up-and-running, and see if this can be
  made to work.


hyphenrf asked and Chet_Murthy replied
──────────────────────────────────────

        can’t we get rid of the `GENERIC_ICUSER' requirement and
        just ask for functions that take a packed module of type
        `READER'

        by that I mean the signature of `with_input_file' becomes
        `string -> ((module READER) -> 'a) -> 'a'

  It’s a good question, and as a newbie user of first-class modules, I
  don’t know the typing rules well enough to answer. But I did try:

  ┌────
  │ let with_input_file' fname f =
  │   let (module M : READER) =
  │     if Fpath.(fname |> v |> has_ext "gz") then
  │       gzreader
  │     else stdreader in
  │   let open M in
  │   let ic = M.open_in fname in
  │   f (module M : READER) ic
  └────

  and got

  ┌────
  │ File "ioabs.ml", line 96, characters 24-26:
  │ 96 |   f (module M : READER) ic
  │ 			     ^^
  │ Error: This expression has type M.in_channel
  │        but an expression was expected of type 'a
  │        The type constructor M.in_channel would escape its scope
  └────

  ETA: I remember in the modular implicits paper, that there was a lot
  of wrappering code in structs (that didn’t start off in structs). I
  wonder if that’s evidence that you really do have to “push up” code to
  the module level in order to make it work.


octachron then said
───────────────────

  You don’t need modular implicits to simplify your code. Your packed
  module type is equivalent to:

  ┌────
  │ type channel = { input_char: unit -> char; close_in: unit -> unit }
  │ type channel_generator = string ->  channel
  └────

  We could go fancy and manifest the type with an existential

  ┌────
  │ type 'a channel =
  │   { open_fn: string -> 'a; input_char: 'a -> char; close_in: 'a -> unit }
  │ type chan = Any: 'a channel -> chan
  └────

  but this has mainly the advantage to illustrate the fact that you are
  never using the non-existentially qualified `'a channel' which means
  that in the current version of your code, modular (explicits or)
  implicits is not a good fit: we are not selecting a module to provide
  functions for a type, we have an object (aka an existentially
  qualified record) with some hidden inner type that we never need to
  know.


c-cube later said
─────────────────

  I think it’s kind of counter-productive to want a `in_channel' type at
  all. This is what I’ve been doing, more and more:

  ┌────
  │ module type INPUT = sig
  │   val read_char : unit -> char
  │   val read : bytes -> int -> int -> int
  │   val close : unit -> unit
  │ end
  │ 
  │ type input = (module INPUT)
  │ 
  │ let open_file (filename:string) : input =
  │   let ic = open_in filename in
  │   (module struct
  │     let read_char() = input_char ic
  │     let read = input ic
  │     let close() = close_in ic
  │  end)
  │ 
  │ 
  │ let do_sth (module IN:INPUT) =
  │   IC.read_char ();
  │   IC.read …
  └────

  This behaves like classic objects in other languages and there’s no
  complicated typing going on (what with each implementation having its
  own channel type).


Lwt.5.6.0 (and other Lwt packages)
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-lwt-5-6-0-and-other-lwt-packages/10077>


raphael-proust announced
────────────────────────

  It is a real pleasure to announce the release of Lwt version 5.6.0 as
  well as Lwt-domain.0.2.0, Lwt-ppx.2.1.0 and Lwt-react.1.2.0. With this
  release Lwt is now compatible with OCaml version 5.

  <https://github.com/ocsigen/lwt/releases/tag/5.6.0>

  Thank you to the many contributors for the fixes, the improvements,
  and the OCaml5 compatibility! Check out the changelog for full details
  on each contribution.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-06-21  8:06 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-06-21  8:06 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 14 to 21,
2022.

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

OBazl Toolsuite - tools for building OCaml with Bazel
Job offer: 3 years compiler engineer at the French tax authority
OCaml 5.0, zeroth alpha release
Tezt, a framework for all your tests
OCaml Stdlib, Containers, Batteries, Base and F# core functions comparisons
Dune 3.3.0
Old CWN


OBazl Toolsuite - tools for building OCaml with Bazel
═════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/obazl-toolsuite-tools-for-building-ocaml-with-bazel/10021/1>


Gregg Reynolds announced
────────────────────────

  Version 2 of OBazl, a Bazel ruleset for building OCaml code, will soon
  be available.  I'm letting you know early because I'll be giving a
  presentation about the OBazl Toolsuite for the [Bazel Exchange]
  conference next Wed, 22 June, at 3:00 pm UDT (10:00 am CDT). It's a
  virtual conference so you can tune in from anywhere.  The talk will
  focus on some of the quirks of the OCaml build discipline and how I
  addressed them for the OBazl ruleset.

  The tools are usable now, they're just not yet properly documented and
  packaged, and in a few places there's a little more work to be done on
  the code. Nonetheless there is quite a bit of documentation (CAVEAT:
  some of it is outdated), with more on the way soon, and there are lots
  of demos available.  So if you're interested in using Bazel to build
  your OCaml code I welcome you to take a look:

  [The OBazl Book]

  Twitter handle is @obazldev Discord: [https://discord.gg/PHSAW5DUva]


[Bazel Exchange]
<https://skillsmatter.com/conferences/13682-bazel-exchange>

[The OBazl Book] <https://obazl.github.io/docs_obazl/>

[https://discord.gg/PHSAW5DUva] <https://discord.gg/PHSAW5DUva>


Gregg Reynolds lated added
──────────────────────────

  PS.  The conference organizers have provided this discount token:
  BAZEL-GR-20

  It should be good for 20% off, registration is at
  [https://events.skillsmatter.com/bazelx2022]


[https://events.skillsmatter.com/bazelx2022]
<https://events.skillsmatter.com/bazelx2022>


Job offer: 3 years compiler engineer at the French tax authority
════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-offer-3-years-compiler-engineer-at-the-french-tax-authority/10023/1>


Denis Merigoux announced
────────────────────────

  [En français parce que c'est une offre d'emploi dans l'administration]

  Bonjour à toutes et à tous,

  Vous aimez la programmation fonctionnelle et les compilateurs ? Vous
  en avez marre des offres d'emploi dans la blockchain ? Ça tombe bien,
  j'ai ce qu'il vous faut !

  Il y a deux ans, j'ai lancé un grand projet de modernisation du calcul
  informatique de calcul de l'impôt sur le revenu à la Direction
  Générale des Finances Publiques (DGFiP), en partenariat avec Inria:
  <https://www.inria.fr/fr/mlang-modernisation-calcul-impot-revenu>.

  Le logiciel au cœur de ce projet de modernisation est Mlang, un
  compilateur écrit en OCaml pour un couple de langages dédiés utilisés
  par la DGFiP pour encoder le calcul de l'impôt sur le revenu. Depuis
  deux ans, la DGFiP travaille à intégrer Mlang à l'infrastructure
  officielle de calcul de l'impôt sur le revenu pour remplacer des
  systèmes vieillissants. C'est donc un projet à très fort impact (80M€
  par d'impôts par an), et proche de la R&D (OCaml, libre, innovation) !
  Depuis un an, la DGFiP emploie la société OCamlPro sur le projet mais
  souhaite maintenant ré-internaliser ses compétences pour garder la
  souveraineté numérique sur son infrastructure de calcul.

  C'est là que cette offre d'emploi entre en jeu ! En effet la DGFiP
  vient d'ouvrir un poste en CDD de 3 ans pour un.e expert.e en
  compilation ! Les détails :

  • Bureaux à Noisy-le-Grand (+ jusqu'à 3 jours télétravail/semaine)
  • Salaire: À négocier selon expérience mais similaire à "Inspecteur
    des finances publiques". Selon le site du ministère de l'économie ça
    débuterait à 3k€ net/mois.
  • Tâches: Maintenance, évolution de Mlang et travaux annexes

  Et pour l'heureux.se recruté.e, la cerise sur le gâteau sera de
  pouvoir collaborer avec moi et l'équipe Prosecco d'Inria (ainsi que
  Raphaël Monat, ) :) Attention cependant : il faudra s'attendre à
  devoir également aider l'équipe de la DGFiP sur d'autres chantiers en
  fonction des priorités. De même, l'objectif est de partager la
  compétence en compilation au sein de la DGFiP, donc les profils
  évangélisateurs de la programmation fonctionnelle sont les bienvenus !

  Pour référence, voici l'offre officielle complète:
  <https://merigoux.ovh/assets/OffreDGFiP.pdf>. S'il vous plaît, pas
  d'autocensure à cause de ce qui est marqué dans ce PDF! Si vous avez
  un doute contactez-moi par retour de mail.

  Deadline pour les candidatures: 9 juillet. Prise de poste inconnue,
  sûrement aux alentours du 1er septembre mais j'imagine que c'est
  négociable.


Denis Merigoux later added
──────────────────────────

  Si vous êtes intéressé.e, envoyez votre CV et lettre de motivation à
  bureau.si-part-rh@dgfip.finances.gouv.fr et
  bureau.rh-mobilite-carriere-a-recrutementchoix@dgfip.finances.gouv.fr.


OCaml 5.0, zeroth alpha release
═══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-5-0-zeroth-alpha-release/10026/1>


octachron announced
───────────────────

  Five months after the initial merge of the multicore branch into the
  mainline OCaml and three months after the release of OCaml 4.14.0,
  OCaml 5.0.0 is starting to take shape.

  I am thus happy to announce an exceptional zeroth alpha release of
  OCaml 5.0.0 (see below for the installation instructions).

  This alpha release is expected to be rougher than an usual alpha
  release, due to the full rewrite of the OCaml runtime. In particular,
  the bytecode debugger will only be available in the next alpha
  release. Similarly, there will be some changes to the internal C
  runtime API and to the files installed by the compiler package in the
  next alpha release.

  Moreover, this zeroth alpha release is the occasion to remind everyone
  that OCaml 5.0 itself is expected to be a more experimental release
  than usual. Notably, the native compiler will only be available on the
  ARM64 and x86-64 architectures in this 5.0 release.

  Nevertheless, this zeroth alpha version is already stable enough for
  fellow hackers eager to join us in our early bug hunting and opam
  ecosystem fixing fun, or to venture in the new era of parallelism and
  (experimental) effects.

  You can follow the progresses in stabilising the opam ecosystem on

  <https://github.com/ocaml/opam-repository/issues/21526>

  A brief summary is that at least dune, merlin, ppxlib, utop,
  ocamlfind, and ocamlbuild work (potentially by using patches from the
  alpha opam repository).

  If you find any bugs, please report them here:

  <https://github.com/ocaml/ocaml/issues>

  In particular, any sequential OCaml 4 library or program should be
  valid in OCaml 5 (except for deprecated modules and functions). Please
  don't hesitate to report any compatibility bugs!

  If you are interested by the ongoing list of bug fixes, the updated
  change log for OCaml 5.0.0 is available at:

  <https://github.com/ocaml/ocaml/blob/5.0/Changes>


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
  The base compiler can be installed as an opam switch with the
  following commands on opam 2.1:
  ┌────
  │ opam update
  │ opam switch create 5.0.0~alpha0
  └────
  For previous version of opam, the switch creation command line is
  slightly more verbose:
  ┌────
  │ opam update
  │ opam switch create 5.0.0~alpha0 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌────
  │ opam update
  │ opam switch create <switch_name> ocaml-variants.5.0.0~alpha0+options <option_list>
  └────
  where `<option_list>' is a comma separated list of `ocaml-option-*'
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 5.0.0~alpha0+flambda+nffa ocaml-variants.5.0.0~alpha0+options ocaml-option-flambda
  │ ocaml-option-no-flat-float-array
  └────
  The command line above is slightly more complicated for an opam
  version anterior to opam 2.1:
  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.5.0.0~alpha0+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  In both cases, all available options can be listed with `opam search
  ocaml-option'.

  If you want to test this version, it is strongly advised to install
  the alpha opam repository

  <https://github.com/kit-ty-kate/opam-alpha-repository>

  with
  ┌────
  │ opam repo add alpha git://github.com/kit-ty-kate/opam-alpha-repository.git
  └────
  This alpha repository contains various fixes in the process of being
  upstreamed.

  The source code for the alpha is also available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/5.0.0-alpha0.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0~alpha0.tar.gz>


Daniel Bünzli asked and octachron replied
─────────────────────────────────────────

        Does this mean we get [global warming] again ?

  Indeed! I should have mentioned that point! The normal development
  process can restart on the compiler development branch.

  I will also try to slowly go through the backlog of frozen PRs once
  the alpha releases settle down.


[global warming]
<https://discuss.ocaml.org/t/the-road-to-ocaml-5-0/8584#the-sequential-glaciation-3>


Tezt, a framework for all your tests
════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-tezt-a-framework-for-all-your-tests/10038/1>


rbardou announced
─────────────────

  Tezt (pronounced [/tɛzti/]) is a test framework for OCaml that has
  been developed and used at Nomadic Labs to test [Octez], an OCaml
  implementation of the Tezos blockchain. It has become quite mature and
  we feel it would benefit the OCaml community at large, so we are
  releasing it publicly as a standalone product.

  Tezt is well-suited for unit tests, integration tests, and regression
  tests in particular. It was designed with a focus on user experience,
  with colourful logs, various ways to select the tests to run from the
  command-line, and more. It integrates well into CI pipelines. And it
  cleans up after itself, deleting temporary files and killing external
  processes. Unless you tell it not to, of course.

  For a more in-depth tour of Tezt, see [our latest blog post entry].

  Tezt is available on opam:
  ┌────
  │ opam install tezt
  └────
  Have a look at the [API documentation] and the [source code].


[/tɛzti/] <http://ipa-reader.xyz/?text=t%C9%9Bzti>

[Octez]
<https://research-development.nomadic-labs.com/announcing-octez.html>

[our latest blog post entry]
<https://research-development.nomadic-labs.com/announcing-tezt.html>

[API documentation]
<https://tezos.gitlab.io/api/odoc/_html/tezt/Tezt/index.html>

[source code] <https://gitlab.com/tezos/tezos/-/tree/master/tezt/lib>


OCaml Stdlib, Containers, Batteries, Base and F# core functions comparisons
═══════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-stdlib-containers-batteries-base-and-f-core-functions-comparisons/10041/1>


Jp R announced
──────────────

  <https://github.com/Fourchaux/OCaml-Stdlib_Containers_Batteries_Base-and-FSharp--core-functions-comparisons>

  Comparisons (names/signatures) of the core functions used in:

  • OCaml Stdlib (v4.41.0)
  • Containers (v3.8)
  • Batteries (v3.5.1)
  • Base (v0.15.0)
  • F# (v6.0) as a bonus

  Note: F# provides an Array.Parallel module with some functions
   (choose, collect, init, iter, iteri, map, mapi, partition) which
   could be good candidates for OCaml 5.0.0…


Dune 3.3.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-3-0/10048/1>


Etienne Millon announced
────────────────────────

  On behalf of the dune team, I’m pleased to announce the release of
  version 3.3.0. This is the first version that supports the upcoming
  OCaml 5.0. It also improves safety by sandboxing more rules and
  enabling more warnings, and there's a bunch of new features on the coq
  side too. Full changelog follows.

  Note that as usual, dune works hard not to break existing packages. So
  even if it mentions that rules require precise dependencies, for
  example, this new safety net is only enabled for project that use
  `(lang dune 3.3)'.

  Happy hacking.


3.3.0 (17-06-2022)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Sandbox preprocessing, lint, and dialect rules by default. All these
    rules now require precise dependency specifications (#5807,
    @rgrinberg)

  • Allow list expansion in the `pps' specification for preprocessing
    (#5820, @Firobe)

  • Add warnings 67-69 to dune's default set of warnings. These are
    warnings of the form "unused X.." (#5844, @rgrinberg)

  • Introduce project "composition" for coq theories. Coq theories in
    separate projects can now refer to each other when in the same
    workspace (#5784, @Alizter, @rgrinberg)

  • Fix hint message for `data_only_dirs' that wrongly mentions the
    unknown constructor `data_only' (#5803, @lambdaxdotx)

  • Fix creating sandbox directory trees by getting rid of buggy
    memoization (#5794, @rgrinberg, @snowleopard)

  • Handle directory dependencies in sandboxed rules. Previously, the
    parents of these directory dependencies weren't created. (#5754,
    @rgrinberg)

  • Set the exit code to 130 when dune is terminated with a signal
    (#5769, fixes #5757)

  • Support new locations of unix, str, dynlink in OCaml >= 5.0 (#5582,
    @dra27)

  • The `coq.theory' stanza now produces rules for running
    `coqdoc'. Given a theory named `mytheory', the directory targets
    `mytheory.html/' and `mytheory.tex/' or additionally the aliases
    `@doc' and `@doc-latex' will build the HTML and LaTeX documentation
    repsectively. (#5695, fixes #3760, @Alizter)

  • Coq theories marked as `(boot)' cannot depend on other theories
    (#5867, @ejgallego)

  • Ignore `bigarray' in `(libraries)' with OCaml >= 5.0. (#5526, fixes
    #5494, @moyodiallo)

  • Start with :standard when building the ctypes generated foreign
    stubs so that we include important compiler flags, such as -fPIC
    (#5816, fixes #5809).


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-06-14  9:29 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-06-14  9:29 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

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

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
omake-0.10.5
findlib-1.9.5
Old CWN


Lwt informal user survey
════════════════════════

  Archive: <https://discuss.ocaml.org/t/lwt-informal-user-survey/9666/3>


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
  [<https://github.com/ocsigen/lwt/pull/947>](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
═══════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/tutorial-full-stack-web-dev-in-ocaml-w-dream-bonsai-and-graphql/9963/20>


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] <https://erratique.ch/software/hc/doc/manual.html#request>

[extended the CSS selector syntax]
<https://erratique.ch/software/hc/doc/manual.html#selector>

[700 lines of ml]
<https://github.com/dbuenzli/hc/blob/master/src/hc_page.ml>

[2800 lines of JavaScript]
<https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js>

[extremely unpleasant]
<https://github.com/dbuenzli/rel/commit/f95b6bad02a8080eb64f8d0123cd63d40b528e33>


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

  Archive:
  <https://discuss.ocaml.org/t/ann-dkml-c-probe-cross-compiler-friendly-definitions-for-c-compiling/9950/8>


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
    colons
  • 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
  [https://github.com/diskuv/dkml-c-probe#dkml-c-probe]


[https://github.com/diskuv/dkml-c-probe#dkml-c-probe]
<https://github.com/diskuv/dkml-c-probe#dkml-c-probe>


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
  <https://diskuv.github.io/dkml-c-probe/dkml-c-probe/Dkml_c_probe/C_conf/index.html>
  (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
     pkg-config.

  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]
<https://github.com/diskuv/dkml-c-probe/blob/2c1e90b4eea119348d6dae37d64949041ef9eaeb/.github/workflows/test.yml#L299-L379>

[opam-cross-android] <https://github.com/ocaml-cross/opam-cross-android>

[`abi = "android"']
<https://github.com/ocaml-cross/opam-cross-android#porting-packages>

[zarith library]
<https://github.com/jonahbeckford/Zarith/blob/a1bf6d55cd3c4b91dee0afb2309ef11271e9729b/discover.ml>

[Dune documentation encourages `pkg-config']
<https://dune.readthedocs.io/en/stable/dune-libs.html#configurator-1>


Htmx/hc web development approach
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/htmx-hc-web-development-approach/9993/11>


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]
<https://erratique.ch/software/webs/doc/Webs_html/index.html>

[this directory]
<https://github.com/dbuenzli/hyperbib/tree/master/src/service>

[here]
<https://github.com/dbuenzli/hyperbib/blob/master/DEVEL.md#cli-tool-and-backend>

[this module]
<https://erratique.ch/software/webs/doc/Webs_kit/Kurl/index.html>


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 self.st.idx 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"; A.id "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
═════════════════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/engineer-and-postdoc-positions-in-france-various-labs-to-work-on-a-proof-assistant-for-crypto-protocols/9999/1>


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:

  <https://squirrel-prover.github.io/positions.pdf>


Yojson 2.0.0
════════════

  Archive: <https://discuss.ocaml.org/t/ann-yojson-2-0-0/10003/1>


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]
<https://opam.ocaml.org/packages/yojson/>

[join us] <https://github.com/ocaml-community/yojson>

2.0.0
╌╌╌╌╌

  *2022-06-02*


Removed
┄┄┄┄┄┄┄

  • Removed dependency on easy-format and removed `pretty_format' from
    `Yojson', `Yojson.Basic', `Yojson.Safe' and `Yojson.Raw'. (@c-cube,
    #90)
  • 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
      `stream_to_buffer'
    (@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
┄┄┄

  • 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)


Change
┄┄┄┄┄┄

  • 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).


Fix
┄┄┄

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


opentelemetry 0.2
═════════════════

  Archive: <https://discuss.ocaml.org/t/ann-opentelemetry-0-2/10005/1>


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.


[ocaml-opentelemetry]
<https://github.com/imandra-ai/ocaml-opentelemetry>

[opentelemetry] <https://opentelemetry.io/>


omake-0.10.5
════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-06/msg00012.html>


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
  <http://projects.camlcity.org/projects/omake.html>. opam is underway.


findlib-1.9.5
═════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-06/msg00012.html>


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:

  <http://projects.camlcity.org/projects/findlib.html>

  An updated OPAM package will follow soon.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-06-07 10:15 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-06-07 10:15 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 31 to June 07,
2022.

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

carray.0.0.1
ML Family Workshop 2022: Final Call for Presentations
OCaml Users and Developers Workshop 2022
dkml-c-probe.2.0.0: Cross-compiler friendly definitions for C compiling
Full-Stack Web Dev in OCaml Tutorial w/ Dream, Bonsai, and GraphQL
Sketch.sh now supports multiple compiler versions, starting with 4.13.1
Explicit type binding and mutual recursion
findlib-1.9.4
omake-0.10.4
Old CWN


carray.0.0.1
════════════

  Archive: <https://discuss.ocaml.org/t/ann-carray-0-0-1/9938/6>


Deep in this threas, Fabian said
────────────────────────────────

  Note that you can, to a certain degree, build your own flat structures
  with the `Bytes' module. Compared to bigarrays, `Bytes.t' has less
  indirection, a lower constant memory overhead and can be allocated on
  the minor heap. The contents of `Bytes.t' are not scanned by the GC,
  just like bigarrays.

  For example, a more efficient `int32 Array.t':

  ┌────
  │ module Int32_array : sig
  │   type t
  │   val equal : t -> t -> bool
  │   val create : int -> t
  │   val length : t -> int
  │   val get : t -> int -> int32
  │   val set : t -> int -> int32 -> unit
  │   val sub : t -> int -> int -> t
  │   val to_list : bytes -> int32 list
  │ end = struct
  │   type t = Bytes.t
  │   let equal = Bytes.equal
  │   let create len = Bytes.create (4 * len)
  │   let length t = Bytes.length t / 4
  │   let get t i = Bytes.get_int32_le t (4 * i)
  │   let set t i x = Bytes.set_int32_le t (4 * i) x
  │   let sub t pos len = Bytes.sub t (4 * pos) (4 * len)
  │   let to_list t = List.init (length t) (get t)
  │ end
  └────

  A more efficient `(int * int)':

  ┌────
  │ module Point : sig
  │   type t
  │   val create : int -> int -> t
  │   val x : t -> int
  │   val y : t -> int
  │ end = struct
  │   external get_int64_unsafe : bytes -> int -> int64 = "%caml_bytes_get64u"
  │   external set_int64_unsafe : bytes -> int -> int64 -> unit = "%caml_bytes_set64u"
  │   type t = Bytes.t
  │   let create x y =
  │     let p = Bytes.create 16 in
  │     set_int64_unsafe p 0 (Int64.of_int x);
  │     set_int64_unsafe p 8 (Int64.of_int y);
  │     p
  │   let x t = Int64.to_int (get_int64_unsafe t 0)
  │   let y t = Int64.to_int (get_int64_unsafe t 8)
  │ end
  └────

  (making a more efficient `(int * int) Array.t' is left as an exercise
  to the reader)

  The downside compared to bigarrays is that it doesn't support `sub'
  without copying. Also, bytes can be moved by the GC (during minor GCs
  or compaction), and therefore you cannot release the runtime lock when
  passing them to C. The latter point is less relevant with the
  multicore extensions, especially since there is no compactor
  yet. There is some related discussion on the eio repository:
  <https://github.com/ocaml-multicore/eio/issues/140>


ML Family Workshop 2022: Final Call for Presentations
═════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ml-family-workshop-2022-final-call-for-presentations/9877/2>


Benoit Montagu announced
────────────────────────

ML Family Workshop 2022: DEADLINE EXTENSION
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  To increase your chances of submitting your work to the ML workshop,
  *the submission deadline is extended by a week*.  The new deadline is
  Friday 10th June (AoE).

  A quick reminder:
  • The workshop does not have proceedings, making it the perfect venue
    to run some ideas with the community or present some work in
    progress within a friendly environment.
  • The work load as an author is low: submissions are only 3 pages long
    (excluding references)
  • YOU have the power to make the ML workshop a success!
  • You have one more full week to submit to
    <https://ml2022.hotcrp.com/> (please register your submission
    early!)
  • All the details are here:
    <https://icfp22.sigplan.org/home/mlfamilyworkshop-2022#Call-for-Presentations>
  • The ML workshop is colocated with ICFP 2022
    <https://icfp22.sigplan.org/>


OCaml Users and Developers Workshop 2022
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-users-and-developers-workshop-2022/9726/4>


Matija Pretnar announced
────────────────────────

  To offer additional opportunities to contribute to the OCaml workshop,
  and to align with the [ML family workshop], to which you are also
  cordially invited, the submission deadline has been extended by a week
  to *Friday, June 10* (anywhere on Earth).


[ML family workshop]
<https://icfp22.sigplan.org/home/mlfamilyworkshop-2022#Call-for-Presentations>


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

  Archive:
  <https://discuss.ocaml.org/t/ann-dkml-c-probe-2-0-0-cross-compiler-friendly-definitions-for-c-compiling/9950/1>


jbeckford announced
───────────────────

  Summary: dkml-c-probe is a new package for maintainers who compile or
  link C code. Install it with `opam install dkml-c-probe'. Full docs
  are at [https://github.com/diskuv/dkml-c-probe#readme]


[https://github.com/diskuv/dkml-c-probe#readme]
<https://github.com/diskuv/dkml-c-probe#readme>

Problem
╌╌╌╌╌╌╌

  You are creating an OCaml package that has foreign C code. Perhaps you
  need special C headers or libraries when you are targeting Apple
  users, or perhaps you need to execute custom OCaml code for Android
  users. More generally you need a way to determine whether your OCaml
  or C code is compiling for a Linux AMD/Intel 64-bit, Android ARM
  32-bit, or any other ABI target.


Solution
╌╌╌╌╌╌╌╌

  A user of your OCaml package may, for example, be on a 64-bit
  AMD/Intel Linux machine using a 32-bit OCaml system compiled with `gcc
  -m32'; additionally they have a 32-bit Android ARM cross-compiler
  toolchain. `dkml-c-probe' will tell you the target operating system is
  `Linux' and the target ABI is `Linux_x86' except when the
  cross-compiler toolchain is invoked. With the cross-compiler toolchain
  `dkml-c-probe' will tell you the target operating system is `Android'
  and the target ABI is `Android_arm32v7a'.


How it works
╌╌╌╌╌╌╌╌╌╌╌╌

  `dkml-c-probe' uses C preprocessor definitions (ex. `#if
  TARGET_CPU_X86_64', `#if __ANDROID__', etc.) to determine which ABI
  the C compiler (ex. `ocamlopt -config | grep native_c_compiler') is
  targeting.

  This isn't a new idea. The pattern is used in Esy and Mirage code as
  well. `dkml-c-probe' just codifies the pattern for use in your own
  code.


Usage
╌╌╌╌╌

  In OCaml code you can use the /versioned/ module:

  ┌────
  │ module V2 :
  │   sig
  │     type t_os = Android | IOS | Linux | OSX | Windows
  │     type t_abi =
  │ 	Android_arm64v8a
  │       | Android_arm32v7a
  │       | Android_x86
  │       | Android_x86_64
  │       | Darwin_arm64
  │       | Darwin_x86_64
  │       | Linux_arm64
  │       | Linux_arm32v6
  │       | Linux_arm32v7
  │       | Linux_x86_64
  │       | Linux_x86
  │       | Windows_x86_64
  │       | Windows_x86
  │       | Windows_arm64
  │       | Windows_arm32
  │     val get_os : (t_os, Rresult.R.msg) result Lazy.t
  │     val get_abi : (t_abi, Rresult.R.msg) result Lazy.t
  │     val get_abi_name : (string, Rresult.R.msg) result Lazy.t
  │   end
  └────

  In C code you can use the [provided `dkml_compiler_probe.h' header]
  from within Dune or Opam. Here is a snippet that handles part of the
  Linux introspection:

  ┌────
  │ #elif __linux__
  │ #   if __ANDROID__
  │ #       ...
  │ #   else
  │ #       define DKML_OS_NAME "Linux"
  │ #       define DKML_OS_Linux
  │ #       if __aarch64__
  │ #           define DKML_ABI "linux_arm64"
  │ #           define DKML_ABI_linux_arm64
  │ #       elif __arm__
  │ #           if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) ||
  │ defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) ||
  │ defined(__ARM_ARCH_6T2__)
  │ #               define DKML_ABI "linux_arm32v6"
  │ #               define DKML_ABI_linux_arm32v6
  │ #           elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) ||
  │ defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
  │ #               define DKML_ABI "linux_arm32v7"
  │ #               define DKML_ABI_linux_arm32v7
  │ #           endif /* __ARM_ARCH_6__ || ...,  __ARM_ARCH_7__ || ... */
  │ #       elif __x86_64__
  │ #           define DKML_ABI "linux_x86_64"
  │ #           define DKML_ABI_linux_x86_64
  │ #       elif __i386__
  │ #           define DKML_ABI "linux_x86"
  │ #           define DKML_ABI_linux_x86
  │ #       elif defined(__ppc64__) || defined(__PPC64__)
  │ #           define DKML_ABI "linux_ppc64"
  │ #           define DKML_ABI_linux_ppc64
  │ #       elif __s390x__
  │ #           define DKML_ABI "linux_s390x"
  │ #           define DKML_ABI_linux_s390x
  │ #       endif /* __aarch64__, __arm__, __x86_64__, __i386__, __ppc64__ || __PPC64__,
  │ __s390x__ */
  └────


[provided `dkml_compiler_probe.h' header]
<https://github.com/diskuv/dkml-c-probe#c-header>


Versioning and Contributing
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Whenever a new ABI is added, it goes into a new version (ex. `module
  V3'). Your existing code that uses `module V2' will be unaffected.

  But each new ABI needs to have its own maintainer because I don't have
  access to every hardware platform on the planet!

  For example, PowerPC (`ppc64') and Linux on IBM Z (`s390x') are
  supported in the C Header but not the OCaml module because there are
  no PowerPC and S390x maintainers.

  Please consider contributing, especially if you want others to have an
  easier compilation story for your favorite hardware platform.


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

  Archive:
  <https://discuss.ocaml.org/t/full-stack-web-dev-in-ocaml-tutorial-w-dream-bonsai-and-graphql/9963/1>


Alexander (Sasha) Skvortsov announced
─────────────────────────────────────

  Hi everyone! I’ve written a tutorial blog series about full-stack web
  development in OCaml, and wanted to share it here.

  Last semester, I took Penn State's [CMPSC 431W], where our final
  project was to build a database-driven web application. Since I'm
  fairly familiar with web programming through my work on [Flarum] and
  past internships/side projects, I decided to use this opportunity to
  explore the OCaml web development ecosystem. I used [Dream] for the
  backend, and [Bonsai] for the frontend.

  While working on this project, I realized two things:

  • OCaml is very underrated for web development. In addition to all the
    language’s great features and safety guarantees, the ecosystem is
    pretty good! Dream near-perfectly coincides with my vision of
    backend webdev, and Bonsai has a great balance of
    flexibility/elegance and safety.
  • I couldn’t find realistic but accessible full-stack web projects in
    OCaml available for reference. I found [tutorials] for [bits] and
    [pieces], but nothing that connected all the dots.

  I really enjoyed writing an article series on [hardware design with
  OCaml], so I decided to do so for web development as well. In total, I
  wrote 7 articles that walk through my project’s:

  1. [Full-Stack WebDev in OCaml Intro]. This includes some background
     on the project, and instructions for accessing the [live demo].
  2. [Backend WebDev w/ Dream and Caqti].
  3. [Building GraphQL APIs with Dream]
  4. [Setting up Bonsai].
  5. [Understanding Bonsai]. I actually wrote the first draft of this
     before I decided to do a blog, while trying to, well, understand
     Bonsai. It goes over some underlying concepts (SPAs, Frontend State
     Management, Algebraic Effects, Monads), as well as Bonsai’s core
     design.
  6. [Using GraphQL in Bonsai].
  7. [Routing in Bonsai and Project Conclusion].

  Additionally, the [project’s README] has a comprehensive overview of
  the tech stack, folder structure, and usage instructions. It also
  includes some reflections on design decisions and my experience
  working with these libraries.

  I had a lot of fun writing these, and I hope they’re useful to anyone
  considering OCaml for web development. Would be happy to answer any
  questions or comments.


[CMPSC 431W]
<https://bulletins.psu.edu/university-course-descriptions/undergraduate/cmpsc/#:~:text=CMPSC%20431W%3A%20Database%20Management%20Systems>

[Flarum] <https://flarum.org/>

[Dream] <https://aantron.github.io/dream/>

[Bonsai] <https://github.com/janestreet/bonsai>

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

[bits] <https://jsthomas.github.io/ocaml-dream-api.html>

[pieces]
<https://github.com/janestreet/bonsai/blob/master/docs/getting_started/counters.mdx>

[hardware design with OCaml]
<https://discuss.ocaml.org/t/hardcaml-mips-cpu-learning-project-and-blog/8088>

[Full-Stack WebDev in OCaml Intro]
<https://ceramichacker.com/blog/26-1x-full-stack-webdev-in-ocaml-intro>

[live demo] <https://cmpsc431.ceramichacker.com/>

[Backend WebDev w/ Dream and Caqti]
<https://ceramichacker.com/blog/28-2x-backend-webdev-w-dream-and-caqti>

[Building GraphQL APIs with Dream]
<https://ceramichacker.com/blog/29-3x-building-graphql-apis-with-dream>

[Setting up Bonsai]
<https://ceramichacker.com/blog/30-4x-setting-up-bonsai>

[Understanding Bonsai]
<https://ceramichacker.com/blog/31-5x-understanding-bonsai>

[Using GraphQL in Bonsai]
<https://ceramichacker.com/blog/32-6x-using-graphql-in-bonsai>

[Routing in Bonsai and Project Conclusion]
<https://ceramichacker.com/blog/33-77-routing-in-bonsai-and-project-conclusion>

[project’s README] <https://github.com/askvortsov1/nittany_market>


Alexander (Sasha) Skvortsov later added
───────────────────────────────────────

  Also, forgot to mention this originally, but I recommend accessing the
  demo with one of the emails from [this file] or [this file] (all
  passwords are still [here]), as those users can also demo
  create/update functionalities.


[this file]
<https://github.com/askvortsov1/nittany_market/blob/main/data/Local_Vendors.csv>

[this file]
<https://github.com/askvortsov1/nittany_market/blob/main/data/Sellers.csv>

[here]
<https://github.com/askvortsov1/nittany_market/blob/main/data/Users.csv>


Daniel Bünzli replied
─────────────────────

  People who are looking for more lightweight alternatives – and want to
  do web programming without bothering too much about front end insanity
  can have a look at [hc] (yes indeed: sending HTML over `fetch', web
  programming excels at running in circles).

  The front JavaScript for that [CRUD webapp] comes out at 132Ko
  uncompressed without even trying to tweak anything.


[hc] <https://erratique.ch/software/hc>

[CRUD webapp] <https://github.com/dbuenzli/hyperbib>


Sketch.sh now supports multiple compiler versions, starting with 4.13.1
═══════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-sketch-sh-now-supports-multiple-compiler-versions-starting-with-4-13-1/9971/1>


Javier Chávarri announced
─────────────────────────

  The interactive OCaml sketchbook [sketch.sh] has now support to store,
  edit and run sketches in different versions of the OCaml compiler.


[sketch.sh] <https://sketch.sh/>

Support for 4.13
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Storing and running sketches using the compiler version 4.13.1 is now
  possible, this functionality has been added to the already existing
  support for version 4.06.1. The Reason parser and formatting tool
  refmt were also updated to a more recent version that supports 4.13.1.

  Here you can see a sketch showcasing the monadic let syntax, using the
  example from the official OCaml docs: [ZipSeq - Sketch.sh].


[ZipSeq - Sketch.sh] <https://sketch.sh/s/8cnNChTTq6IoGeFQarbvN2/>


Existing sketches and forks
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Previously existing sketches remain in 4.06.1, while newly created
  sketches will be on 4.13.1. For now, the only way to "migrate" a
  sketch to the newer version of the compiler is by copying its content
  and pasting it in a new sketch.

  Forked sketches inherit the compiler version of the forked sketch.


Future plans
╌╌╌╌╌╌╌╌╌╌╌╌

  In the future, there are plans to support version 4.14.0 of the
  compiler, and we are considering adding a way so that the version of
  the compiler can be chosen for a given sketch. We are also working on
  migrating the editor UI codebase to a more recent version of
  ReasonReact, and use JSX3 instead of JSX2.


Feature requests and bugs
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Please [let us know] in case you have a feature request, or if you
  encounter any issues or bugs. Also, don't hesitate to reach out via DM
  or any other means if you would like to contribute or participate in
  the project in some way.

  Thanks to [Ahrefs] for supporting an Open Source Day initiative, which
  allowed to allocate time to work on this improvement for sketch.sh,
  and for providing the infrastructure to run the sketch.sh service for
  the community. Thanks as well to the authors and maintainers of the
  OCaml compiler, js_of_ocaml, and ReScript, that sketch.sh relies upon.


[let us know] <https://github.com/Sketch-sh/sketch-sh/issues/new>

[Ahrefs] <https://ahrefs.com/>


Explicit type binding and mutual recursion
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/explicit-type-binding-and-mutual-recursion/9973/3>


Deep in this thread, octachron explained
────────────────────────────────────────

  For most use cases, if you want an explicit annotation for recursive
  function, it will be much simpler to use the `type a. ...' form:
  ┌────
  │ let rec foo: type a. a -> a = fun x -> x
  │ and bar: type a. a -> a = fun x -> foo x
  └────
  This form is a shortcut for both adding an explicit universal
  quantified and and a corresponding locally abstract type (in other
  words ~let f : 'a . …. = fun (type a) -> … ~).

  The root issue with

  ┌────
  │ let rec f (type a) (x:a) = f x
  └────
  is that the locally abstract type `a' is introduced after
  `f'. Moreover, without an explicit type annotation, a recursive
  function like `f' is monomorphic in its body and a monorphic function
  cannot be called on a type that was defined after the function.

  In other words, the issue is that in term of type scopes, the function
  `f' is equivalent to
  ┌────
  │ let f = ref Fun.id
  │ type t = A
  │ let x = !f A
  └────
  which also fails with
  ┌────
  │ Error: This expression has type t but an expression was expected of type 'a
  │        The type constructor t would escape its scope
  └────
  This is why the second solution proposed by @Gopiandcode
  works. Indeed, in

  ┌────
  │ let foo, bar = fun (type a) ->
  │   let rec foo (x: a) : a = x
  │   and bar (x: a) : a = foo x in
  │   foo, bar
  └────
  the type `a' is defined before the recursive functions `foo' and
  `bar', thus `foo a' does not break any scope constraint.


findlib-1.9.4
═════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-06/msg00004.html>


Gerd Stolpmann announced
────────────────────────

  findlib-1.9.4 is out. It mainly includes a change in the configuration
  script needed for OCaml-4-14.

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

  <http://projects.camlcity.org/projects/findlib.html>

  An updated OPAM package will follow soon.


omake-0.10.4
════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-06/msg00005.html>


Gerd Stolpmann announced
────────────────────────

  I just released omake-0.10.4, the build utility. This finally includes
  the fix for Apple Silicon, but also a couple of small changes (roughly
  everything since PR#100 to PR#146 on GitHub).

  For docs and the download link see
  <http://projects.camlcity.org/projects/omake.html>. opam is underway.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-05-31 12:29 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-05-31 12:29 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 24 to 31,
2022.

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

carray.0.0.1
OCaml Users and Developers Workshop 2022
Old CWN


carray.0.0.1
════════════

  Archive: <https://discuss.ocaml.org/t/ann-carray-0-0-1/9938/1>


Danny Willems announced
───────────────────────

  I'm glad to announce the first (experimental) release of ocaml-carray,
  a library mocking the Array interface to work with contiguous C array.
  *Disclaimer*: this first version is experimental and must be used with
  caution. A restricted set of values are supported at the moment
  (custom block with no out-of-heap values). Depending on the demand,
  more values might be supported.  Feel free to use this thread to
  suggest ideas, make opinions, etc.

  Repository
        <https://gitlab.com/dannywillems/ocaml-carray>
  License
        [MIT]
  Release
        [0.0.1]
  Documentation
        <https://dannywillems.gitlab.io/ocaml-carray/carray/index.html>
  Nomadic Labs website
        <https://nomadic-labs.com>
  Tezos ZK-rollups repository
        <https://gitlab.com/nomadic-labs/privacy-team>


[MIT]
<https://gitlab.com/dannywillems/ocaml-carray/-/blob/0.0.1/LICENSE>

[0.0.1] <https://gitlab.com/dannywillems/ocaml-carray/-/tags/0.0.1>

Motivation
╌╌╌╌╌╌╌╌╌╌

  OCaml arrays are not always contiguous piece of memory, requiring
  accessing different chunks of memory when accessing individual
  elements. When requiring a value in memory, the CPU will fetch the RAM
  and load not only the particular value but a memory page (a contiguous
  piece of memory) and add it to its cache. The CPU will use its cache
  to load the values in its registers. It is not efficient with large
  OCaml arrays as the CPU will constantly fetch the RAM to load
  different memory pages in its cache.  Also, when using the C FFI, the
  user must know the memory representation of an array and use the non
  user-friendly low-level interface macro `Field'.


This work
╌╌╌╌╌╌╌╌╌

  This library provides a polymorphic interface mocking a subset of the
  `Array' interface to work with contiguous piece of memory. Using the
  library should be as easy as adding `module Array = Carray'.  A C
  macro `Carray_val' is also provided for developers writing bindings
  and requires to simply cast in the underlying C type.  It has also
  been observed sub arrays are sometimes used for read-only
  operations. However, `Array.sub' allocates a fresh copy of the
  requested sub part. `Carray' leverages this memory cost by providing
  noalloc variants, like `sub_noalloc'.


Performances
╌╌╌╌╌╌╌╌╌╌╌╌

  The concept has been tested and used in real world applications like
  the polynomial library used by Nomadic Labs to implement zk-rollups. A
  speed up of around 50% has been observed when using contiguous arrays
  compared to OCaml arrays to compute NTT/FFT.


Usage
╌╌╌╌╌

  This library is *experimental*. Use this library with caution. The
  interface might change in the future.

  ┌────
  │ opam install carray.0.0.1
  └────


OCaml Users and Developers Workshop 2022
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-users-and-developers-workshop-2022/9726/2>


Continuing this thread, Matija Pretnar announced
────────────────────────────────────────────────

  This is a reminder for anyone interested in contributing to OCaml
  Workshop 2022. The deadline has been slightly extended to Friday, June
  3 (anywhere on Earth), which means you have roughly *four days left*
  to prepare your submissions.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-05-24  8:04 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-05-24  8:04 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 17 to 24,
2022.

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

ML Family Workshop 2022: Final Call for Presentations
Dune 3.2.0
Hardcaml MIPS CPU Learning Project and Blog
A tutorial on parallel programming in OCaml 5
Old CWN


ML Family Workshop 2022: Final Call for Presentations
═════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ml-family-workshop-2022-final-call-for-presentations/9877/1>


Benoit Montagu announced
────────────────────────

  We are happy to invite submissions to the *ML Family Workshop 2022*,
  to be held during the ICFP conference week on Thursday, September
  15th.

  The ML family workshop warmly welcomes submission touching on the
  programming languages traditionally seen as part of the “ML family”
  (Standard ML, OCaml, F#, CakeML, SML#, Manticore, MetaOCaml, etc.).
  The scope of the workshop includes all aspects of the design,
  semantics, theory, application, implementation, and teaching of the
  members of the ML family. We also encourage presentations from related
  languages (such as Haskell, Scala, Rust, Nemerle, Links, Koka, F*,
  Eff, ATS, etc), to exchange experience of further developing ML ideas.

  The workshop does not have proceedings, making it the perfect venue to
  run some ideas with the community or present some work in progress
  within a friendly environment. The PC has a broad expertise and
  submissions are 3 pages long: when in doubt, just submit!

  Currently, the workshop is scheduled to be an in-person event. We will
  give to the authors of accepted abstracts the opportunity to give
  their talks remotely if necessary, in case they could not travel.

  See the detailed CFP online on the ICFP website:
  <https://icfp22.sigplan.org/home/mlfamilyworkshop-2022#Call-for-Presentations>


Important dates
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Friday 3th June (any time zone): Abstract submission deadline
  • Tuesday 28th June: Author notification
  • Thursday 15th August: ML Family Workshop


Program committee
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Kenichi Asai (Ochanomizu University)
  • Arthur Azevedo de Amorim (Boston University)
  • Dariusz Biernacki (University of Wrocław)
  • Stephen Dolan (Jane Street)
  • Kavon Farvardin (Apple)
  • Armaël Guéneau (Inria)
  • Sam Lindley (University of Edinburgh)
  • Guido Martínez (CIFASIS-CONICET)
  • Keiko Nakata (SAP Innovation Center Potsdam)
  • Lionel Parreaux (Hong Kong University of Science and Technology)
  • Matija Pretnar (University of Ljubljana)
  • Mike Rainey (Carnegie Mellon University)
  • Yann Régis-Gianas (Nomadic Labs)
  • KC Sivaramakrishnan (IIT Madras and Tarides)
  • Ningning Xie (University of Cambridge)

  Chair: Benoît Montagu (Inria)


Submission details
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  See the online CFP for the details on the expected submission format.

  Submissions must be uploaded to the workshop submission website
  <https://ml2022.hotcrp.com/> before the submission deadline.


Dune 3.2.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-2-0/9892/1>


Rudi Grinberg announced
───────────────────────

  On behalf of the dune team, I'm pleased to announce the availability
  of version 3.2.0. This release contains few new features, but is
  packed with bug fixes and usability improvements. In particular, I'd
  like to point out that we've continued to improve the user experience
  with the watch mode. I encourage you all to try it out if you haven't
  already.

  Happy Hacking.


3.2.0 (17-05-2022)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Fixed `dune describe workspace --with-deps' so that it correctly
    handles Reason files, as well as files any other dialect. (#5701,
    @esope)

  • Disable alerts when compiling code in vendored directories (#5683,
    @NathanReb)

  • Fixed `dune describe --with-deps', that crashed when some
    preprocessing was required in a dune file using `per_module'.
    (#5682, fixes #5680, @esope)

  • Add `$ dune describe pp' to print the preprocssed ast of
    sources. (#5615, fixes #4470, @cannorin)

  • Report dune file evaluation errors concurrently. In the same way we
    report build errors. (#5655, @rgrinberg)

  • Watch mode now default to clearing the terminal on rebuild (#5636,
    fixes, #5216, @rgrinberg)

  • The output of jobs that finished but were cancelled is now
    omitted. (#5631, fixes #5482, @rgrinberg)

  • Allows to configure all the default destination directories with
    `./configure' (adds `bin', `sbin', `data', `libexec'). Use
    `OPAM_SWITCH_PREFIX' instead of calling the `opam' binaries in `dune
    install'. Fix handling of multiple `libdir' in `./configure' for
    handling `/usr/lib/ocaml/' and `/usr/local/lib/ocaml'. In `dune
    install' forbid relative directories in `libdir', `docdir' and
    others specific directory setting because their handling was
    inconsistent (#5516, fixes #3978 and #5455, @bobot)

  • `--terminal-persistence=clear-on-rebuild' will no longer destroy
    scrollback on some terminals (#5646, @rgrinberg)

  • Add a fmt command as a shortcut of `dune build @fmt --auto-promote'
    (#5574, @tmattio)

  • Watch mode now tracks copied external files, external directories
    for dependencies, dune files in OCaml syntax, files used by
    `include' stanzas, dune-project, opam files, libraries builtin with
    compiler, and foreign sources (#5627, #5645, #5652, #5656, #5672,
    #5691, #5722, fixes #5331, @rgrinberg)

  • Improve metrics for cram tests. Include test names in the event and
    add a category for cram tests (#5626, @rgrinberg)

  • Allow specifying multiple licenses in project file (#5579, fixes
    #5574, @liyishuai)

  • Match `glob_files' only against files in external directories
    (#5614, fixes #5540, @rgrinberg)

  • Add pid's to chrome trace output (#5617, @rgrinberg)

  • Fix race when creating local cache directory (#5613, fixes #5461,
    @rgrinberg)

  • Add `not' to boolean expressions (#5610, fix #5503, @rgrinberg)

  • Fix relative dependencies outside the workspace (#4035, fixes #5572,
    @bobot)

  • Allow to specify `--prefix' via the environment variable
    `DUNE_INSTALL_PREFIX' (#5589, @vapourismo)

  • Dune-site.plugin: add support for `archive(native|byte, plugin)'
    used in the wild before findlib documented `plugin(native|byte)' in
    2015 (#5518, @bobot)

  • Fix a bug where Dune would not correctly interpret `META' files in
    alternative layout (ie when the META file is named `META.$pkg'). The
    `Llvm' bindings were affected by this issue. (#5619, fixes #5616,
    @nojb)

  • Support `(binaries)' in `(env)' in dune-workspace files (#5560, fix
    #5555, @emillon)

  • (mdx) stanza: add support for (locks). (#5628, fixes #5489,
    @emillon)

  • (mdx) stanza: support including files in different directories using
    relative paths, and provide better error messages when paths are
    invalid (#5703, #5704, fixes #5596, @emillon)

  • Fix ctypes rules for external lib names which aren't valid ocaml
    names (#5667, fixes #5511, @Khady)


Hardcaml MIPS CPU Learning Project and Blog
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/hardcaml-mips-cpu-learning-project-and-blog/8088/12>


Alexander (Sasha) Skvortsov announced
─────────────────────────────────────

  Hi everyone! Last fall, we completed our original plan for this
  project, rewriting the verilog MIPS CPU we had designed for a class
  into Hardcaml. A few weeks later, we got an invite to video-meet with
  the Hardcaml team to talk about our experience. They even sent us
  actual Arty A-7 FPGAs so we could test out our simulation on real
  hardware!

  Junior year ended up much busier than expected, and although we had
  gotten our code onto the FPGAs by January, we’ve only just now fully
  finished our project. Our blog now has 2 bonus installments:

  1. [Running Hardcaml on an actual FPGA]. Here, we lit up LEDs to
     display the output of a hardcoded program.
  2. [Hardcaml MIPS and I/O]. Here, we restructured our CPU so that
     programs can communicate with an external device using UART.

  With these changes, our full design is now a simplified but realistic
  processor that can run meaningful programs.

  Thank you very much to @andyman, @fyquah95, Ben Devlin, and the rest
  of the Jane Street FPGA team for creating Hardcaml, meeting with us,
  and answering our numerous questions throughout this process. Thank
  you also to @yaron_minsky and Jane Street for sending us the FPGAs to
  try out our code.

  This has been an incredibly interesting, challenging, and rewarding
  journey. We hope that our blog posts and sample project are useful for
  learning Hardcaml in the future, and welcome any questions or
  comments.


[Running Hardcaml on an actual FPGA]
<https://ceramichacker.com/blog/27-1312-running-hardcaml-on-an-actual-fpga>

[Hardcaml MIPS and I/O]
<https://ceramichacker.com/blog/34-1412-hardcaml-mips-and-io>


A tutorial on parallel programming in OCaml 5
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/a-tutorial-on-parallel-programming-in-ocaml-5/9896/1>


KC Sivaramakrishnan announced
─────────────────────────────

  I ran a hands-on tutorial on the new parallel programming primitives
  in the upcoming OCaml 5 at the Tarides off-site last week. It covers
  the low-level parallelism primitives exposed by the OCaml 5 compiler
  as well as high-level parallel programming using `domainslib'. I hope
  you like it and find it useful. Please feel free to open issues if you
  find anything amiss.

  <https://github.com/kayceesrk/ocaml5-tutorial>


Alain De Vos asked and Olivier Nicole replied
─────────────────────────────────────────────

        As it is not immediately clear for me, does it uses
        threads , green threads, processes , fibers ? And who is
        responsible for the scheduling ,the Ocaml application or
        the underlying operating system ?

  Each domain corresponds to one system thread. The scheduling between
  them is therefore performed by the operating system.

  The tutorial only covers domains, which are the way to perform
  /parallelism/ in OCaml 5. To use /concurrency/ (e.g.  having several
  IO-depending operations that run concurrently on the same core), the
  main mechanism is effects (which at the level of the runtime system,
  are implemented using small stack segments called fibers), as in the
  [eio library]. Effects allow such libraries to provide a form a
  lightweight threads (aka green threads) whose scheduling is
  implemented in the OCaml application using effect mechanisms.


[eio library]
<https://github.com/ocaml-multicore/eio#design-note-capabilities>


UnixJunkie then said
────────────────────

  Here is a very simple tutorial on parallel programming in OCaml: use
  parany !  <https://github.com/UnixJunkie/parany> For OCaml 5, use the
  right branch of parany:
  <https://github.com/UnixJunkie/parany/tree/domains>

  Happy hacking!


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-05-17  7:12 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-05-17  7:12 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 10 to 17,
2022.

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

Browsing OCaml source tree with VSCode/merlin?
release of prbnmcn-gnuplot 0.0.3
Call for Presentations for "Teaching Functional Programming in OCaml" as part of the OCaml Workshop 2022
Old CWN


Browsing OCaml source tree with VSCode/merlin?
══════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/browsing-ocaml-source-tree-with-vscode-merlin/9819/2>


Keigo Imai explained
────────────────────

  I managed to browse the OCaml source tree with VSCode with the
  following steps:

  1. Prepare `.merlin' file (attached below) referring to the all source
     directories in the tree
  2. Pin your ocaml-lsp-server at 1.8.3 by `opam pin ocaml-lsp-server
     1.8.3' (as it is the last version that support `.merlin')
  3. Clone OCaml repository and check out the same OCaml version as
     yours (e.g. `opam switch create 4.12.1; git checkout 4.12.1')
  4. Build OCaml (./configure && make world)
  5. Open the top folder of the source tree using VSCode (or restart the
     language server)
  6. Browse the code

  Cheers!

  content of `.merlin':
  ┌────
  │ S ./asmcomp/
  │ S ./boot/menhir/
  │ S ./bytecomp/
  │ S ./debugger/
  │ S ./driver/
  │ S ./file_formats/
  │ S ./lambda/
  │ S ./lex/
  │ S ./middle_end/
  │ S ./middle_end/closure/
  │ S ./middle_end/flambda/
  │ S ./middle_end/flambda/base_types/
  │ S ./ocamldoc/
  │ S ./ocamltest/
  │ S ./otherlibs/dynlink/
  │ S ./otherlibs/dynlink/byte/
  │ S ./otherlibs/dynlink/dynlink_compilerlibs/
  │ S ./otherlibs/dynlink/native/
  │ S ./otherlibs/str/
  │ S ./otherlibs/systhreads/
  │ S ./otherlibs/unix/
  │ S ./parsing/
  │ S ./stdlib/
  │ S ./tools/
  │ S ./tools/unlabel-patches/
  │ S ./toplevel/
  │ S ./toplevel/byte/
  │ S ./toplevel/native/
  │ S ./typing/
  │ S ./utils/
  │ B ./asmcomp/
  │ B ./asmcomp/debug/
  │ B ./boot/
  │ B ./bytecomp/
  │ B ./debugger/
  │ B ./driver/
  │ B ./file_formats/
  │ B ./lambda/
  │ B ./lex/
  │ B ./middle_end/
  │ B ./middle_end/closure/
  │ B ./middle_end/flambda/
  │ B ./middle_end/flambda/base_types/
  │ B ./ocamldoc/
  │ B ./ocamldoc/generators/
  │ B ./ocamltest/
  │ B ./otherlibs/bigarray/
  │ B ./otherlibs/dynlink/
  │ B ./otherlibs/dynlink/byte/
  │ B ./otherlibs/dynlink/dynlink_compilerlibs/
  │ B ./otherlibs/dynlink/native/
  │ B ./otherlibs/str/
  │ B ./otherlibs/systhreads/
  │ B ./otherlibs/unix/
  │ B ./parsing/
  │ B ./stdlib/
  │ B ./testsuite/tests/no-alias-deps/
  │ B ./tools/
  │ B ./toplevel/
  │ B ./toplevel/byte/
  │ B ./toplevel/native/
  │ B ./typing/
  │ B ./utils/
  └────


release of prbnmcn-gnuplot 0.0.3
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-prbnmcn-gnuplot-0-0-3/9840/1>


Igarnier announced
──────────────────

  [prbnmcn-gnuplot] is a declarative wrapper on top of
  [gnuplot]. Version 0.0.3 was just released.

  The API is not entirely set in stone but it's reasonably usable, at
  least for up to moderately sized plots. It proceeds by constructing
  self-contained gnuplot scripts from declarative specifications and
  deferring to gnuplot for execution.

  Here's the [documentation].

  Happy hacking!


[prbnmcn-gnuplot] <https://github.com/igarnier/prbnmcn-gnuplot>

[gnuplot] <http://www.gnuplot.info/>

[documentation] <https://igarnier.github.io/prbnmcn-gnuplot/>


Call for Presentations for "Teaching Functional Programming in OCaml" as part of the OCaml Workshop 2022
════════════════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/call-for-presentations-for-teaching-functional-programming-in-ocaml-as-part-of-the-ocaml-workshop-2022/9847/1>


Yurug announced
───────────────

Special Session / Call for Presentations for "Teaching Functional Programming in OCaml" as part of the OCaml
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Workshop 2022

  • Abstract Submission: 6 June 2022
  • Author Notification: 7 July 2022
  • OCaml Workshop: 9 Sept 2022

  The OCaml Workshop 2022, co-located with ICFP 2022, will take place
  the 2022-09-16 and will be held at Ljubljana, Slovenia. This year, we
  would like to organize a special session on "Teaching Functional
  Programming in OCaml".

  Hence, we would like to encourage and invite submissions for
  presentations that highlight teaching practices and innovation that
  highlight how OCaml is taught around the globe and the wide range of
  tools and strategies that have been developed to teach effectively
  functional programming using OCaml. In particular, we are interested
  in automated program evaluation / grading tools / error analysis (both
  type and syntax errors) for OCaml programs, tools that provide
  assistance in practical lessons (such as pair programming for
  example), Jupiter notebooks like solutions to interactively introduce
  programming concepts, or full-featured web platforms. We are
  particularly seeking contributions and experience reports of the
  Learn-OCaml online programming environment which has been used by the
  OCaml teaching community for online but also for regular in-person
  classes. The goal is to share experiences, exchange ideas and tools,
  and promote best practices.

  Interested researchers are invited to submit and register a
  description of the talk (about 2 pages long) at
  <https://ocaml2022.hotcrp.com/providing> a clear statement of what
  will be provided by the presentation: the problems that are addressed,
  the solutions or methods that are proposed.

  LaTeX-produced PDFs are a common and welcome submission format. For
  accessibility purposes, we ask PDF submitters to also provide the
  sources of their submission in a textual format, such as ..tex
  sources. Reviewers may read either the submitted PDF or the text
  version.

  The OCaml workshop and this special session are informal meetings with
  no formal proceedings. The presentation material will be available
  online from the workshop homepage. The presentations may be recorded
  and made available at a later date.

  The main presentation format is a workshop talk, traditionally around
  20 minutes in length, plus question time, but we also have a poster
  session during the workshop - this allows us to present more diverse
  work and gives time for discussion. The program committee for the
  OCaml Workshop will decide which presentations should be delivered as
  posters or talks.

  • Simão Melo de Sousa (University of Beira Interior)
  • Brigitte Pientka (McGill University)
  • Yann Regis-Gianas (Nomadic Labs)
  • Xujie Si (McGill University)


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-05-10 12:30 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-05-10 12:30 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 1803 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of May 03 to 10,
2022.

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

Multicore OCaml: March 2022
Old CWN


Multicore OCaml: March 2022
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/multicore-ocaml-march-2022/9692/3>


Deep in this threal, KC Sivaramakrishnan announced
──────────────────────────────────────────────────

  The benchmarks from the "Retrofitting Effect handlers to OCaml" PLDI
  2022 paper (<https://arxiv.org/abs/2104.00250>) is available here:
  <https://github.com/prismlab/retro-concurrency/tree/master/bench>. See
  sections 6.2 and 6.3 in the paper.


He later added
──────────────

  I've moved the microbenchmarks alone to a separate repo:
  <https://github.com/prismlab/retro-concurrency-bench>. This repo also
  contains instructions to run the docker container that runs the
  benchmarks from the paper with the custom compiler variants.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 10683 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-05-03  9:11 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-05-03  9:11 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 15706 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of April 26 to May
03, 2022.

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

ATD now supports TypeScript
pp_loc 2.0
Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
V3.ocaml.org: we are live!
Remaking an Old Game in OCaml
Old CWN


ATD now supports TypeScript
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/atd-now-supports-typescript/9735/1>


Martin Jambon announced
───────────────────────

  [ATD] is a language for specifying typed interfaces for communicating
  across programming languages. It turns concrete type definitions
  ("schema") into code for each language. This code can read and write
  JSON safely, relieving the user of worrying about the structure of the
  JSON data.

  Starting from version 2.5.0, ATD provides `atdts', a single executable
  that turns a file `foo.atd' into `foo.ts'. See the [tutorial] for an
  introduction. The programming languages targeted by ATD are now:

  • Java
  • OCaml
  • Python + mypy
  • ReScript (BuckleScript)
  • Scala
  • TypeScript

  For an expert overview of the features that are currently supported,
  check out the test data:
  • [ATD input]
  • [TypeScript output]

  See also the [announcement for atdpy] that we made a month ago.


[ATD] <https://github.com/ahrefs/atd>

[tutorial] <https://atd.readthedocs.io/en/latest/atdts.html#tutorials>

[ATD input]
<https://github.com/ahrefs/atd/blob/master/atdts/test/atd-input/everything.atd>

[TypeScript output]
<https://github.com/ahrefs/atd/blob/master/atdts/test/ts-expected/everything.ts>

[announcement for atdpy]
<https://discuss.ocaml.org/t/atdpy-derive-safe-json-interfaces-for-python/9544>


pp_loc 2.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-pp-loc-2-0/9741/1>


Armael announced
────────────────

  Do you know how OCaml now displays errors by quoting back part of the
  source, highlighting the faulty part? For instance, with a single-line
  error location:
  ┌────
  │ File "foo.ml", line 1, characters 12-14:
  │ 1 | let foo x = yy + 1;;
  │                 ^^
  └────
  or a multi-line location:
  ┌────
  │ File "bar.ml", lines 3-5, characters 10-10:
  │ 3 | ..........function
  │ 4 |   | A -> 0
  │ 5 |   | B -> 1
  └────

  Do you have your own language/configuration file/… parser or
  typechecker, that could benefit from nice, user-friendly error
  messages?

  The [pp_loc] library provides an easy-to-use implementation of the
  same source-quoting mechanism that is used in the OCaml compiler. It
  provides a single function `pp' which will display the relevant part
  of the input given the location(s) of the error.

  ┌────
  │ val pp :
  │   ?max_lines:int ->
  │   input:Input.t ->
  │   Format.formatter ->
  │   loc list ->
  │   unit
  └────
  (As one can see from the signature, `pp' also supports displaying
  several locations at once on the same source snippet, for
  multi-location errors.)

  The full [documentation is available online], and the library is
  available on opam (`opam install pp_loc').

  This new version, thanks to the contribution of @c-cube, makes the
  `loc' type more flexible. It should now be easy to create source
  locations that can be passed to `pp', however you represent them in
  your parser (be it as (line,column) pairs, offsets, or any combination
  of those…). For more details, see the [Pp_loc.Position] module.

  I am completely open to more PRs or ideas for improving the library
  further, and displaying source locations in even nicer ways!

  Happy error-message printing!


[pp_loc] <https://github.com/Armael/pp_loc>

[documentation is available online]
<https://armael.github.io/pp_loc/pp_loc/Pp_loc/index.html>

[Pp_loc.Position]
<https://armael.github.io/pp_loc/pp_loc/Pp_loc/Position/index.html>


Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
═════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-windows-friendly-ocaml-4-12-distribution-diskuv-ocaml-0-1-0/8358/18>


jbeckford announced
───────────────────

  A single `setup-*.exe' executable is now all that is necessary to
  install the Diskuv OCaml distribution on 64-bit Windows!

  Today you can use a prerelease of v0.4.0 which is available at
  <https://github.com/diskuv/dkml-installer-ocaml/releases/download/v0.4.0-prerel11/setup-diskuv-ocaml-windows_x86_64-0.4.0.exe>

  The prerelease:
  • is for *experienced Windows users only* because the prerelease is
    not signed! You will have to fight with your browser, operating
    system and anti-virus software to run the setup executable
  • is *not reproducible*. Because many Diskuv packages have not yet
    made it into Opam, the builds need several `opam pin' of unstable
    branches.
  • has not been incorporated into the
    <https://diskuv.gitlab.io/diskuv-ocaml> documentation site. But the
    [Beyond Basics] documentation should still be accurate.

  Once those items above are addressed, a real (non-prerelease) 0.4.0
  will be announced.

        Existing Diskuv OCaml users: Your existing Opam switches
        should be unaffected by the upgrade. But please make sure
        you can recreate your Opam switches (ie. use a `.opam'
        file) if something goes wrong.

  Release notes, including details of the migration to the Apache 2.0
  license, are at available at
  [https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v0.4.0-prerel11]


[Beyond Basics]
<https://diskuv.gitlab.io/diskuv-ocaml/doc/BeyondBasics.html#beyondbasics>

[https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v0.4.0-prerel11]
<https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v0.4.0-prerel11>


V3.ocaml.org: we are live!
══════════════════════════

  Archive: <https://discuss.ocaml.org/t/v3-ocaml-org-we-are-live/9747/1>


Thibaut Mattio announced
────────────────────────

  I am thrilled to announce that <https://ocaml.org/> now serves version
  3 of the site! Here's an overview of the major features in this new
  version:

  • [Central OCaml package documentation], which contains the
    documentation of every version of every OCaml packages.
  • [OCaml job board], which lists job opportunities from the community.
  • [A syndicated blog], which links to blog articles from the community
    and offers original blog posts.
  • [OCaml success stories] which explore how major OCaml industrial
    users solved real-world challenges using OCaml.
  • [Resources for learning OCaml], which aggregates resources and
    tutorials to learn OCaml.
  • [An interactive OCaml playground] to try OCaml code directly in the
    browser.

  Version 2 remains accessible at <https://v2.ocaml.org/>, and older
  URLs to ocaml.org will be redirected to the v2 URL from now
  on. Similarly, v3.ocaml.org URLs will continue to work.

  Community feedback was instrumental and has been driving the direction
  of the project since day one. For instance, having a centralized
  package documentation site; or facilitating the hiring of OCaml
  developers and finding OCaml jobs were major concerns that were
  highlighted in the last [OCaml Survey]. They were what prompted us to
  work on the documentation site and the job board respectively.

  We've also listened to the community feedback we received along the
  way, and in particular, here's an overview of everything we've been
  doing to address the feedback we received after our last Discuss post:
  <https://hackmd.io/IniIM_p3Qs2UB74cuKK7UQ>.

  Given how critical your input is to drive the project, I am deeply
  grateful to every one who took the time to share insights, suggestions
  and bug reports. Some of the suggestions will need more work and
  couldn't happen before launch, but we've listened to every one and
  will keep working on improving OCaml.org to address pain points of the
  community.  Thank you, and keep the feedback coming!

  We're also starting to see a lot of contributions from external
  contributors. OCaml.org is open source, and contributions from anyone
  are extremely welcome! Never hesitate to open a PR if you see
  something you'd like to improve! You can read our [Contributing Guide]
  to learn how to contribute.


[Central OCaml package documentation] <https://ocaml.org/packages>

[OCaml job board] <https://ocaml.org/opportunities>

[A syndicated blog] <https://ocaml.org/blog>

[OCaml success stories] <https://ocaml.org/success-stories>

[Resources for learning OCaml] <https://ocaml.org/learn>

[An interactive OCaml playground] <https://ocaml.org/play>

[OCaml Survey]
<https://discuss.ocaml.org/t/ann-ocaml-user-survey-2020/6624>

[Contributing Guide]
<https://github.com/ocaml/ocaml.org/blob/main/CONTRIBUTING.md>

Ecosystem Contributions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  As the storefront of the OCaml ecosystem, we couldn't develop the next
  version of OCaml.org without contributing back! As a result, we've
  published several packages on opam that we're using for OCaml.org:

  • [dream-accept]: Accept headers parsing for Dream
  • [dream-encoding]: Encoding primitives for Dream.
  • [hilite]: Generate HTML ready for syntax-highlighting with CSS by
    parsing markdown documents.

  Other packages that are yet to be released are:

  • [code-mirror]: The code-mirror bindings
  • [js_top_worker]: An OCaml toplevel designed to run in a web worker

  We've also made contributions downstream:

  • odoc: [Support for HTML fragments in odoc]
  • river: [API changes and capability to fetch metadata from RSS post
    links]

  A huge thank you to the community for your constant effort in making
  OCaml such a great language to work with! In particular, here are some
  amazing community projects we are building upon: [Dream], [Brr] and
  [Omd] and [many more]


[dream-accept] <https://github.com/tmattio/dream-accept>

[dream-encoding] <https://github.com/tmattio/dream-encoding>

[hilite] <https://github.com/patricoferris/hilite>

[code-mirror]
<https://github.com/patricoferris/jsoo-code-mirror/tree/static>

[js_top_worker] <https://github.com/jonludlam/js_top_worker>

[Support for HTML fragments in odoc]
<https://github.com/ocaml/odoc/pull/842>

[API changes and capability to fetch metadata from RSS post links]
<https://github.com/kayceesrk/river/pull/6>

[Dream] <https://aantron.github.io/dream/>

[Brr] <https://github.com/dbuenzli/brr>

[Omd] <https://github.com/ocaml/omd>

[many more] <https://github.com/ocaml/ocaml.org/blob/main/ocamlorg.opam>


What's next?
╌╌╌╌╌╌╌╌╌╌╌╌

  Launching the website is the first step on our roadmap to improve
  OCaml’s online presence.

  As mentioned above, the immediate goal is to be ready for this OCaml
  5.00.0 release. With this in mind, we want to focus on improving the
  documentation and ensuring it includes good user pathways to learn
  about Domains, Effects, and generally how to write concurrent programs
  in OCaml.

  In addition to the documentation, some of the other projects on our
  roadmap are:

  • Toplevels for all the packages that compile to JavaScript.
  • Including OCaml Weekly News in the OCaml blog.
  • A better search through packages, documentation, and packages'
    documentation.

  This is an exciting time! Stay tuned!


Call for maintainers
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  There's a lot of ways to contribute if you'd like to help. Our
  [contributing guide] should be a good entry point to learn what you
  can do as a community contributor.

  We're also looking for maintainers. As we're completing the first
  milestone with the launch and will start working on new projects, now
  is a great time to get involved!

  If you'd like to help on the initiatives on our roadmap above (or
  others!), feel free to reach out to me by email at
  thibaut@tarides.com, or by replying to this post.


[contributing guide]
<https://github.com/ocaml/ocaml.org/blob/main/CONTRIBUTING.md>


Acknowledgements
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  This project was a huge effort that started over a year ago, and the
  result of dozens of [contributors]. We want to thank every one who
  contributed to the site.

  In particular, for the groundwork on rethinking the sitemap, user
  flows, new content, design, and frontend and package docs, we thank
  Ashish Agarwal, Kanishka Azimi, Richard Davison, Patrick Ferris, Gemma
  Gordon, Isabella Leandersson, Thibaut Mattio and Anil Madhavapeddy.

  For the work on the package site infrastructure and UI, we thank Jon
  Ludlam, Jules Aguillon and Lucas Pluvinage. And for the work on the
  designs and bringing them to life on the frontend, we thank Isabella
  Leandersson and Asaad Mahmood.

  For the work on the new content and reviewing the existing one, we
  thank Christine Rose and Isabella Leandersson.

  For the contributions on the content for Ahrefs, Jane Street and
  LexiFi respectively, we thank Louis Roché, James Somers, Nicolás Ojeda
  Bär.

  We’d also like to thank the major funders who supported the work on
  revamping the website: grants from the Tezos Foundation, Jane Street
  and Tarides facilitated the bulk of the work. Thank you, and if anyone
  else wishes to help support it on an ongoing basis then donations to
  the OCaml Software Foundation and grants to the maintenance teams
  mentioned above are always welcomed.


[contributors] <https://github.com/ocaml/ocaml.org/graphs/contributors>


Remaking an Old Game in OCaml
═════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/remaking-an-old-game-in-ocaml/9760/1>


Yotam Barnoy announced
──────────────────────

  I've starting blogging about a [side-project of mine]. Hopefully I'll
  find the time to write some further entries in the series, including
  about reverse engineering a binary with IDA.


[side-project of mine]
<https://justabluddyblog.wordpress.com/2022/05/01/remaking-an-old-game-in-ocaml/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 26538 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-04-26  6:44 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-04-26  6:44 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 9882 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of April 19 to 26,
2022.

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

Multicore OCaml: March 2022
OUPS meetup may 2022 (french only)
JFLA 2022: Call for Participation (in French)
Old CWN


Multicore OCaml: March 2022
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/multicore-ocaml-march-2022/9692/1>


Anil Madhavapeddy announced
───────────────────────────

  Welcome to the March 2022 [Multicore OCaml] monthly report! This
  update along with the [previous updates] have been compiled by me,
  @ctk21, @kayceesrk and @shakthimaan.

  We have continued steadily towards making a stable OCaml 5.0 release,
  as you can see from the long list of fixes later – thank you for all
  your contributions! Platform configurations that were formerly
  supported in the 4.x branches for OpenBSD, FreeBSD, and NetBSD have
  now been re-enabled. ARM64 support (for macOS, Linux and the BSDs) is
  stable in trunk, and ARM CFI integration has been merged as a
  follow-up to facilitate debugging and profiling.  Notably, this also
  includes [memory model tests for ARMv8 and Power ports]. The Windows
  mingw64 port is also working again in trunk.

  An [effects tutorial] has also been contributed to the OCaml manual;
  feedback continues to be welcome even after it's merged in.  As you
  experiment with effects, please do continue to post to this forum with
  questions or comments about your learnings.

  The Sandmark benchmark project has added bytecode analysis to address
  any performance regressions. We have also been working on obtaining
  measurements for the compilation data points. The current-bench
  pipeline production deployments has significant UI changes, and now
  has alert notifications for the benchmark runs.

  As always, the Multicore OCaml open and completed tasks are listed
  first, which are then followed by the ecosystem tooling projects. The
  Sandmark, sandmark-nightly, and current-bench project updates are
  finally presented for your reference.

  /Editor’s note: please find the full changelog following the archive
  link above./


[Multicore OCaml] <https://github.com/ocaml-multicore/ocaml-multicore>

[previous updates] <https://discuss.ocaml.org/tag/multicore-monthly>

[memory model tests for ARMv8 and Power ports]
<https://github.com/ocaml/ocaml/pull/11004>

[effects tutorial] <https://github.com/ocaml/ocaml/pull/11093>


OUPS meetup may 2022 (french only)
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/oups-meetup-may-2022-french-only/9715/1>


zapashcanon announced
─────────────────────

  Le prochain OUPS aura lieu le *jeudi 12 mai* 2022. Le rendez-vous est
  fixé à *19h* en *salle 15-16 101* , *4 place Jussieu* , 75005 Paris.

  *L'inscription est obligatoire* pour pouvoir accéder au meetup ! Votre
  nom complet doit être disponible.  L'inscription s'effectue sur
  [meetup].

  Toutes les informations sont disponibles sur [le site du oups].

  J'aimerais aussi signaler que les slides et vidéos des exposés passés
  [sont maintenant disponibles] ! :partying_face:

  *Programme*


[meetup] <https://www.meetup.com/fr-FR/ocaml-paris>

[le site du oups] <https://oups.frama.io>

[sont maintenant disponibles] <https://oups.frama.io/past.html>

Gospel & Ortac - Clément Pascutto
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Gospel is a behavioural specification language for OCaml program. It
  provides developers with a non-invasive and easy-to-use syntax to
  annotate their module interfaces with formal contracts that describe
  type invariants, mutability, function pre-conditions and
  post-conditions, effects, exceptions, and [much more]!

  ortac: OCaml Runtime Assertion Checking.


[much more] <https://ocaml-gospel.github.io/gospel/>


MirageOS 4 - Romain Calascibetta
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  MirageOS 4 vient de sortir récemment et c'est l'occasion de
  (re)présenter ce projet permettant de construire des unikernels. Nous
  y présenterons les nouvelles features et possibilités et nous ferons
  une introspection de 3 ans de travail de l'équipe core.


Tezt: OCaml Tezos Test Framework - Romain Bardou
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Tezt is a test framework for OCaml. It is well suited for unit and
  regression tests and particularly shines for integration tests,
  i.e. tests that launch external processes. It was made with a focus on
  user experience. It allows you to easily select tests from the
  command-line and provides pretty logs. It also can run tests in
  parallel, automatically split the set of tests into several
  well-balanced batches to be run in parellel CI jobs, produce JUnit
  outputs, and more. It has been in use at Nomadic for the last 2 years
  and is thus quite battle-tested.


JFLA 2022: Call for Participation (in French)
═════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-04/msg00008.html>


Timothy Bourke announced
────────────────────────

  [ This message is intentionally written in French. It is a call for
  participation for the "Francophone Days on Functional Languages" to be
  held, finally and fingers crossed, at the end of June. Some of the
  articles are written in English. They are available online:
  <https://hal.inria.fr/JFLA2022/> ]

  *Merci de faire circuler : premier appel à participation*

  JFLA'2022 (<http://jfla.inria.fr/jfla2022.html>)

  Journées Francophones des Langages Applicatifs

  Saint-Médard-d'Excideuil - du 28 juin au 1er juillet 2022

  Les inscriptions aux JFLA 2022 - en présence ! - sont désormais
  ouvertes :

  <https://www.azur-colloque.fr/DR04/inscription/preinscription/203/fr>

  Ces journées réunissent concepteurs, utilisateurs et théoriciens ;
  elles ont pour ambition de couvrir les domaines des langages
  applicatifs, de la preuve formelle, de la vérification de programmes,
  et des objets mathématiques qui sous-tendent ces outils. Ces domaines
  doivent être pris au sens large : nous souhaitons promouvoir les ponts
  entre les différentes thématiques.

  L'inscription est un forfait qui comprend notamment l'hébergement en
  pension complète sur le site des journées :
  • participant·e plein tarif, chambre simple : 660 euros
  • étudiant·e orateur·ice, en chambre double : 0 euro

  Nous espérons que vous serez nombreux à participer à ces journées.
  Inscrivez-vous dès que possible ! En particulier, les étudiant·es
  orateur·ices sont invité·es à s'inscrire, même s'ils ne paient pas
  grâce à nos sponsors.

  Vous pouvez d'ores et déjà vous inscrire au salon de discussion
  framateam afin d'échanger ensemble :
  <https://framateam.org/signup_user_complete/?id=gnbebtncubnbpe96ok9kam8t9y>

  Tout le programme est à retrouver ici :
  <http://jfla.inria.fr/jfla2022.html>


Dates importantes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • 17 juin 2022 : date limite d'inscription aux journées
  • 28 juin au 1er juillet 2022 : journées


Cours invités
╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Delphine Demange (IRISA, Université de Rennes 1) "Si2-FIP:
    Programmation Fonctionnelle en Licence 1 avec Scala"

  • Denis Mérigoux (Inria) "Rust pour le formaliste impatient"


Exposé invité
╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Matthias Puech (INA GRM) Titre à venir - avec une surprise !


Articles acceptés
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  L'ensemble des articles acceptés est disponible sous forme d'une
  collection HAL : <https://hal.inria.fr/JFLA2022>


Comité de programme
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Chantal Keller LMF, Université Paris-Saclay (Présidente)
  • Timothy Bourke Inria, ÉNS de Paris (Vice-président)

  • Sandrine Blazy Irisa, Université Rennes 1
  • Frédéric Bour Tarides - Inria
  • Guillaume Bury OcamlPro
  • Stefania Dumbrava Samovar, ENSIIE, Télécom Sud Paris
  • Diane Gallois-Wong Nomadic Labs
  • Adrien Guatto IRIF, Université de Paris
  • David Janin LaBRI, Université de Bordeaux
  • Marie Kerjean LIPN, Université Paris 13
  • Luc Pellissier LACL, Université Paris-Est Créteil
  • Mário Pereira NOVA-LINCS, Universidade Nova de Lisboa
  • Alix Trieu Aarhus University
  • Yannick Zakowski LIP, Inria, ÉNS de Lyon


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 20509 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-04-19  5:34 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-04-19  5:34 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 9483 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of April 12 to 19,
2022.

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

Lwt informal user survey
pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
Creating a library for use from JS with js_of_ocaml
ocaml-lsp-server 1.11.0
OCaml summer school in Spain, call for industry speakers
Dune 3.1.0
Old CWN


Lwt informal user survey
════════════════════════

  Archive: <https://discuss.ocaml.org/t/lwt-informal-user-survey/9666/1>


Raphaël Proust announced
────────────────────────

  In order to make some decisions relating to the maintenance of Lwt,
  I'd like to know a little bit more about how the library is used in
  the wild. Do not hesitate to respond to the poll and/or as a message
  in this thread, or even to contact me via other means in case discuss
  is not your jam.

  /Editor’s note: please follow the link above to reply to the survey./


pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-pyml-bindgen-a-cli-app-to-generate-python-bindings-directly-from-ocaml-value-specifications/8786/7>


Continuing this thread, Ryan Moore announced
────────────────────────────────────────────

  I wrote a [blog post] providing an introduction to `pyml_bindgen'.  It
  gives an intro in a slightly different style as compared to the [docs]
  and the [examples], and includes some of the latest features I've been
  working on.


[blog post]
<https://www.tenderisthebyte.com/blog/2022/04/12/ocaml-python-bindgen/>

[docs] <https://mooreryan.github.io/ocaml_python_bindgen/>

[examples]
<https://github.com/mooreryan/ocaml_python_bindgen/tree/main/examples>


Creating a library for use from JS with js_of_ocaml
═══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/creating-a-library-for-use-from-js-with-js-of-ocaml/9523/5>


Deep in this thread, threepwood said
────────────────────────────────────

  Cautionary note for anyone reading this in the future: dynamic imports
  are asynchronous, and initializing the jsoo runtime takes some
  milliseconds, so that if you just do:
  ┌────
  │ import("ocaml/export.bc.js");
  │ var x = mylib.myfunction();
  └────
  the second line will fail as `mylib' is not defined yet (at least this
  is what I think is happening). You need to guarantee the module is
  done initializing in some way or other.


Kim Nguyễn then said
────────────────────

  `import' should return a promise of the loaded module. So you can just
  `await' for it (if your current context allows you to write `await')
  or just :
  ┌────
  │  import("ocaml/export.bc.js").then ((_) => {
  │ 
  │  mylib.myfunction();
  │ 
  │ });
  └────


ocaml-lsp-server 1.11.0
═══════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-lsp-server-1-11-0/9677/1>


Rudi Grinberg announced
───────────────────────

  On behalf of the ocamllsp team, I'm excited to announce the
  availability of version 1.11.0. This release is an important milestone
  for the project because it introduces integration with our favorite
  build system. When you run dune in watch mode, you will now be able to
  see build errors in the diagnostics panel of your editor. It's all
  rather experimental for now, so your feedback and bug reports are
  appreciated.

  As usual, the full change log is below.

  Happy hacking.

  *1.11.0*


Features
╌╌╌╌╌╌╌╌

  • Add support for dune in watch mode. The lsp server will now display
    build errors in the diagnostics and offer promotion code actions.

  • Re-introduce ocamlformat-rpc (#599, fixes #495)


Fixes
╌╌╌╌╌

  • Fix workspace symbols that could have a wrong path in some cases
    ([#675])


[#675] <https://github.com/ocaml/ocaml-lsp/pull/671>


OCaml summer school in Spain, call for industry speakers
════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-summer-school-in-spain-call-for-industry-speakers/9685/1>


Roberto Blanco announced
────────────────────────

  Dear all, Ricardo Rodríguez and I are organizing an introductory OCaml
  course as part of the annual summer school of the University of
  Zaragoza in Spain. (This is the oldest summer university in the
  country, nearing its centennial anniversary!). The country's computing
  programs are quite excellent, although we have found them to generally
  not pay serious attention to modern functional programming. Our goal
  is to use OCaml to begin to address this dearth.

  In addition to the regular academic program we are planning a
  satellite event open to the general public. This is meant to introduce
  the OCaml ecosystem to a wider audience of students and academics, as
  well as professionals. As part of this, we would like to hold a round
  table discussion of industrial OCaml users to demonstrate the width
  and depth of practical uses of the language. There will be time for
  participants to present their work in more detail, if they wish to do
  so.

  If you may be interested in participating or have any questions, feel
  free to write to me here or send email to either of us. The course is
  currently in its planning stages; it is scheduled to take place in
  early to mid July, in all likelihood in the city of Zaragoza and in
  hybrid format. The OCaml Software Foundation is backing the initiative
  and we thank them for their generous support.

  Updated information about the course will be available on its website:
  <https://webdiis.unizar.es/evpf/>


Dune 3.1.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-1-0/9690/1>


Rudi Grinberg announced
───────────────────────

  On behalf of the dune team, I'm pleased to announce version
  3.1.0. This release contains some small, but interesting features, and
  some important quality of life bug fixes. I encourage everyone to
  upgrade as soon as possible.

  Happy Hacking.

  *3.1.0 (15/04/2022)*

  • Add `sourcehut' as an option for defining project sources in
    dune-project files. For example, `(source (sourcehut
    user/repo))'. (#5564, @rgrinberg)

  • Add `dune coq top' command for running a Coq toplevel (#5457,
    @rlepigre)

  • Fix dune exec dumping database in wrong directory (#5544, @bobot)

  • Always output absolute paths for locations in RPC reported
    diagnostics (#5539, @rgrinberg)

  • Add `(deps <deps>)' in ctype field (#5346, @bobot)

  • Add `(include <file>)' constructor to dependency
    specifications. This can be used to introduce dynamic dependencies
    (#5442, @anmonteiro)

  • Ensure that `dune describe' computes a transitively closed set of
    libraries (#5395, @esope)

  • Add direct dependencies to $ dune describe output (#5412, @esope)

  • Show auto-detected concurrency on Windows too (#5502, @MisterDA)

  • Fix operations that remove folders with absolute path. This happens
    when using esy (#5507, @EduardoRFS)

  • Dune will not fail if some directories are non-empty when
    uninstalling.  (#5543, fixes #5542, @nojb)

  • `coqdep' now depends only on the filesystem layout of the .v files,
    and not on their contents (#5547, helps with #5100, @ejgallego)

  • The mdx stanza 0.2 can now be used with `(implicit_transitive_deps
    false)' (#5558, fixes #5499, @emillon)

  • Fix missing parenthesis in printing of corresponding terminal
    command for `(with-outputs-to )' (#5551, fixes #5546, @Alizter)


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 20212 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-04-12  8:10 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-04-12  8:10 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 14034 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of April 05 to 12,
2022.

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

LexiFi is hiring!
Développeur principal à plein temps d'Alt-Ergo chez OCamlPro
Using an external JavaScript file in js_of_ocaml
diskuvbox: small set of cross-platform CLI tools
Old CWN


LexiFi is hiring!
═════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-fulltime-internship-paris-lexifi-is-hiring/9648/1>


Alain Frisch announced
──────────────────────

  📢 [LexiFi] is hiring!

  ✔️ Software Engineer (full-time): <https://lnkd.in/evhkxTg>

  ✔️ Software Development Internship: <https://lnkd.in/gb-bdDA9>

  LexiFi is a software editor, based in Paris. We have been happily
  using OCaml 🐪 for more than 20 years in our entire software stack,
  from backend components to UI (web & native) front-end, and we
  contribute back to the OCaml community (check out our blog post :
  <https://www.lexifi.com/blog/ocaml/ocaml-open-source/>)

  Don't hesitate to contact me directly if you want to learn more about
  the positions before applying!


[LexiFi] <https://www.lexifi.com>


Développeur principal à plein temps d'Alt-Ergo chez OCamlPro
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-fulltime-paris-developpeur-principal-a-plein-temps-dalt-ergo-chez-ocamlpro/9660/1>


Fabrice Le Fessant announced
────────────────────────────

  Alt-Ergo est l'un des solveurs SMT les plus efficaces pour la
  vérification formelle de code. Il est ainsi utilisé derrière des
  ateliers tels que Why3, Frama-C et Spark. Initialement développé par
  Sylvain Conchon au LRI, il est aujourd'hui maintenu par OCamlPro,
  grâce aux financements du Club Alt-Ergo (AdaCore, Trust-in-Soft,
  Thalès, MERCE, CEA List), à des contrats bilatéraux d'évolution et à
  des projets collaboratifs.

  OCamlPro souhaite aujourd'hui recruter un développeur principal à
  temps plein pour Alt-Ergo, pour compléter son équipe méthodes
  formelles et accélérer l'évolution d'Alt-Ergo.  Disposant d'une
  expérience dans les méthodes formelles, ses missions seront :

  • de découvrir le projet Alt-Ergo et tous ses composants (prouveur,
    interface graphique, etc.) et d'en comprendre le fonctionnement à
    travers l'exploration du code et la lecture d'articles
    scientifiques;
  • d'élaborer la roadmap de maintenance évolutive d'Alt-Ergo, en
    collaboration avec les membres du Club Alt-Ergo, et de proposer des
    améliorations qui pourront être financées au travers de contrats
    bilatéraux ou de projets collaboratifs;
  • de participer avec l'équipe à la maintenance corrective d'Alt-Ergo
    et de fournir du support aux membres du Club Alt-Ergo;
  • de participer à l'encadrement de stages et de thèses CIFRE autour
    d'Alt-Ergo et des solveurs SMT en général;
  • de suivre l'actualité des solveurs SMTs et des travaux scientifiques
    connexes, et de maintenir des collaborations avec les experts
    académiques du domaine;

  Intégré au sein de l'équipe Méthodes Formelles d'OCamlPro, il
  bénéficiera de leur expérience et leur fera bénéficier de son
  expertise croissante dans l'utilisation d'Alt-Ergo. Outre la
  maintenance d'Alt-Ergo, l'équipe Méthodes Formelles d'OCamlPro
  participe à diverses activités:

  • Développement d'outils open-source pour les méthodes formelles, tels
    que Dolmen, Matla, etc.
  • Expertises sur WhyML, TLA, Coq, et autres langages de spécification
    et de vérification;
  • Certification de logiciels pour les Critères Communs (EAL6 et plus)
  • Spécification et vérification formelle de smart contracts (Solidity,
    etc.)

  Les bureaux d'OCamlPro sont dans le 14ème arrondissement de Paris
  (Alésia). L'entreprise est connue pour son équipe sympathique, son
  excellence technique, sa productivité, ses valeurs et son éthique.

  Si ce poste vous intéresse, n'hésitez pas à envoyer votre CV à:

  contact@ocamlpro.com

  Pour plus d'informations sur OCamlPro:

  <https://www.ocamlpro.com/>

  Pour plus d'informations sur Alt-Ergo:

  <https://alt-ergo.ocamlpro.com/>

  Pour plus d'informations sur le Club Alt-Ergo:

  <https://www.ocamlpro.com/club-alt-ergo>


Using an external JavaScript file in js_of_ocaml
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/using-an-external-javascript-file-in-js-of-ocaml/9661/1>


John Whitington asked
─────────────────────

  I am a beginner at both Javascript and `js_of_ocaml', so I may be
  mixing up all sorts of mistakes and misconceptions here.

  I have compiled up an existing project, my command line PDF tools,
  using `js_of_ocaml', and all is well:

  ┌────
  │ $ node cpdf.js -info hello.pdf
  │ Encryption: Not encrypted
  │ Permissions:
  │ Linearized: false
  │ Version: 1.1
  │ Pages: 1
  └────

  Like magic! But I had to comment out the parts of my code which use
  external C code of course - that is zlib and some encryption
  primitives. So now I wish to bind javascript libraries for those. I am
  experimenting with a simple library of my own, first, which is given
  on the command line to `js_of_ocaml' as `foomod.js':

  ┌────
  │ foo = 42;
  └────

  I can get to this global variable easily from OCaml:

  ┌────
  │ let foo = Js.Unsafe.global##.foo
  └────

  But now I want to do things better, and I change `foomod.js' to:

  ┌────
  │ exports.foo = 42;
  └────

  How can I get to that? Giving `foomod.js' on the `js_of_ocaml' command
  line includes the contents of `foomod.js' in some way, but does not
  contain the string `foomod', so I'm not sure how to get to the
  foomod's variables and functions. How to I access them? In the node
  REPL, I can simply do:

  ┌────
  │ > foomod = require('./foomod.js');
  │ { foo; 42 }
  │ > foomod.foo;
  │ 42
  └────

  I have read the `js_of_ocaml' help page on how to bind JS modules:

  <https://ocsigen.org/js_of_ocaml/latest/manual/bindings>

  I imagine if I could get over this hump, all the rest of the
  information I need will be there.


Nicolás Ojeda Bär replied
─────────────────────────

  Not exactly what you asked, but if you just want to provide a JS
  version of some C primitive

  ┌────
  │ external foo : unit -> int = "caml_foo"
  └────

  you can do this by writing the following in your `.js' file:

  ┌────
  │ //Provides: caml_foo
  │ function caml_foo() {
  │   return 42;
  │ }
  └────

  Then `js_of_ocaml' will automatically replace calls to the external
  function by a call to its JS implementation.

  This is the same mechanism used by `js_of_ocaml' to implement its own
  JS version of the OCaml runtime, see eg

  <https://github.com/ocsigen/js_of_ocaml/blob/3850a67b1cb00cfd2ee4399cf1e2948062884b92/runtime/bigarray.js#L328-L335>


diskuvbox: small set of cross-platform CLI tools
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-diskuvbox-small-set-of-cross-platform-cli-tools/9663/1>


jbeckford announced
───────────────────

  *TLDR*:
  ┌────
  │ $ opam update
  │ $ opam install diskuvbox
  │ 
  │ $ diskuvbox copy-dir --mode 755 src1/ src2/ dest/
  │ $ diskuvbox copy-file --mode 400 src/a dest/b
  │ $ diskuvbox copy-file-into src1/a src2/b dest/
  │ $ diskuvbox touch-file x/y/z
  │ 
  │ $ diskuvbox find-up . _build
  │ Z:/source/_build
  │ 
  │ $ diskuvbox tree --max-depth 2 --encoding=UTF-8 .
  │ .
  │ ├── CHANGES.md
  │ ├── README.md
  │ ├── _build/
  │ │   ├── default/
  │ │   ├── install/
  │ │   └── log
  └────

  *Problem*: When writing cram tests, Dune rules and Opam build steps,
  often we default to using GNU binaries (`/usr/bin/*') available on
  Linux (ex. `/usr/bin/cp -R'). Unfortunately these commands rarely work
  on Windows, and as a consequence Windows OCaml developers are forced
  to maintain Cygwin or MSYS2 installations to get GNU tooling.

  *Solution*: Provide some of the same functionality for Windows and
  macOS that the GNU binaries in `/usr/bin/*' do in Linux.

  `diskuvbox' is a single binary that today provides an analog for a
  very small number of binaries that I have needed in the Diskuv Windows
  OCaml distribution. It is liberally licensed under Apache v2.0. *With
  your PRs it could emulate much more!*

  `diskuvbox' has CI testing for Windows, macOS and Linux. Usage and
  help are available in the diskuvbox README:
  <https://github.com/diskuv/diskuvbox#diskuv-box>

  *`diskuvbox' also has a OCaml library, but consider the API unstable
   until version 1.0.*

  Alternatives:
  • There are some shell scripting tools like [shexp] and [feather] that
    give you POSIX pipes in OCaml-friendly syntax. I feel these
    complement Diskuv Box.
  • Dune exposes `(copy)' to copy a file in Dune rules; theoretically
    more operations could be added.

  Internally `diskuvbox' is a wrapper on the excellent [bos - Basic OS
  interaction] library.


[shexp] <https://github.com/janestreet/shexp>

[feather] <https://github.com/charlesetc/feather>

[bos - Basic OS interaction]
<https://erratique.ch/software/bos/doc/Bos/index.html>

Acknowledgements
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The first implementations of Diskuv Box were implemented with the
  assistance of the [OCaml Software Foundation (OCSF)], a sub-foundation
  of the [INRIA Foundation].

  Two OCaml libraries ([bos] and [cmdliner]) are essential to Diskuv
  Box; these libraries were created by [Daniel Bünzli] (@dbuenzli) .


[OCaml Software Foundation (OCSF)] <http://ocaml-sf.org>

[INRIA Foundation] <https://www.inria.fr>

[bos] <https://erratique.ch/software/bos>

[cmdliner] <https://erratique.ch/software/cmdliner>

[Daniel Bünzli] <https://erratique.ch/profile>


Examples
╌╌╌╌╌╌╌╌

  The following are examples that have been condensed from the
  [diskuvbox README.md] …


[diskuvbox README.md] <https://github.com/diskuv/diskuvbox#diskuv-box>

Using in Dune cram tests
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  ┌────
  │ $ install -d a/b/c/d/e/f
  │ $ install -d a/b2/c2/d2/e2/f2
  │ $ install -d a/b2/c3/d3/e3/f3
  │ $ install -d a/b2/c3/d4/e4/f4
  │ $ install -d a/b2/c3/d4/e5/f5
  │ $ install -d a/b2/c3/d4/e5/f6
  │ $ touch a/b/x
  │ $ touch a/b/c/y
  │ $ touch a/b/c/d/z
  │ 
  │ $ diskuvbox tree a --max-depth 10 --encoding UTF-8
  │ a
  │ ├── b/
  │ │   ├── c/
  │ │   │   ├── d/
  │ │   │   │   ├── e/
  │ │   │   │   │   └── f/
  │ │   │   │   └── z
  │ │   │   └── y
  │ │   └── x
  │ └── b2/
  │     ├── c2/
  │     │   └── d2/
  │     │       └── e2/
  │     │           └── f2/
  │     └── c3/
  │         ├── d3/
  │         │   └── e3/
  │         │       └── f3/
  │         └── d4/
  │             ├── e4/
  │             │   └── f4/
  │             └── e5/
  │                 ├── f5/
  │                 └── f6/
  └────


Using in Opam `build' steps
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  ┌────
  │ build: [
  │   ["diskuvbox" "copy-file-into" "assets/icon.png" "assets/public.gpg" "%{_:share}%"]
  │ ]
  └────


Using in Dune rules
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  ┌────
  │ (rule
  │  (targets diskuvbox.corrected.ml diskuvbox.corrected.mli)
  │  (deps
  │   (:license %{project_root}/etc/license-header.txt)
  │   (:conf    %{project_root}/etc/headache.conf))
  │  (action
  │   (progn
  │    (run diskuvbox copy-file -m 644 diskuvbox.ml  diskuvbox.corrected.ml)
  │    (run diskuvbox copy-file -m 644 diskuvbox.mli diskuvbox.corrected.mli)
  │    (run headache -h %{license} -c %{conf} %{targets})
  │    (run ocamlformat --inplace --disable-conf-files --enable-outside-detected-project %{targets}))))
  └────


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 25501 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-04-05 11:50 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-04-05 11:50 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 20781 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of March 29 to April
05, 2022.

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

v0.15 release of Jane Street packages
EmelleTV Show - 2022
Open source editor for iOS, iPadOS and macOS
The mysterious pointer in the runtime closure representation
Other OCaml News
Old CWN


v0.15 release of Jane Street packages
═════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-v0-15-release-of-jane-street-packages/9612/1>


Arseniy Alekseyev announced
───────────────────────────

  We are pleased to announce the v0.15 release of Jane Street packages!

  This release comes with 41 new packages, and a large number of fixes
  and enhancements. The documentation for the individual packages will
  soon be available on [v3.ocaml.org/packages], after some technical
  issues are fixed.

  The remainder of this e-mail highlights the main changes since the
  v0.14 release.


[v3.ocaml.org/packages] <https://v3.ocaml.org/packages>

Notable changes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Re-structuring of `Core'.
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  The most noticeable breaking change is the re-structuring of `Core'.

  In 0.14, `Core' is somewhat bloated and includes many modules that are
  barely ever used, many of which are Unix-specific. In 0.15, many of
  those modules moved to separate libraries, most of them to
  package~core_unix~, and `core' is now much smaller and no longer
  contains unix-specific code.

  The mapping between the new libraries and the old modules can be
  summarized by the contents of `Core_compat' library v0.14:

  ┌────
  │ module Command_unix = Core.Command
  │ module Date_unix = Core.Date
  │ module Filename_unix = Core.Filename
  │ module Signal_unix = Core.Signal
  │ module Sys_unix = Core.Sys
  │ module Core_thread = Core.Thread
  │ module Time_unix = Core.Time
  │ module Time_ns_unix = Core.Time_ns
  │ module Core_unix = Core.Unix
  │ module Version_util = Core.Version_util
  │ 
  │ module Interval_lib = struct
  │   module Interval = Core.Interval
  │   module Interval_intf = Core.Interval_intf
  │ end
  │ 
  │ module Time_interface = Core.Time_common
  └────


Async: `Monitor.try_with'
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  `Monitor.try_with' and related functions changed the defaults for
  their `run' and `rest' parameters.  They used to default to
  `~~run:~Schedule ~rest:~Log~', but now they default to `~~run:~Now
  ~rest:~Raise~'.


Many other changes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  There are many changes and additions across 130+ existing packages,
  and unfortunately we don't maintain a changelog to list them all.  The
  code for all of our packages is on our [github], and if you're
  interested in the details of what changed in a particular package, you
  can inspect the diff between branches v0.14 and v0.15.


[github] <https://github.com/janestreet>


New packages
╌╌╌╌╌╌╌╌╌╌╌╌

  [`abstract_algebra']: A small library describing abstract algebra
  concepts

  A library describing abstract algebra concepts. Currently, it includes
  Commutative_group and Vector_space.

  [`async_rpc_websocket']: Library to serve and dispatch Async RPCs over
  websockets

  Library to serve and dispatch Async RPCs over websockets.

  Rpc_websocket makes it easy to serve and send Async RPCs with
  HTTP+Websocket underlying the transport. It also provides a mechanism
  to share the RPC implementations between a vanilla TCP server and a
  HTTP server.

  On the server side, the library detects when a websocket connection is
  established, and routes to an optionally provided vanilla HTTP handler
  when non-websocket traffic occurs.

  [`bigdecimal']: Arbitrary-precision decimal based on Zarith

  A high-precision representation of decimal numbers as [mantissa *
  10^exponent], where the mantissa is internally a [Bigint.t] and the
  exponent is an [int].

  [`cohttp_async_websocket']: Websocket library for use with cohttp and
  async

  Websocket library for use with cohttp and async.

  Cohttp_async_websocket is a full-featured server-side websocket
  implementation, using Async as the concurrency library, and Cohttp for
  HTTP negotiation.

  It implements a large portion of RFC6445. The library has been
  hardened with many applications using it for several year, in
  conjunction with async-js and google-chrome.

  [`cohttp_static_handler']: A library for easily creating a cohttp
  handler for static files

  Single page handlers are handlers that serve user specified JavaScript
     and css files along with a generated index page that loads those
     files.

  [`core_compat']: Compatibility for core 0.14

  Compatibility wrapper to make it possible to have code compatible with
  both Core 0.14 and 0.15.

  [`env_config']: Helper library for retrieving configuration from an
  environment variable

  The Env_config library is a helper for retrieving library and program
  configuration from an environment variable. Its goal is to make it
  easy to override a configuration that is loaded from disk, computed,
  or embedded in a library.

  [`file_path']: A library for typed manipulation of UNIX-style file
  paths

  A library for typed manipulation of UNIX-style file paths.

  [`fuzzy_match']: A library for fuzzy string matching

  A library for fuzzy string matching

  [`fzf']: A library for running the fzf command line tool

  A library for running the fzf command line fuzzy matcher

  [`hardcaml_c']: Hardcaml C Simulation Backend

  A fast C-based simulation backend for Hardcaml circuits.

  The library transparently compiles a Hardcaml Circuit to C code, which
  is in turn compiled and linked into the running executable. The
  generated simulation object can be used like any other cyclesim
  simulation.

  [`hardcaml_circuits']: Hardcaml Circuits

  A small library of useful/interesting Hardcaml circuits.

  [`hardcaml_fixed_point']: Hardcaml fixed point arithmetic

  Signed and Unsigned fixed point operations, with a full complement of
  rounding and overflow functionality.

  [`hardcaml_of_verilog']: Convert Verilog to a Hardcaml design

  The opensource synthesis tool yosys is used to convert a verilog
  design to a JSON based netlist representation. This library can load
  the JSON netlist and build a hardcaml circuit.

  Code can also be generated to wrap the conversion process using
  Hardcaml interfaces.

  [`hardcaml_step_testbench']: Hardcaml Testbench Monad

  A monad for interacting with Hardcaml.Cyclesim based simulations.

  Allows multiple control threads to interact with a simulation module,
  all of which are synchronised to the system clock.

  [`hardcaml_verify']: Hardcaml Verification Tools

  Tools for verifying properties of Hardcaml circuits.

  Combinational circuits can be converted to 'conjunctive normal form'
  for input into SAT solvers via DIMAC files. Support for a few
  opensource solvers is integrated - minisat, picosat, Z3 - just ensure
  they are in your PATH.

  Circuits can also be converted to NuSMV format for advanced bounded
  and unbounded model checking tasks.

  [`hardcaml_verilator']: Hardcaml Verilator Simulation Backend

  Very fast verilator-based simulations of Hardcaml circuits.

  This library transparently compiles a verilator-based shared library,
  and links it back to the running executable to be used as a Cyclesim
  simulation.

  [`hardcaml_xilinx']: Hardcaml wrappers for Xilinx memory primitives

  The Hardcaml_xilinx library provides wrappers for Xilinx specific RAM
  and FIFO primitive blocks. In many cases a simulation model is
  provided.

  The `Synthesis' module implements various arithmetic and logical RTL
  components with Xilinx LUT primitives.

  [`hardcaml_xilinx_components']: Hardcaml Xilinx component definitions

  A tool for reading Xilinx VHDL Unisim and XPM component definitions
  from a Vivado installation and generating Hardcaml interfaces
  automatically.

  [`hex_encode']: Hexadecimal encoding library

  This library implements hexadecimal encoding and decoding

  [`hg_lib']: A library that wraps the Mercurial command line interface

  A library that wraps the Mercurial command line interface.

  [`int_repr']: Integers of various widths

  Integers of various widths.

  [`jsonaf']: A library for parsing, manipulating, and serializing data
  structured as JSON

  A library for parsing, manipulating, and serializing data structured
  as JSON.

  [`krb']: A library for using Kerberos for both Rpc and Tcp
  communication

  Jane Street's library for Kerberizing RPC connections so that
  • the server gets an authenticated principal (i.e. username) with
    every incoming connection, and
  • RPC communication may be encrypted, if necessary.

  [`magic-trace']: Easy Intel Processor Trace Visualizer

  Magic-trace makes it easy to record and visualize Intel Processor
      Trace data for debugging tricky performance issues.

  [`ocaml-embed-file']: Files contents as module constants

  Embed-file takes some files and generates code for an OCaml module
  defining string constants containing the contents of those files.

  [`ocaml_intrinsics']: Intrinsics

  Provides functions to invoke amd64 instructions (such as
       clz,popcnt,rdtsc,rdpmc) when available, or compatible software
       implementation on other targets.

  [`ocaml-probes']: USDT probes for OCaml: command line tool

  A tool for controlling user-space statically-defined tracing probes
  for OCaml.  Experimental.

  [`ppx_css']: A ppx that takes in css strings and produces a module for
  accessing the unique names defined within

  A ppx that takes in css strings and produces a module for accessing
  the unique names defined within.

  [`ppx_disable_unused_warnings']: Expands [@disable_unused_warnings]
  into [@warning \"-20-26-32-33-34-35-36-37-38-39-60-66-67\"]

  Part of the Jane Street's PPX rewriters collection.

  [`ppx_ignore_instrumentation']: Ignore Jane Street specific
  instrumentation extensions

  Ignore Jane Street specific instrumentation extensions from internal
     PPXs or compiler features not yet upstreamed.

  [`ppx_jsonaf_conv']: [@@deriving] plugin to generate Jsonaf conversion
  functions

  Part of the Jane Street's PPX rewriters collection.

  [`ppx_typed_fields']: GADT-based field accessors and utilities

  Part of the Jane Street's PPX rewriters collection.

  [`ppx_type_directed_value']: Get [@@deriving]-style generation of
  type-directed values without writing a ppx

  `Ppx_type_directed_value' is a ppx that does `[@@deriving]'-style
  generation of type-directed values based on user-provided modules. The
  user-provided modules tell `ppx_type_directed_value' how to compose
  type-directed values (for example, combine type-directed values of the
  fields of a record to form a type-directed value for the record
  itself).

  This allows a wide variety of PPXs such as `ppx_sexp_conv',
  `ppx_compare', `ppx_enumerate', etc. to be implemented with
  `ppx_type_directed_value', but with some runtime cost.

  This PPX currently supports deriving type-directed values for records,
  ordinary & polymorphic variants and tuples. It also supports custom
  user-defined attributes on record and variant fields.

  [`profunctor']: A library providing a signature for simple profunctors
  and traversal of a record

  This is a very small library which provides a signature for profunctor
  types and operations which can be used to traverse a record with them
  based on record_builder and the `ppx_fields' syntax extension.

  [`redis-async']: Redis client for Async applications

  A client library for Redis versions 6 and higher.

  Provides a strongly-typed API with transparent (de)serialization for
  application-defined types.

  Supports client tracking and internally uses the RESP3 protocol.

  [`sexp_diff']: Code for computing the diff of two sexps

  The code behind the [diff] subcommand of the Jane Street's [sexp]
  command line tool.

  [`sexp_grammar']: Sexp grammar helpers

  Helpers for manipulating [Sexplib.Sexp_grammar] values.

  [`sexp_string_quickcheck']: Quickcheck helpers for strings parsing to
  sexps

  This library provides quickcheck generators, helpers, and shrinkers
  for quickcheck-based tests that wish to exercise the concrete syntax
  of sexps, including escape sequences and comments.

  [`tracing']: Tracing library

  Utilities for creating and parsing traces in Fuchsia Trace Format.

  [`username_kernel']: An identifier for a user

  A string representation for a user, typically a UNIX username


[`abstract_algebra'] <https://github.com/janestreet/abstract_algebra>

[`async_rpc_websocket']
<https://github.com/janestreet/async_rpc_websocket>

[`bigdecimal'] <https://github.com/janestreet/bigdecimal>

[`cohttp_async_websocket']
<https://github.com/janestreet/cohttp_async_websocket>

[`cohttp_static_handler']
<https://github.com/janestreet/cohttp_static_handler>

[`core_compat'] <https://github.com/janestreet/core_compat>

[`env_config'] <https://github.com/janestreet/env_config>

[`file_path'] <https://github.com/janestreet/file_path>

[`fuzzy_match'] <https://github.com/janestreet/fuzzy_match>

[`fzf'] <https://github.com/janestreet/fzf>

[`hardcaml_c'] <https://github.com/janestreet/hardcaml_c>

[`hardcaml_circuits'] <https://github.com/janestreet/hardcaml_circuits>

[`hardcaml_fixed_point']
<https://github.com/janestreet/hardcaml_fixed_point>

[`hardcaml_of_verilog']
<https://github.com/janestreet/hardcaml_of_verilog>

[`hardcaml_step_testbench']
<https://github.com/janestreet/hardcaml_step_testbench>

[`hardcaml_verify'] <https://github.com/janestreet/hardcaml_verify>

[`hardcaml_verilator']
<https://github.com/janestreet/hardcaml_verilator>

[`hardcaml_xilinx'] <https://github.com/janestreet/hardcaml_xilinx>

[`hardcaml_xilinx_components']
<https://github.com/janestreet/hardcaml_xilinx_components>

[`hex_encode'] <https://github.com/janestreet/hex_encode>

[`hg_lib'] <https://github.com/janestreet/hg_lib>

[`int_repr'] <https://github.com/janestreet/int_repr>

[`jsonaf'] <https://github.com/janestreet/jsonaf>

[`krb'] <https://github.com/janestreet/krb>

[`magic-trace'] <https://github.com/janestreet/magic-trace>

[`ocaml-embed-file'] <https://github.com/janestreet/ocaml-embed-file>

[`ocaml_intrinsics'] <https://github.com/janestreet/ocaml_intrinsics>

[`ocaml-probes'] <https://github.com/janestreet/ocaml-probes>

[`ppx_css'] <https://github.com/janestreet/ppx_css>

[`ppx_disable_unused_warnings']
<https://github.com/janestreet/ppx_disable_unused_warnings>

[`ppx_ignore_instrumentation']
<https://github.com/janestreet/ppx_ignore_instrumentation>

[`ppx_jsonaf_conv'] <https://github.com/janestreet/ppx_jsonaf_conv>

[`ppx_typed_fields'] <https://github.com/janestreet/ppx_typed_fields>

[`ppx_type_directed_value']
<https://github.com/janestreet/ppx_type_directed_value>

[`profunctor'] <https://github.com/janestreet/profunctor>

[`redis-async'] <https://github.com/janestreet/redis-async>

[`sexp_diff'] <https://github.com/janestreet/sexp_diff>

[`sexp_grammar'] <https://github.com/janestreet/sexp_grammar>

[`sexp_string_quickcheck']
<https://github.com/janestreet/sexp_string_quickcheck>

[`tracing'] <https://github.com/janestreet/tracing>

[`username_kernel'] <https://github.com/janestreet/username_kernel>


EmelleTV Show - 2022
════════════════════

  Archive: <https://discuss.ocaml.org/t/emelletv-show-2022/9613/1>


David Sancho announced
──────────────────────

  I'm creating a post as a header from this season of *EmelleTV* in
  2020. Will use this post to share announcements, new shows, gather
  feedback and invite you to watch and follow
  [https://www.twitch.tv/emelletv]!

  For the ones who doesn't know us, It's a streaming show that will
  happen once per month and will try to interview and talk casually
  about OCaml, Reason, ReScript and their communities. Inviting
  interesting engineers and ask silly questions about literally
  anything.

  If can't attend live, we publish the VOD in youtube under
  [https://www.youtube.com/channel/UCvVVfCa7-nzSuCdMKXnNJNQ].  You can
  re-watch some of the 2021 interviews, they were a ton of fun for me.

  It's made by myself and @fakenickels.

  Feel free to share any feedback, propose any guest or make fun of us
  ^^


[https://www.twitch.tv/emelletv] <https://www.twitch.tv/emelletv>

[https://www.youtube.com/channel/UCvVVfCa7-nzSuCdMKXnNJNQ]
<https://www.youtube.com/channel/UCvVVfCa7-nzSuCdMKXnNJNQ>


Open source editor for iOS, iPadOS and macOS
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/open-source-editor-for-ios-ipados-and-macos/7624/21>


Nathan Fallet announced
───────────────────────

  Just released the app on the Play Store for Android: [Play Store]

  Feel free to give your feedback as well. I tried to make it like the
  iOS/macOS version. For now, the only missing feature is syntax
  highlighting, but I'm working on it (I still have a few bugs with it)


[Play Store]
<https://play.google.com/store/apps/details?id=me.nathanfallet.ocaml>


The mysterious pointer in the runtime closure representation
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/the-mysterious-pointer-in-the-runtime-closure-representation/9560/7>


Deep in this thread, Yue Li Picasso announced
─────────────────────────────────────────────

  Thanks for your replies @silene @zozozo !  Due to project interest I
  need to understand the runtime value representation. Now I released a
  little library for displaying runtime values in textual form:
  [OInspect].


[OInspect] <https://github.com/YueLiPicasso/OInspect>


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [MirageOS 4 Released!]
  • [PhD Position at CEA LIST - LSL]
  • [All your metrics belong to influx]
  • [Secure Virtual Messages in a Bottle with SCoP]
  • [Research internships in our Tools and Compilers group]


[OCaml Planet] <http://ocaml.org/community/planet/>

[MirageOS 4 Released!]
<https://tarides.com/blog/2022-03-29-mirageos-4-released>

[PhD Position at CEA LIST - LSL]
<http://frama-c.com/jobs/2022-03-28-machine-learning-for-improving-formal-verification-of-code.html>

[All your metrics belong to influx]
<https://hannes.nqsb.io/Posts/Monitoring>

[Secure Virtual Messages in a Bottle with SCoP]
<https://tarides.com/blog/2022-03-08-secure-virtual-messages-in-a-bottle-with-scop>

[Research internships in our Tools and Compilers group]
<https://blog.janestreet.com/research-internships-tnc/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 33080 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-03-29  7:42 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-03-29  7:42 UTC (permalink / raw)
  To: lwn, cwn, caml-list


[-- Attachment #1.1: Type: text/plain, Size: 25400 bytes --]

Hello

Here is the latest OCaml Weekly News, for the week of March 22 to 29,
2022.

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

pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
Tarides is hiring!
For Diversity and the OCaml Community: Outreachy Summer 2022
Caqti 1.8.0 and related news
First release of prbnmcn-dagger
MirageOS 4.0
OCaml 4.14.0 is released
ocaml-in-python.0.1.0: Effortless Python bindings for OCaml modules
Old CWN


pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-pyml-bindgen-a-cli-app-to-generate-python-bindings-directly-from-ocaml-value-specifications/8786/6>


Ryan Moore announced
────────────────────

New releases
╌╌╌╌╌╌╌╌╌╌╌╌

  Version 0.3.0 and 0.3.1 are now available on [GitHub].  0.3.0 has been
  merged into opam, and a PR for 0.3.1 has been opened.  The [change
  log] has more details about the changes.


[GitHub] <https://github.com/mooreryan/ocaml_python_bindgen/tags>

[change log]
<https://github.com/mooreryan/ocaml_python_bindgen/blob/main/CHANGELOG.md>


Binding tuples
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  You can now bind tuples directly.  Here's a Python function that takes
  two lists of points (where each "point" is a tuple like `(x, y)') and
  adds them together

  ┌────
  │ def add(points1, points2):
  │     return [(x1 + y1, x2 + y2) for (x1, x2), (y1, y2) in zip(points1, points2)]
  └────

  And you could bind it using tuples from the OCaml side as well.

  ┌────
  │ val add : points1:(int * int) list -> points2:(int * int) list -> unit -> (int * int) list
  └────

  Note there are some restrictions regarding tuples, which you can read
  about [here], [here], or [here].


[here] <https://mooreryan.github.io/ocaml_python_bindgen/tuples/>

[here]
<https://github.com/mooreryan/ocaml_python_bindgen/blob/main/examples/README.md>

[here]
<https://github.com/mooreryan/ocaml_python_bindgen/blob/main/CHANGELOG.md#030-2022-03-18>


Attributes
╌╌╌╌╌╌╌╌╌╌

  You can use attributes on value specifications.  Currently the only
  one supported is `py_fun_name', which allows you to decouple the
  Python method name and the generated OCaml function name.

  As an example, take the following Python function, which adds to
  "things".

  ┌────
  │ def add(x, y):
  │     return x + y
  └────

  You could bind multiple OCaml functions to this single function now.

  ┌────
  │ val add_int : x:int -> y:int -> unit -> int
  │ [@@py_fun_name add]
  │ 
  │ val add_float : x:float -> y:float -> unit -> float
  │ [@@py_fun_name add]
  │ 
  │ val add_string : x:string -> y:string -> unit -> string
  │ [@@py_fun_name add]
  └────


Python magic methods
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  This is also nice for binding Python [magic methods]. For example, you
  don't have to use `__init__' as the name of the OCaml function you use
  to make instances of a Python class.  You can bind it to a more
  natural name like `create' or `make'.

  ┌────
  │ val create : name:string -> age:int -> unit -> t
  │ [@@py_fun_name __init__]
  └────


[magic methods]
<https://docs.python.org/3/reference/datamodel.html#specialnames>


Using Pytypes.pyobject directly
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Sometimes you may not want to bother converting Python types to normal
  OCaml types at all.  You can do that now in value specifications by
  using the `Pytypes.pyobject' and `Py.Object.t' types directly.


Fewer dependencies
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  `re' is now used instead of `re2', which drops the number of
  dependencies that need to be installed by about half.  Additionally,
  `core', `core_bench', and `bisect_ppx' don't need to be installed if
  you want to install `pyml_bindgen' directly from the git repository,
  which greatly cuts the required dependencies in this case.

  Thanks again to UnixJunkie for spurring many of these updates!


Tarides is hiring!
══════════════════

  Archive: <https://discuss.ocaml.org/t/tarides-is-hiring/9553/1>


Thomas Gazagnaire announced
───────────────────────────

  Following the recent announcement about Tarides (joining forces with
  [OCaml Labs] and [Segfault System]), we are now looking to expand our
  team with experienced software engineers, compassionate team leads and
  experts in software consulting services. Our ambition is to bring
  OCaml to a vast set of new developers and industries. We want to make
  developers more productive by spending less time on fixing bugs and
  more on writing new features. And we want the software industry to
  build more robust and performant systems that can last for decades.

  We are looking for:

  • Experienced [Software Engineer(s)] to take part in the development
    of Irmin. You will be part of the team that designs, builds and
    ships Irmin libraries and applications to our community and
    customers.
  • [Team Lead(s)] who cares about motivating their team members,
    supporting their growth and development and successfully delivering
    the team's objectives on time.
  • A [Head of Consulting Services] to diversify our technical teams and
    commercial services portfolio. You'll be the first hire for this
    brand new department and will have the opportunity to help us build
    our services structure from scratch, including our strategy,
    processes, tools, and team.

  We are always looking for great OCaml enthusiasts to join our team, so
  even if these job descriptions do not fit your profile precisely, you
  are welcome to send us [a spontaneous application]!


[OCaml Labs]
<https://tarides.com/blog/2022-01-27-ocaml-labs-joins-tarides>

[Segfault System]
<https://tarides.com/blog/2022-03-01-segfault-systems-joins-tarides>

[Software Engineer(s)]
<https://tarides.com/jobs/senior-software-engineer>

[Team Lead(s)] <https://tarides.com/jobs/team-lead-engineering>

[Head of Consulting Services]
<https://tarides.com/jobs/head-of-consulting-services>

[a spontaneous application]
<https://tarides.com/jobs/spontaneous-application>


For Diversity and the OCaml Community: Outreachy Summer 2022
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/for-diversity-and-the-ocaml-community-outreachy-summer-2022/9234/6>


Deep in this thread, Aya announced
──────────────────────────────────

  @pitag and I have resubmitted the PPX derivers project for this Summer
  2022 round: *Expand OCaml's library of standard derivers*! This is the
  same project I was the intern for this past Winter 2022 round, where
  the goal is to build up a [standard derivers] library, like
  `ppx_deriving', using the updated `ppxlib' API.

  I'm excited to be supporting @pitag with mentoring, and for the
  opportunity to stay involved now that my internship has ended :smiley:


[standard derivers] <https://github.com/ocaml-ppx/standard_derivers>


Caqti 1.8.0 and related news
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-caqti-1-8-0-and-related-news/9561/1>


"Petter A. Urkedal announced
────────────────────────────

  I am happy to announce the second release of [Caqti] this year. The
  reason for the quick succession is partly an adjustment to the [new
  API for request construction] and partly that [matchable error
  conditions] did not make it into the previous release.  You can see
  the full release notes below.

  I would also like to thank [OCaml Software Foundation] for sponsoring
  my efforts on the Caqti project this year, also including most of the
  work that went into the previous release.

  One [feature in progress] is a new driver based on the pure-OCaml
  [pgx] which should make it possible, with some additional changes to
  the way drivers are loaded, to target MirageOS. I am note sure if this
  can be done in a minor release or will require a Caqti 2 branch.


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

[new API for request construction]
<https://paurkedal.github.io/ocaml-caqti/caqti/Caqti_request/Infix/index.html>

[matchable error conditions]
<https://github.com/paurkedal/ocaml-caqti/issues/72>

[OCaml Software Foundation] <https://ocaml-sf.org>

[feature in progress]
<https://github.com/paurkedal/ocaml-caqti/issues/38>

[pgx] <https://github.com/arenadotio/pgx>

Release Notes
╌╌╌╌╌╌╌╌╌╌╌╌╌

  New features:

  • A matchable representation of common causes of errors on the
    database side is now available, with limitations.  It focuses on
    conditions which seem most likely useful to handle.  At the moment
    we lack extended error codes from SQLite3 needed to make the cause
    fully precise.

  • Expose the underlying error details from database client libraries.
    This is meant to be use as a last resort, and requires directly
    linking with the relevant drivers.

  • A second set of request construction operators `->.', `->?', `->!',
    and `->*' were introduced after experience with converting existing
    code.  Given the parameter and result type they return a function
    which constructs a request directly from a query string.  Avoiding
    the need to compose with `@:-' simplifies local opens and usage with
    `List.map' etc.

  • Environment variables are now expanded in the debug log when using
    the new request constructors introduced in 1.7.0.

  • A new `?tweaks_version' connection parameter has been added to
    control when the client is ready to adapt to changes in database
    session parameters or other adjustments of the interaction with
    specific database systems. [[More details available in the
    documentation.]]

  • Enable foreign key constraint checks for SQLite3 starting at tweaks
    version 1.7.

  Fixes:

  • Fixed debug logging to pass the correct driver info to the query
    callback instead of a dummy driver info which would cause a failure
    if unsupported.

  Deprecations:

  • The `-->' operator was renamed to `-->!', with a deprecated alias,
    for consistency with the new `->!' operator.

  • The old convenience interface for creating requests has been
    deprecated in favour of the new infix operators and the new query
    template parser.

  • Documented-only deprecations of `Caqti_sql_io', `Caqti_lwt_sql_io',
    and `Caqti_async_sql_io' have been annotated.


[More details available in the documentation.]
<https://paurkedal.github.io/ocaml-caqti/caqti/tweaks.html>


First release of prbnmcn-dagger
═══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-release-of-prbnmcn-dagger/9311/2>


Igarnier announced
──────────────────

  I'm proud to announce the release of version 0.0.2 of
  [prbnmcn-dagger].

  This version adds Sequential Monte-Carlo, a.k.a. [particle
  filters]-based inference to the library.

  Here's the full changelog:
  • Dependency: `prbnmcn-stats.0.0.3' -> `prbnmcn-stats.0.0.4'
  • Add beta distribution to Gsl samplers
  • Refactor Cps monad
  • Add SMC inference
  • Simplify handler type, modularize effect definitions away from
    Cps_monad
  • Fix typo: bernouilli -> bernoulli (report by @nilsbecker)

  I also wrote the following article: [Applying Sequential Monte-Carlo
  to time series forecasting] It contains some use cases for the
  library, I hope some find it fun :)

  To conclude this post, and as a partial answer to @gasche 's
  [question] in an older thread, I believe that unlike some other
  inference techniques, single-shot continuations are enough to
  implement SMC. Without getting into the details, the implementation is
  very reminiscent of that of lightweight threading libraries. I look
  forward to experiment with a fibre-based implementation!


[prbnmcn-dagger] <https://github.com/igarnier/prbnmcn-dagger>

[particle filters] <https://en.wikipedia.org/wiki/Particle_filter>

[Applying Sequential Monte-Carlo to time series forecasting]
<http://probanomicon.xyz/blog/wind_power_forecast.html>

[question]
<https://discuss.ocaml.org/t/multi-shot-continuations-gone-forever/9072/5>


MirageOS 4.0
════════════

  Archive: <https://discuss.ocaml.org/t/ann-mirageos-4-0/9598/1>


Thomas Gazagnaire announced
───────────────────────────

  *On behalf of the MirageOS team, I am delighted to announce the
  release of MirageOS 4.0.0!* I'd like to send special thanks to
  @dinosaure and @Lortex who drove that release forward for multiple
  years.

  Since the first release of 2013, MirageOS has made steady progress
  toward deploying a self-managed internet infrastructure. The project’s
  initial aim was to self-host as many services as possible aimed at
  empowering internet users to securely deploy infrastructure to own
  their data and take back control of their privacy. MirageOS can
  securely deploy [static website hosting] with “Let’s Encrypt”
  certificate provisioning and a [secure SMTPstack] with security
  extensions. MirageOS can also deploy decentralised communication
  infrastructure like [Matrix], [OpenVPN servers], and [TLS tunnels] to
  ensure data privacy or [DNS(SEC) servers] for better authentication.

  The protocol ecosystem now contains [hundreds of libraries] and
  services millions of daily users. Over these years, major commercial
  users have joined the projects. They rely on MirageOS libraries to
  keep their products secure. For instance, the MirageOS networking code
  powers [Docker Desktop’s VPNKit], which serves the traffic of millions
  of containers daily. [Citrix Hypervisor] uses MirageOS to interact
  with Xen, the hypervisor that powers most of today’s public
  cloud. [Nitrokey] is developing a new hardware security module based
  on MirageOS. [Robur] develops a unikernel orchestration system for
  fleets of MirageOS unikernels. [Tarides] uses MirageOS to improve the
  [Tezos] blockchain, and [Hyper] uses MirageOS to build sensor
  analytics and an automation platform for sustainable agriculture.

  In the coming weeks, our blog will feature in-depth technical content
  for the new features that MirageOS brings, as well as a tour of the
  existing community and commercial users of MirageOS. Please reach out
  if you’d like to tell us about your story.


[static website hosting] <https://github.com/roburio/unipi>

[secure SMTPstack] <https://github.com/mirage/ptt>

[Matrix] <https://github.com/mirage/ocaml-matrix>

[OpenVPN servers] <https://github.com/roburio/openvpn>

[TLS tunnels] <https://github.com/roburio/tlstunnel>

[DNS(SEC) servers] <https://github.com/mirage/ocaml-dns>

[hundreds of libraries] <https://github.com/mirage/>

[Docker Desktop’s VPNKit]
<https://www.docker.com/blog/how-docker-desktop-networking-works-under-the-hood/>

[Citrix Hypervisor]
<https://www.citrix.com/fr-fr/products/citrix-hypervisor/>

[Nitrokey] <https://www.nitrokey.com/products/nethsm>

[Robur] <https://robur.io/>

[Tarides] <https://tarides.com/>

[Tezos] <https://tezos.com/>

[Hyper] <https://hyper.ag/>

Install MirageOS 4
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The easiest way to install MirageOS 4 is by using the opam version 2.1
  and `ocaml>=4.12.1`. Follow the [installation guide] for more details.

  ┌────
  │ $ opam update
  │ $ opam install 'mirage>4'
  └────

  /Note/: if you upgrade from MirageOS 3 you will need to manually clean
  the previous generated files (or call `mirage clean' before
  upgrading). You would also want to read [the full list of API
  changes].  You can see unikernel examples in [mirage/mirage-skeleton],
  [roburio/unikernels] or [tarides/unikernels].


[installation guide] <https://mirage.io/docs/install>

[the full list of API changes] <https://mirage.io/docs/breaking-changes>

[mirage/mirage-skeleton] <https://github.com/mirage/mirage-skeleton>

[roburio/unikernels] <https://github.com/roburio/unikernels>

[tarides/unikernels] <https://github.com/tarides/unikernels>


About MirageOS
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  MirageOS is a library operating system that constructs unikernels for
  secure, high-performance, low-energy footprint applications across
  various hypervisor and embedded platforms. It is available as an
  open-source project created and maintained by the [MirageOS Core
  Team]. A unikernel can be customised based on the target architecture
  by picking the relevant MirageOS libraries and compiling them into a
  standalone operating system, which contains strictly the functionality
  necessary for the target. This minimises the unikernel’s footprint,
  increasing the security of the deployed operating system.

  The MirageOS architecture can be divided into operating system
  libraries, typed signatures, and a metaprogramming compiler. The
  operating system libraries implement various functionalities, ranging
  from low-level network card drivers, to full reimplementations of the
  TLS protocol, as well as the Git protocol to store versioned data. A
  set of typed signatures ensures that the OS libraries are consistent
  and work well in conjunction with each other. Most importantly,
  MirageOS is also a metaprogramming compiler that can input OCaml
  source code along with its dependencies, and a deployment target
  description in order to generate an executable unikernel, i.e., a
  specialised binary artefact containing only the code needed to run on
  the target platform. Overall, MirageOS focuses on providing a small,
  well-defined, typed interface with the system components of the target
  architecture.

  Read the full announcement on [mirage.io's blog].


[MirageOS Core Team] <https://github.com/orgs/mirage/teams/core/members>

[mirage.io's blog] <https://mirage.io/blog/announcing-mirage-40>


Anil Madhavapeddy then added
────────────────────────────

  For those curious about what some of the MirageOS libraries _are_,
  there is a raw Yaml list over at [mirage/mirage-repositories] listing
  most of them.  Conversion of this Yaml to HTML for the main mirage.io
  website would be a welcome contribution! :slight_smile:


[mirage/mirage-repositories]
<https://github.com/mirage/mirage-repositories/blob/main/repos.yml>


OCaml 4.14.0 is released
════════════════════════

  Archive: <https://discuss.ocaml.org/t/ocaml-4-14-0-is-released/9600/1>


octachron announced
───────────────────

  The OCaml team has the pleasure of celebrating the birthday of
  Alexander Grothendieck by announcing the release of OCaml version
  4.14.0.

  Some of the highlights in the 4.14.0 release are:

  • Integrated support for "go to definitions" in Merlin.
  • Standard library: new modules `In_channel' and `Out_channel', many
    new functions in Seq module, UTF decoding and validation support for
    strings and bytes.
  • Runtime optimisation: GC prefetching. Benchmarks show a speedup of
    around 20% in GC-heavy programs.
  • Improved error messages in particular for module-level error.
  • Deprecated functions and modules in preparation for OCaml 5.  In
    particular, the Stream and Genlex modules are now deprecated.
  • Type variables can be explicitly introduced in value and variant
    constructor declarations. For instance,
    ┌────
    │ val fold: ('acc -> 'elt -> 'acc) -> 'acc -> 'elt list -> 'acc
    │ type showable = Show: 'a * ('a -> string) -> showable
    └────
    can now be written as
    ┌────
    │ val fold: 'acc 'elt. ('acc -> 'elt -> 'acc) -> 'acc -> 'elt list -> 'acc
    │ type showable = Show: 'a. 'a * ('a -> string) -> showable
    └────
  • Tail-call with up to 64 arguments are now guaranteed to be optimized
    for all architectures.
  • Experimental tail modulo cons (TMC) transformation

  The full list of changes can be found in the changelog
  below. (/editor’s note: please follow the archive link for the full
  changelog/)

  Those releases are available as OPAM switches, and as a source
  download here:

  • <https://github.com/ocaml/ocaml/archive/4.14.0.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0.tar.gz>


ocaml-in-python.0.1.0: Effortless Python bindings for OCaml modules
═══════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-in-python-0-1-0-effortless-python-bindings-for-ocaml-modules/9603/1>


Thierry Martinez announced
──────────────────────────

  I am happy to announce the first release of `ocaml-in-python': this is
  a Python package that exposes all OCaml modules as Python libraries,
  generating bindings on the fly. This can be seen as a dual of
  [`pyml_bindgen']: `pyml_bindgen' binds Python libraries in OCaml,
  while `ocaml-in-python' binds OCaml modules in Python.

  It is available from [GitHub] or *via* `opam': `opam install
  ocaml-in-python'

  Requirements: `OCaml' >= 4.13, `Python' >= 3.7.

  Once installed *via* `opam', the package should be registered in the
  Python environment:

  • either by registering the package with `pip' using the following
    command (requires Python >=3.8):
    ┌────
    │ pip install --editable "`opam var ocaml-in-python:lib`"
    └────
  • or by adding the following definition to the environment:
    ┌────
    │ export PYTHONPATH="`opam var share`/python/:$PYTHONPATH"
    └────

  Then, we can `import ocaml' in Python and use OCaml modules:
  ┌────
  │ Python 3.10.0 (default, Nov 10 2021, 19:16:14) [GCC 7.5.0] on linux
  │ Type "help", "copyright", "credits" or "license" for more information.
  │ >>> import ocaml
  │ >>> print(ocaml.List.map((lambda x : x + 1), [1, 2, 3]))
  │ [2;3;4]
  └────

  We can for instance compile an OCaml module on the fly from Python.
  ┌────
  │ >>> m = ocaml.compile('let hello x = Printf.printf "Hello, %s!\n%!" x')
  │ >>> m.hello('world')
  │ Hello, world!
  └────

  And we can require and use packages /via/ `findlib'.
  ┌────
  │ >>> ocaml.require("parmap")
  │ >>> from ocaml import Parmap
  │ >>> print(Parmap.parmap(
  │ ...   (lambda x : x + 1), Parmap.A([1, 2, 3]), ncores=2))
  │ [2;3;4]
  └────

  Details about the conversions are given in [`README.md'].

  Happy hacking!


[`pyml_bindgen']
<https://discuss.ocaml.org/t/ann-pyml-bindgen-a-cli-app-to-generate-python-bindings-directly-from-ocaml-value-specifications/8786>

[GitHub] <https://github.com/thierry-martinez/ocaml-in-python>

[`README.md']
<https://github.com/thierry-martinez/ocaml-in-python/blob/main/README.md>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


[-- Attachment #1.2: Type: text/html, Size: 40773 bytes --]

[-- Attachment #2: Type: text/plain, Size: 119 bytes --]

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-03-22 13:01 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-03-22 13:01 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of March 15 to 22,
2022.

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

Friday 03/04 Intern presentations – open attendance!
Multicore OCaml: February 2022
OCaml 4.14.0, second release candidate
For Diversity and the OCaml Community: Outreachy Summer 2022
Understanding cancellation (in eio)
Atdpy: derive safe JSON interfaces for Python
Old CWN


Friday 03/04 Intern presentations – open attendance!
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/friday-03-04-intern-presentations-open-attendance/9429/8>


Continuing this thread, Aya announced
─────────────────────────────────────

  [Here is the link] to the video recording of the presentations! Thanks
  again to everyone who attended :pray: :tada:


[Here is the link]
<https://watch.ocaml.org/videos/watch/f3829e4b-e2cd-443e-8502-f406e893fe5f>


Multicore OCaml: February 2022
══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/multicore-ocaml-february-2022/9522/1>


Anil Madhavapeddy announced
───────────────────────────

  Welcome to the February 2022 [Multicore OCaml] monthly report! As with
  [previous updates], these have been compiled by me, @ctk21, @kayceesrk
  and @shakthimaan.

  Progress towards a stable OCaml 5.0.0 release have been moving forward
  at full steam, with most of the multicore OCaml work now happening
  directly within the main ocaml/ocaml repository. As a number of
  [deprecations] have happened in OCaml 5.0+trunk, it can be a little
  tricky in the immediate term to get a working development environment.
  You may find these resources helpful:
  • There is a [multicore monorepo] which is a 'fast clone and dune
    build' with a number of ecosystem libraries. (thanks @patricoferris)
  • There is an [alpha-opam-repository] which contains work-in-progress
    packages.  If a package you maintain is in there, now would be a
    good time to start releasing it to the mainline opam-repository.
    Remember that while we can propose changes, only the community
    maintainers of the relevant projects can do the actual release, so
    *your help with making OCaml 5.0-compatible releases of your
    projects would be very much appreciated*. (thanks @kit-ty-kate)

  For mainline development, the [compiler development newsletter] has an
  overview of what's been happening in the compiler.  From a multicore
  perspective:
  • the [ARM64 PR] has been merged, so your shiny Mac M1s will now work
  • we continue to work on the post-Multicore merge tasks for an
    upcoming 5.0.0+trunk release. The documentation efforts on the OCaml
    memory model, runtime system, and STW synchronization have also
    started.
  • The [eio project] is actively being developed which now includes UDP
    support with Eio's networking interface.  There has been [robust
    discussion] on several aspects of eio which is all influencing the
    next iteration of its design (thank you to everyone!). For those of
    you who do not wish to participate in public discussion, feel free
    to get in touch with me or @kayceesrk for a private discussion,
    particularly if you have a large OCaml codebase and opinions on
    concurrency. We'll summarise all these discussions as best we can
    over the coming months.
  • `Sandmark-nightly' and `Sandmark' have a custom variant support
    feature to build trunk, developer branches, or a specific commit to
    assess any performance regressions. The backend tooling with UI
    enhancements continue to drive the `current-bench' project forward.

  As always, the Multicore OCaml updates are listed first, which are
  then followed by the ecosystem tooling updates.  Finally, the
  sandmark, sandmark-nightly and current-bench project tasks are
  mentioned for your reference.

  /Editor’s note: please find the full update at the archive link
  above./


[Multicore OCaml] <https://github.com/ocaml-multicore/ocaml-multicore>

[previous updates] <https://discuss.ocaml.org/tag/multicore-monthly>

[deprecations] <https://github.com/ocaml/ocaml/blob/trunk/Changes>

[multicore monorepo]
<https://discuss.ocaml.org/t/awesome-multicore-ocaml-and-multicore-monorepo/9515>

[alpha-opam-repository]
<https://github.com/kit-ty-kate/opam-alpha-repository/tree/master/packages>

[compiler development newsletter]
<https://discuss.ocaml.org/t/ocaml-compiler-development-newsletter-issue-5-november-2021-to-february-2022/9459>

[ARM64 PR] <https://github.com/ocaml/ocaml/pulls/10972>

[eio project] <https://github.com/ocaml-multicore/eio>

[robust discussion] <https://discuss.ocaml.org/tag/effects>


OCaml 4.14.0, second release candidate
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-14-0-second-release-candidate/9528/1>


octachron announced
───────────────────

  The release of OCaml 4.14.0 is imminent.  As a last test that
  everything is in order, we are publishing a second release candidate
  for OCaml 4.14.0.

  We are directly jumping to the second release candidate due to a type
  system regression discovered during the release process of the first
  release candidate.

  Compared to the last beta, this release candidate includes a
  regression fix when typing recursive constraints, two backend fixes
  (one for the frame-pointer mode and the other one for the RISC-V
  architecture), one configuration fix for musl/arm64, and the manual
  chapter for the TMC transformation.

  If you find any bugs, please report them here:

  <https://github.com/ocaml/ocaml/issues>

  The full release of OCaml 4.14.0 is currently planned for next week.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands
  ┌────
  │ opam update
  │ opam switch create 4.14.0~rc2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.14.0~rc2+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  where `<option_list>' is a comma separated list of `ocaml-option-*'
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 4.14.0~rc2+flambda+nffa
  │ --packages=ocaml-variants.4.14.0~rc2+options,ocaml-option-flambda,ocaml-option-no-flat-float-array
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  All available options can be listed with `opam search ocaml-option'.

  The source code for the release candidate is also available at these
  addresses:

  • <https://github.com/ocaml/ocaml/archive/4.14.0-rc2.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~rc2.tar.gz>


Changes since the last beta
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

Type system regression fix
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#11101], [#11109]: A recursive type constraint fails on 4.14
    (Jacques Garrigue, report and review by Florian Angeletti)


[#11101] <https://github.com/ocaml/ocaml/issues/11101>

[#11109] <https://github.com/ocaml/ocaml/issues/11109>


Backend fixes
┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#10688]: Move frame descriptor table from `rodata` to `data`
    section on RISC-V.  Improves support for building DLLs and PIEs. In
    particular, this applies to all binaries in distributions that build
    PIEs by default (eg Gentoo and Alpine). (Alex Fan, review by Gabriel
    Scherer)

  • [#11031]: Exception handlers restore the rbp register when using
    frame-pointers on amd64. (Fabrice Buoro, with help from Stephen
    Dolan, Tom Kelly and Mark Shinwell, review by Xavier Leroy)


[#10688] <https://github.com/ocaml/ocaml/issues/10688>

[#11031] <https://github.com/ocaml/ocaml/issues/11031>


Configuration fix
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [#11025], [#11036]: Do not pass -no-pie to the C compiler on
    musl/arm64 (omni, Kate Deplaix and Antonio Nuno Monteiro, review by
    Xavier Leroy)


[#11025] <https://github.com/ocaml/ocaml/issues/11025>

[#11036] <https://github.com/ocaml/ocaml/issues/11036>


Documentation
┄┄┄┄┄┄┄┄┄┄┄┄┄

  • *updated entry* [#181], [#9760], +[#10740]: opt-in tail-modulo-cons
     (TMC) transformation
    ┌────
    │ let[@tail_mod_cons] rec map f li = ...
    └────
    (Frédéric Bour, Gabriel Scherer, Basile Clément, review by Basile
    Clément and Pierre Chambart, tested by Konstantin Romanov)


[#181] <https://github.com/ocaml/ocaml/issues/181>

[#9760] <https://github.com/ocaml/ocaml/issues/9760>

[#10740] <https://github.com/ocaml/ocaml/issues/10740>


For Diversity and the OCaml Community: Outreachy Summer 2022
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/for-diversity-and-the-ocaml-community-outreachy-summer-2022/9234/5>


Continuing this thread, Patrick Ferris said
───────────────────────────────────────────

  Thanks for the updates @pitag! For this summer's round I'll be
  mentoring a project to [Extend ocaml-geojson to support TopoJSON]
  which will likely be a separate package.  This is part of a larger
  effort I'm embarking on to provide better [geospatial libraries and
  tools in OCaml]!

  I'd be very happy to have a co-mentor if the project (or just the idea
  of Outreachy) interests anyone. Don't hesitate to reach out to me on
  discuss publicly or privately if you are interested or have more
  questions :camel:


[Extend ocaml-geojson to support TopoJSON]
<https://www.outreachy.org/apply/project-selection/#ocaml>

[geospatial libraries and tools in OCaml] <https://github.com/geocaml>


Understanding cancellation (in eio)
═══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/understanding-cancellation-in-eio/9369/45>


Deep in this thread, Simon Cruanes announced
────────────────────────────────────────────

  I still have reservations about the capabilities aspect of Eio, but
  the structured concurrency part looks very nice.  Just a few notes,
  for future reference to readers of this thread (if I haven't missed
  them being posted above already):

  Another interesting post about structured concurrency and
  cancellation: <https://250bpm.com/blog:71/>

  A structured concurrency library in python: [trio], which might be
  relatively similar to Eio's switches in concept (esp since @talex
  linked [this])?

  Companion post to the trio blogpost:
  <https://vorpus.org/blog/timeouts-and-cancellation-for-humans/> which
  is directly relevant to the current topic.


[trio] <https://trio.readthedocs.io/en/stable/index.html>

[this]
<https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/>


Atdpy: derive safe JSON interfaces for Python
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/atdpy-derive-safe-json-interfaces-for-python/9544/1>


Martin Jambon announced
───────────────────────

  On behalf of the ATD team, I'd like to announce atdpy, which is part
  of the release 2.3.x of the ATD tools. For now, the best installation
  method with via opam:

  ┌────
  │ $ opam install atdpy
  └────

  Atdpy is a new backend for [ATD]. It takes a collection of type
  definitions and derives Python classes with mypy type annotations that
  validate the JSON data.

  A [short introduction] is included in the documentation.

  Use cases:
  • Safe communication with another program that also uses an ATD
    interface. Other supported languages are OCaml (including
    Bucklescript), Java, and Scala.
  • Need for [mostly] type-safe Python methods via mypy.
  • Need for a good Python API to communicate with an OCaml executable
    or service.
  • Need for sum types (variants, algebraic data types, tagged
    unions). ATD sum types are ordinary types that include pure enums.

  Atdpy was developed as part of our work on [Semgrep] at [r2c]. Many
  thanks to @mseri for his massive help during the opam release of the 7
  ATD packages, and to the Ahrefs folks and @Khady in particular for
  supporting the project.


[ATD] <https://github.com/ahrefs/atd>

[short introduction] <https://atd.readthedocs.io/en/latest/atdpy.html>

[Semgrep] <https://semgrep.dev/>

[r2c] <https://r2c.dev/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-03-15  9:59 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-03-15  9:59 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of March 08 to 15,
2022.

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

Robur Reproducible Builds
OCaml TeXmacs plugin
Release of ocaml-sf/learn-ocaml:0.14.0
Tutorial: Roguelike with effect handlers
Awesome Multicore OCaml and Multicore Monorepo
ppx_viewpattern initial release
Old CWN


Robur Reproducible Builds
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-robur-reproducible-builds/8827/6>


Continuing this thread, Hannes Mehnert announced
────────────────────────────────────────────────

  The background article by @rand is now online
  <https://r7p5.earth/blog/2022-3-7/Builder-web%20visualizations%20at%20Robur>


OCaml TeXmacs plugin
════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-03/msg00009.html>


Nicolas Ratier announced
────────────────────────

  I made a basic OCaml plugin for TeXmacs (<http://www.texmacs.org>) I
  would like to keep it simple, but comments and improvements are
  welcome.
  <http://forum.texmacs.cn/t/ocaml-a-basic-ocaml-plugin-for-texmacs/813>


Release of ocaml-sf/learn-ocaml:0.14.0
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-ocaml-sf-learn-ocaml-0-14-0/9491/1>


Yurug announced
───────────────

  We are very pleased to announce the latest stable release of
  [Learn-OCaml], version `0.14.0'.

  Many thanks to all users and developers who reported bugs, contributed
  features, or patches! Special thanks to @erikmd who made many of the
  changes included in this release.

  A (mostly) comprehensive list of the features, fixes, and enhancements
  offered by this release is available in [the Release Notes ].

  A brief and incomplete summary of the changes:

  • A long-standing bug has been fixed. This bug was triggered when the
    user opened several sessions: the auto-sync mechanism could lead to
    overwriting the student's code with an older version.

  • The release assets now include a zip file containing the contents of
    the `www` directory. This eases the usage of the distributed
    binaries.

  If need be, feel free to open issues in the [Learn-OCaml bug tracker]
  or the [learn-ocaml.el bug tracker], or post in this thread to share
  thoughts or experience-feedback.

  Happy OCaml learning and teaching!


[Learn-OCaml] <https://github.com/ocaml-sf/learn-ocaml>

[the Release Notes ]
<https://github.com/ocaml-sf/learn-ocaml/releases/tag/v0.14.0>

[Learn-OCaml bug tracker]
<https://github.com/ocaml-sf/learn-ocaml/issues>

[learn-ocaml.el bug tracker]
<https://github.com/pfitaxel/learn-ocaml.el/issues>


Tutorial: Roguelike with effect handlers
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/tutorial-roguelike-with-effect-handlers/9422/18>


Continuing this thread, stw said
────────────────────────────────

  Sorry about the late reply, I was busy actually verifying that my
  concept works out. Thankfully it does :smile:

  The UI framework is inspired by [Concur] which means that every widget
  listens for some set of events and suspends computation until one of
  these events occurs. Once it does, it continues execution until it
  encounter the next await at which point it will suspend once
  more. Once a widget has fulfilled its purpose it terminates with some
  return value (e.g. text input is confirmed with enter -> return with a
  string).  Complex UIs are then built by composing simpler widgets. A
  more detailed explanation can be found in the link above.

  I've implemented this concept using an await function that takes a
  list of triggers and a handler for each possible event:
  ┌────
  │ effect Await : Event.t list -> Event.t
  │ let rec await triggers handler =
  │   handler (EffectHandlers.perform (Await triggers))
  │ 
  │ let rec check_box checked  =
  │   (* display check box *)
  │   ...;
  │   await [Mouse_press; Key_press] (function
  │   | Mouse_press ->
  │     print_endline "I've been (un-)checked!";
  │     check_box (not checked)
  │   | Key_press -> (* Terminate if any key is pressed *) checked)
  └────

  Every widget can then be implemented as a function which displays the
  widget and performs an `Await triggers' which is resumed by passing an
  event from `triggers', for example the check box above.

  The most complex widget I've implemented so far is a single line text
  input. It can be clicked or selected with tab.  Moving the mouse while
  holding the button down changes the selection. As an automaton:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/5/574e164b6189608283de32d9f375534ca80caffa.png>

  Obviously, this is not a directed acyclic graph and therefore not a
  perfect fit for the implicit state stored in the
  continuation. Specifically, `Pressed' has an edge to one of its
  multiple parents. We can extract the `Pressed' state into its own
  function and therefore avoid this issue by 'duplicating' this
  state. Now `Pressed' no longer has multiple parents:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/7/70a34d2f4bb81800a5e3b12b8e49147a0d80ece4.png>

  Some cycles remain and we can't remove them because they are essential
  to the functionality. Instead we throw an `exception Repeat' that
  returns us to a parent node (explicitly shown for Focused -> Pressed
  -> Released -> Focused).  To do that we modify `await':
  ┌────
  │ let rec await triggers handler =
  │   try handler (EffectHandlers.perform (Await triggers)) with
  │   | Repeat -> await triggers handler
  └────
  In the end this results in this main method for the text input, with
  only minor simplifications:
  ┌────
  │ method execute =
  │   (* Represent the Pressed state.
  │      We await the Mouse_release and handle Mouse_motion while we wait. *)
  │   let pressed (x,_) =
  │     selection <- Point x;
  │     await [`Mouse_release; `Mouse_motion] @@ function
  │     | `Mouse_release (_, LMB) ->
  │       ()
  │     | `Mouse_motion (x,_) ->
  │       self#select x;
  │       raise Repeat (* This restarts the await function *)
  │     | _ ->
  │       raise Repeat
  │   in
  │ 
  │   (* We start in the Unfocused state *)
  │   begin
  │     await [`Mouse_press; `Key_press] @@ function
  │     | `Mouse_press (pos, LMB) ->
  │        (* We have registered the press, but only when it is released
  │ 	  will we be focused. *)
  │        pressed pos
  │     | `Key_press Tab ->
  │       selection <- Area (0, List.length keys)
  │     | _ -> raise Repeat
  │   end;
  │ 
  │   (* We move into the Focused state *)
  │   begin
  │     await [`Codepoint; `Key_press; `Mouse_press] @@ function
  │     | `Key_press Tab | `Key_press Return ->
  │       () (* The only path without raising Repeat.
  │ 	    Therefore we only leave this await when a tab or return occurs *)
  │     | `Mouse_press (pos, LMB) ->
  │       pressed pos;
  │       raise Repeat
  │     | `Key_press c ->
  │       self#insert c;
  │       raise Repeat
  │     | _ -> raise Repeat
  │   end;
  │   (* We have reached the finished state. We can now return the entered text. *)
  │   self#text
  └────
  I think that this method captures the automaton above quite nicely and
  can be relatively easily understood (hopefully even when one is
  unfamiliar with the framework and accepts that some magic is happening
  in the background (: ).  Implementing automatons in terms of effect
  handlers seems to work quite well, at least for games and UIs. What
  these automatons have in common is that they can be thought of as
  flows, starting at some state and ending at one of multiple final
  states and only have few edges that don't fit this scheme, turning
  them into 'directed almost acyclic graphs'.

  There is obviously a lot more necessary for a UI framework
  (e.g. resizing the window/widgets, delegating the events to the
  correct widget, composing widgets, drawing on the screen etc.) and I
  plan to write about it at some point in the future. But for that I
  will first need to actually solve these problems as right now their
  implementation is quite barebones. The code can be found here for
  those interested (still very early in development!):
  <https://github.com/Willenbrink/bogue/>


[Concur]
<https://ajnsit.github.io/concur-documentation/ch02-01-anatomy-of-a-widget.html>


Awesome Multicore OCaml and Multicore Monorepo
══════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/awesome-multicore-ocaml-and-multicore-monorepo/9515/1>


Patrick Ferris announced
────────────────────────

  A short announcement of two repositories which some people may or may
  not have seen. Firstly, [Awesome Multicore OCaml], a place for
  gathering all of the rapidly changing experiments, ideas, libraries
  and resources for Multicore OCaml (including some of the discuss
  threads). If you are working on something or feel anything is missing
  please open a PR!

  Secondly, a [Multicore Monorepo] which aims to provide a very quick
  and easy way to try out effects and parallelism with quite a few
  libraries (such as Eio, Dream etc.). The breaking changes introduced
  by OCaml 5 can make it frustrating to get such a setup in place,
  although this is less and less true thanks to the [alpha
  repository]. The idea is that you should just be able to clone this
  repository, create a new `5.0.0+trunk' switch, install `dune' and
  start hacking. If that's not the case please do open an issue.


[Awesome Multicore OCaml]
<https://github.com/patricoferris/awesome-multicore-ocaml>

[Multicore Monorepo]
<https://github.com/patricoferris/ocaml-multicore-monorepo>

[alpha repository]
<https://github.com/kit-ty-kate/opam-alpha-repository>


ppx_viewpattern initial release
═══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ppx-viewpattern-initial-release/9516/1>


Simmo Saan announced
────────────────────

  I'm glad to announce the initial release of [ppx_viewpattern] –
  transformation for view patterns in OCaml.

  It _attempts to_ imitate [Haskell view patterns]. I wrote this ppx
  rewriter mostly out of curiosity, rather than need, but it turned out
  neat enough that others might find it interesting or even useful.


[ppx_viewpattern] <https://github.com/sim642/ppx_viewpattern>

[Haskell view patterns]
<https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/view_patterns.html>

Syntax
╌╌╌╌╌╌

  Use `[%view? pat when exp]' as a pattern to apply `exp' to whatever
  the pattern is matching and match the result of the `exp' application
  against `pat'.  This is analogous to the Haskell view pattern `exp ->
  pat'.

  The above extension node payload syntax is the best I could come up
  with to combine an expression and a pattern.  Honestly, I was even
  surprised that `when exp' is attached to a pattern in the AST (not a
  case), because normally it isn't part of the pattern itself.


Example
╌╌╌╌╌╌╌

  This allows one to write
  ┌────
  │ (* These cases are exactly like reduction rules! *)
  │ let rec reduce = function
  │   | Add (Int n1, Int n2) -> Some (Int (n1 + n2))
  │   | Add ([%view? Some p1' when reduce], p2) -> Some (Add (p1', p2))
  │   | Add (p1, [%view? Some p2' when reduce]) -> Some (Add (p1, p2'))
  │   (* ... *)
  │   | _ -> None
  └────
  instead of
  ┌────
  │ (* These nested cases are so annoying! *)
  │ let rec reduce = function
  │   | Add (Int n1, Int n2) -> Some (Int (n1 + n2))
  │   | Add (p1, p2) ->
  │     begin match reduce p1 with
  │       | Some p1' -> Some (Add (p1', p2))
  │       | None ->
  │ 	begin match reduce p2 with
  │ 	  | Some p2' -> Some (Add (p1, p2'))
  │ 	  | None -> None
  │ 	end
  │     end
  │   (* ... *)
  │   | _ -> None
  └────

  See [`examples/' on GitHub] for more.


[`examples/' on GitHub]
<https://github.com/sim642/ppx_viewpattern/tree/master/example>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-03-01 13:54 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-03-01 13:54 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of February 22 to
March 01, 2022.

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

data-encoding.0.5 release
Tutorial: Roguelike with effect handlers
For Diversity and the OCaml Community: Outreachy Summer 2022
Bogue, the OCaml GUI
Friday 03/04 Intern presentations – open attendance!
Affect: Composable concurrency primitives for OCaml 5.0
Segfault Systems Joins Tarides
OCaml User Survey 2022
Old CWN


data-encoding.0.5 release
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-data-encoding-0-5-release/9420/1>


Raphaël Proust announced
────────────────────────

  On behalf of [Nomadic Labs], I'm happy to announce the release of
  data-encoding version 0.5.

  This new version brings several bug fixes, some increased test
  coverage, minor improvements in the API, and a major new feature:


[Nomadic Labs] <https://www.nomadic-labs.com/>

Compact encodings: sub-byte tag sizes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  This new version provides a new set of combinators for _compact_
  encodings. These compact encodings will handle all the verbose and
  error-prone bit-twidling process needed to combine multiple sub-byte
  discriminators into a single byte-size one.

  E.g., the encoding `let e1 = either (either bool unit) (option bool)'
  uses three bits in the shared tag and zero bytes after that; the
  encoding `let e2 = either int32 int64' uses one bit in the shared tag
  and either 4 or 8 bytes to represent the integer; the product encoding
  `let ee = tup2 e1 e2' uses four (3 + 1) bits in the shared tag and
  either 4 or 8 bytes to represent the integer of `e2'.


How to get
╌╌╌╌╌╌╌╌╌╌

  The code is available under MIT license on
  <https://gitlab.com/nomadic-labs/data-encoding>.

  It can be installed via `opam'.


Dario Teixeira asked and Raphaël Proust replied
───────────────────────────────────────────────

        Hi @raphael-proust! I have a question regarding the
        connection between `data-encoding' and
        `json-data-encoding', also developed at Nomadic Labs. The
        latter seems tied to JSON, whereas the former is more
        flexible, supporting also binary encodings. However, since
        `data-encoding' also supports JSON, doesn't it subsume
        `json-data-encoding' completely?

  The `data-encoding' library uses `json-data-encoding' for its JSON
  backend. It delegates conversion from OCaml values into and from JSON
  to the primitives provided in the interface of `json-data-encoding'.

  In a way, yes, as an end-user you don't need to use
  `json-data-encoding' directly because you can use the `Json' module of
  `data-encoding' instead. There are three possible reasons why you
  might add `json-data-encoding' as a (non-transitive) dependency to
  your project and use it directly in your code:

  • You want to keep the dependency set and the number of abstraction
    layers as small as possible. E.g., in order to reduce binary size.
  • You want some static guarantees that some encodings are only every
    used for JSON. E.g., in your logging system.
  • You need to define a JSON encoding which is rejected by
    `data-encoding' on grounds that it is invalid in binary. Note that
    • This is very specific to some combinators but basically some
      combinators will reject their inputs (raise `Invalid_argument')
      because using the serialiser would lead to undecodable data. Most
      typically, this happens if you try to concatenate two fields of
      unknown length. Decoding the result becomes a guessing game as to
      were one field stops and where the next begins. These could easily
      be represented as an array in JSON which includes all the
      delimiters you need to decode it.
    • There are other workarounds (e.g., prefixing the fields with a
      length field), but going for the JSON encoding directly is a valid
      approach if you only need JSON.


Raphaël Proust later announced
──────────────────────────────

  Version 0.5.1 of the data-encoding has just been released.

  This is a bugfix release making one of the library's internal checks
  more permissive. Without this fix (i.e., using version 0.5), some
  valid encodings are rejected (raising `Invalid_argument') by the
  library.

  You can update via opam: `opam install data-encoding.0.5.1'


Tutorial: Roguelike with effect handlers
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/tutorial-roguelike-with-effect-handlers/9422/1>


art-w announced
───────────────

  The recent conversations about [`eio' 0.1] and [agnostic blocking]
  have made me very curious about effect handlers. The multicore team
  has done an [awesome] job with their [tutorials], [examples] and
  [talks], but the laymen have been too quiet for such an exciting
  feature! Where are all the blog posts about how "you could have
  invented algebraic effects" and "one-shot continuations are like
  spaghetti"?

  In any case, I'm hoping to tease some of you into trying them out with
  [a simple tutorial about programming a roguelike with effect handlers]
  :)

  There's nothing new here besides the fun use-case! So if you already
  have an intuitive understanding of the syntax and motivations, you may
  be more interested by [a deeper look at the scope of effect handlers]
  – and a soft introduction to some less common features of the type
  system. /(this link was previously posted deep into the `eio' thread)/

  I would be grateful if you spot any mistake! I'm also curious of other
  fun applications for effect handlers… and if you feel like sharing
  your own surprises and discoveries, I believe it could really help
  others learn faster :)


[`eio' 0.1]
<https://discuss.ocaml.org/t/eio-0-1-effects-based-direct-style-io-for-ocaml-5/9298/97>

[agnostic blocking]
<https://discuss.ocaml.org/t/how-to-block-in-an-agnostic-way/9368/51>

[awesome] <https://github.com/patricoferris/awesome-multicore-ocaml>

[tutorials] <https://github.com/ocamllabs/ocaml-effects-tutorial>

[examples] <https://github.com/ocaml-multicore/effects-examples>

[talks]
<https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5-c6bb9092be89>

[a simple tutorial about programming a roguelike with effect handlers]
<https://hackmd.io/@yF_ntUhmRvKUt15g7m1uGw/BJBZ7TMeq>

[a deeper look at the scope of effect handlers]
<https://hackmd.io/@yF_ntUhmRvKUt15g7m1uGw/Bk-5NXh15>


Kiran Gopinathan then said
──────────────────────────

  Great blog post! That seems like a very elegant implementation!

  Funny you should make a rougelike :smiley: , I guess effect handlers +
  games might be popular for games, because I also had a blog post about
  effect handlers and their applications, in particular for games,
  although in my case it was for animations:

  <https://gopiandcode.uk/logs/log-bye-bye-monads-algebraic-effects.html>


gasche also replied
───────────────────

  Note: the "upstream" status of effect handlers is a little
  uncertain/confusing right now. Your blog post (I didn't get a chance
  to read it yet, but it sounds very nice!) uses the experimental syntax
  of multicore-4.12+effects, but that syntax was intentionally /not/
  upstreamed, and it will /not/ be part of OCaml 5.0.

  I think there is a risk of confusion because the community is aware
  that Multicore OCaml has effect handlers, and also that Multicore
  OCaml has been merged upstream. So it can be tempting to believe that
  the upcoming OCaml release (or maybe one or two releases after that,
  we said the first Multicore release would be more like a preview) will
  support effect handlers as a language feature. It will not! Effects as
  a language feature were removed from Multicore OCaml before the
  upstream merge. And /no one knows/ if/when they will be supported
  upstream.

  So: I think that your blog posts on using effect handlers could have
  somewhere a short mention that the code is using an experimental
  extension of OCaml that is not supported by the upstream
  implementation.


  The reasoning for this choice is that we want to give a chance to a
  type system for effect handlers, but that still need quite a bit more
  time than the Multicore runtime itself. We don't want to encourage the
  ecosystem to rely on untyped effects, if it means a lot of pain
  upgrading to typed effects later (or risk having to support both).

  5.0 only contains basic support for effect handlers as a /runtime
  primitive/, but dos /not/ support handlers as a /language feature/. I
  think they should be considered experimental: you can rely on them for
  their intended purpose of exposing a flexible interface for concurrent
  fibers, but uses beyond that may break in the future.

  So, in a sense, we don't want people to use them. It's of course fine
  to use experimental features from experimental forks of the OCaml
  compiler (effect handlers, modular implicits or explicits, runtime
  type representations and what not), and the people working on these
  experimental features do benefit from other people trying them and
  giving them feedback. But we don't want people to depend on it /in
  production/, whatever that means. (For example, code using it is
  likely to get stuck on 4.12 forever and never see an upgrade to
  upcoming OCaml versions, although of course people could choose to
  port the experimental branch forward.)


For Diversity and the OCaml Community: Outreachy Summer 2022
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/for-diversity-and-the-ocaml-community-outreachy-summer-2022/9234/4>


Sonja Heinze announced
──────────────────────

  Just in case anyone is actually interested in this: the project
  submission deadline has been extended from March 4th to March 23rd. So
  the updated timeline now looks as follows:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/5/534ca9a08bce10f13530e6c98eae1797fdf13e52.png>

  where 2. and 3. probably need to be done a bit in parallel.


Bogue, the OCaml GUI
════════════════════

  Archive: <https://discuss.ocaml.org/t/ann-bogue-the-ocaml-gui/9099/23>


sanette announced
─────────────────

  Hi, some new developments. I have implemented a new `Sdl_area' widget
  where one can conveniently issue any SDL function (from the SDL
  Renderer API).

  Here is (below) the new 'labelled graph' example. In this example I am
  using regular "label" widgets for creating the nodes, and I am using
  an Sdl_area for drawing the lines.

  The nice things for labels to be regular widgets is that one can click
  on them. To demonstrate this, in this example they react to a click by
  jumping to another random location (with animation).

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/f/f9575838a7e5ea4c58485b955e96f7c9bbda384f_2_1266x1000.png>

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/d/d6958e266f27a557c5c8d8d37099d532eacf2c1c.gif>

  ┌────
  │ open Bogue
  │ module W = Widget
  │ module L = Layout
  │ 
  │ let n = 15 (* number of discs *)
  │ let radius = 20
  │ let width = 800
  │ let height = 600
  │ 
  │ let c = Draw.find_color "#e5b92c"
  │ let cb = Draw.find_color "#7b6b35"
  │ let disc_style = Style.(
  │     create ~border:(
  │       mk_border ~radius (mk_line ~color:Draw.(opaque c) ~width:1 ~style:Solid ()))
  │       ~background:(color_bg Draw.(opaque cb)) ())
  │ 
  │ let background = L.style_bg Style.(
  │     of_bg (gradient ~angle:45. Draw.[opaque grey; opaque black]))
  │ 
  │ let fg = Draw.(opaque white)
  │ 
  │ let create_disc i (x,y) =
  │   let w = 2*radius + 1 in
  │   let bg = Box.create ~style:disc_style ~width:w ~height:w () in
  │   W.label ~fg (string_of_int i)
  │   |> L.resident ~background:(L.box_bg bg) ~x:(x-radius) ~y:(y-radius) ~w ~h:w
  │ 
  │ let move_disc (x,y) d =
  │   let (x0, y0) = L.xpos d, L.ypos d in
  │   L.animate_x d (Avar.fromto x0 x);
  │   L.animate_y d (Avar.fromto y0 y)
  │ 
  │ let random_center _ =
  │   radius + Random.int (width - 2*radius),
  │   radius + Random.int (height - 2*radius)
  │ 
  │ let area =
  │   let sdlw = W.sdl_area ~w:width ~h:height () in
  │   let sdla = W.get_sdl_area sdlw in
  │   let centers = Array.init n random_center in
  │   let color = Draw.(opaque grey) in
  │   let draw_lines renderer = let open Draw in
  │     for i = 0 to n - 2 do
  │       let x0, y0 = to_pixels centers.(i) in
  │       let x1, y1 = to_pixels centers.(i+1) in
  │       line renderer ~color ~thick:6 ~x0 ~y0 ~x1 ~y1
  │     done in
  │   Sdl_area.add sdla draw_lines;
  │   let discs = Array.mapi create_disc centers |> Array.to_list in
  │   (* move the disc when click on it *)
  │   List.iteri (fun i d ->
  │       W.on_click ~click:(fun _ ->
  │ 	  centers.(i) <- random_center 0;
  │ 	  Sdl_area.update sdla;
  │ 	  let x,y = centers.(i) in
  │ 	  move_disc (x - radius, y - radius) d) (L.widget d))
  │     discs;
  │   L.superpose ~w:width ~h:height ~background (L.resident sdlw :: discs)
  │ 
  │ let board = Bogue.make [] [area]
  │ 
  │ let () = Bogue.run board
  └────


Friday 03/04 Intern presentations – open attendance!
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/friday-03-04-intern-presentations-open-attendance/9429/1>


Aya announced
─────────────

  This is Aya, one of the three [Outreachy] interns working on OCaml
  this winter :camel: After 3 very fast months, our internships are
  already coming to a close. We have had such a great time working on
  our projects and learning OCaml that we want to hold an event to mark
  the end of the internships, and we decided to open it up to the
  community :tada:

  As you might have seen in the [initial announcement], @pitag
  @shonfeder @gs0510 @tmattio and @pkel all volunteered to mentor us
  from December 2021 to now. Thank you all so so much for mentoring us
  and introducing us to OCaml :heart: :fire: It's been such an enjoyable
  experience!

  We are inviting anyone who is interested to attend a virtual session
  of 3 short presentations on *Friday, March 4th, 4-5pm CET* (we will
  post the link to join on Thursday). There will be time for Q&A after
  each presentation, and the whole session will be recorded and posted
  online shortly after as well.

  • @ayc9 will present on updating a standard PPX deriver (mentors:
    @pitag @shonfeder)
  • @SaySayo will present on syntax highlighting and other updates to
    the vscode extension (mentors: @tmattio @gs0510)
  • @JiaeK will present on building a basic monitoring dashboard for
    [ocaml.org] (mentors: @tmattio)

  We hope you can make it!

  -@ayc9 @SaySayo @JiaeK


[Outreachy] <https://outreachy.org/>

[initial announcement]
<https://discuss.ocaml.org/t/announcing-our-new-outreachy-interns/8932>

[ocaml.org] <http://ocaml.org/>


Affect: Composable concurrency primitives for OCaml 5.0
═══════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/affect-composable-concurrency-primitives-for-ocaml-5-0/9430/1>


Daniel Bünzli announced
───────────────────────

  I looked a bit into the kind of fiber abstraction and concurrency
  structure I would like to use with the new tools OCaml 5.0 is going to
  offer.  You can find some results in affect's [`Fiber'] module.

  This fiber abstraction supports terminating by returning values or
  abnormally (by aborting or via a spurious exception). Termination of a
  fiber is aligned on function scopes: all the fibers spawn by a fiber
  function have to terminate in order for it to terminate.

  This means that if your fiber returns a value it waits for its spawns
  to terminate (in any way) before returning the value. And if your
  fiber returns abnormally (uncaught eception or explicit abort) it
  first aborts all its non-terminated spawns before returning abnormally
  – this provides affect's notion of cancellation.

  Explicit fiber aborts raise the `Abort' exception in fibers. Combined
  with a disciplined use of `Fun.protect' and an optional `finally'
  handler specified at fiber spawn, this lets them release the
  ressources they may hold when it's time to say goodbye.

  The module also provides a generic way of blocking and unblocking
  fibers that you can use to interface with your favourite event
  loop. It does so without requiring to fiddle with effects, you just
  need to make judicious use of [`Fiber.block'] and provide a suitable
  function to `Fiber.run''s built-in scheduler to let it know about
  fibers that can be unblocked.

  A grab bag of comments:

  1. The first goal of affect is to seek a concurrency and abort
     structure that are easy to understand, use and compose with event
     loops. Right now some efficiency and implementation aspects need to
     be improved. This will likely change the exposed set of primitive
     effects which doesn't feel exactly right yet (if you want to build
     your own scheduler).

  2. I use abort rather than cancel terminology. From my non-native
     english speaker perspective, cancelling is more about not doing
     something that was planned but didn't happen yet. Aborting is more
     about stopping something that is going on. It also melds better
     with the uncaught exception case.

  3. Say no to `unit' soups! Let fibers return values.

  4. At that point I don't feel the need to add a promise/future
     abstraction to the toolbox. The whole point of direct style is to
     get rid of this async madness.

  5. There's no synchronisation structure yet. Semaphores are always
     useful for throttling so I'll certainly add that at some point or a
     more fundamental primitive like an mvar.

  6. The [`Funix'] module has a few fiber friendly `Unix' module
     functions for playing with timers and the network, see [`ping.ml']
     for an example of use. In practice you want to be able to use
     something else than `select(2)' though. There are various ways one
     could go about this, see for example point 6. in these [design
     notes].

  7. The [`mouse.ml'] has a basic example on how to interface with the
     SDL event loop which provides another example on how one goes to
     interface `Fiber' with event loops.

  I'm not fully convinced by everything yet. It will certainly need one
  or two more design rounds. If you try it, feel free to comment or make
  suggestions on the issue tracker.

  Home page: <https://erratique.ch/software/affect>

  API docs: <https://erratique.ch/software/affect/doc/> (or `odig doc
  affect')

  Install:
  ┌────
  │ opam switch create 5.0.0+trunk
  │ opam pin add https://erratique.ch/repos/affect.git
  └────


[`Fiber'] <https://erratique.ch/software/affect/doc/Fiber/index.html>

[`Fiber.block']
<https://erratique.ch/software/affect/doc/Fiber/index.html#val-block>

[`Funix'] <https://erratique.ch/software/affect/doc/Funix/index.html>

[`ping.ml']
<https://github.com/dbuenzli/affect/blob/master/test/ping.ml>

[design notes]
<https://github.com/dbuenzli/affect/blob/master/DESIGN.md>

[`mouse.ml']
<https://github.com/dbuenzli/affect/blob/master/test/mouse.ml>


Segfault Systems Joins Tarides
══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/segfault-systems-joins-tarides/9431/1>


Thomas Gazagnaire announced
───────────────────────────

  @kayceesrk and I are delighted to announce that Segfault Systems, a
  spinout from IIT-Madras, is joining Tarides.  Tarides has worked
  closely with Segfault Systems over the last couple of years, most
  notably on the award-winning Multicore OCaml project and the
  upstreaming plans for OCaml 5.0. This alliance furthers the goals of
  Tarides, bringing the compiler and benchmarking expertise of the
  Segfault team directly into the Tarides organisation, where it can be
  commercially funded and supported.

  All of Segfault Systems’ existing responsibilities and open-source
  commitments will migrate over to Tarides, where work will continue
  towards the three main objectives in 2022:

  • Releasing OCaml 5.0 with support for domains and effect handlers
  • Supporting the ecosystem to migrate the OCaml community over to
    OCaml 5.0
  • Improving developer productivity for OCaml 5.0 by releasing the best
    platform tools

  This alliance will complement the commercial offerings of Tarides –
  already strengthened by the integration of [OCaml Labs] – and
  contribute to Tarides’ mission: empowering developers, communities,
  and organisations to adopt OCaml as their primary programming
  experience by providing training, expertise, and development services
  around the OCaml language.

  Read the full announcement [here], including details of our goals and
  the focus for 2022. This alliance brings the headcount of Tarides up
  to 60+ people, all working towards making OCaml the best language for
  any and every project. Join our team and reach out for commercial
  services at [https://tarides.com/].


[OCaml Labs] <https://discuss.ocaml.org/t/ocaml-labs-joins-tarides/9229>

[here]
<https://tarides.com/blog/2022-03-01-segfault-systems-joins-tarides>

[https://tarides.com/] <https://tarides.com/>


OCaml User Survey 2022
══════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-user-survey-2022/9433/1>


Kim Nguyễn announced
────────────────────

  we are delighted to announce the [OCaml User Survey 2022]. With this
  survey, the OCSF is trying to get a better picture of the OCaml
  community and its needs. It would be very helpful if you could take a
  few minutes (10 to 15) to fill the survey and share it with other
  OCaml programmers.

  [https://forms.gle/oKy2Joz1cZhCPNtf6]

  The survey is run by the [OCaml Software Foundation]. It builds on
  [the previous iteration] issued in 2020. The results will be published
  here on discuss and on the [website of the OCSF]. We would like to
  particularly thank @cjr for his help as well as everyone who commented
  on the previous survey. We tried our best to take all remarks into
  account but surely missed something. Don't hesitate to give us your
  feedback (you can post here or send me a message/email).

  The survey will remain opened until March 11th 2022 (AOE).


[OCaml User Survey 2022] <https://forms.gle/oKy2Joz1cZhCPNtf6>

[https://forms.gle/oKy2Joz1cZhCPNtf6]
<https://forms.gle/oKy2Joz1cZhCPNtf6>

[OCaml Software Foundation] <https://ocaml-sf.org/>

[the previous iteration]
<https://discuss.ocaml.org/t/ann-ocaml-user-survey-2020/6624>

[website of the OCSF] <https://ocaml-sf.org/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-02-22 12:43 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-02-22 12:43 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of February 15 to 22,
2022.

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

OCAML goes Quantum computing
Layout Parsing and Nicely Formatted Error Messages
ptime 1.0.0 and mtime 1.4.0
Timedesc 0.6.0
OCaml from the Very Beginning now free in PDF and HTML formats
Dune 3.0.0
Blog Post "2021 at OCamlPro"
Packstream 0.1
OCaml 4.14.0, first beta release
Old CWN


OCAML goes Quantum computing
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-goes-quantum-computing/9333/1>


Florian said
────────────

  It seems that silently OCAML is now entering the Quantum world.  It
  looks that the Interpreter for "Twist" [New programming language for
  Quantum computing] is made with OCAML: [GitHub for Twist]


[New programming language for Quantum computing]
<https://scitechdaily.com/twist-mits-new-programming-language-for-quantum-computing/>

[GitHub for Twist] <https://github.com/psg-mit/twist-popl22>


Anton Kochkov then added
────────────────────────

  Haskell has a nice package for quantum computing - Quipper. I
  recommend to take a look to it for inspiration as well:
  • <https://hackage.haskell.org/package/quipper-language>
  • <http://www.mathstat.dal.ca/~selinger/quipper/>
  • <https://arxiv.org/pdf/1304.3390.pdf>
  • <https://arxiv.org/pdf/2105.03522.pdf> (a new language that reuses
    linear types in the Haskell to represent quantum specifics during
    the Quipper type check)


Layout Parsing and Nicely Formatted Error Messages
══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-layout-parsing-and-nicely-formatted-error-messages/9343/1>


Hbr announced
─────────────

  In a previous [post] I have described my way from LALR parsing to
  combinator parsing. Now I am more and more convinced that combinator
  parsing is really a good and flexible way to write parsers. The new
  release 0.5.0 of `Fmlib` focuses on layout parsing and nicely
  formatted error messages by using combinator parsing.

  The library can be installed via opam by `opam install fmlib'. There
  is a [github repository] hosting the source code. The [API] can be
  found online. See also a [tutorial] on combinator parsing.


[post]
<https://discuss.ocaml.org/t/my-way-from-lalr-parsing-to-combinator-parsing/7377>

[github repository] <https://github.com/hbr/fmlib>

[API] <https://hbr.github.io/fmlib/odoc/index.html>

[tutorial] <https://hbr.github.io/fmlib/odoc/fmlib_parse/parse.html>

Layout Parsing
╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Most programming languages express hierarchical structures by some
  kind of parentheses. Algol like languages use `begin' `end', C like
  languages use curly braces `{', `}' to enclose blocks of code. Since
  blocks can be nested inside blocks, the hierarchical or tree structure
  is well expressed by the syntax.

  For the human reader blocks are usually indented to make the
  hierarchical structure graphically visible. Programming languages like
  *Haskell* and *Python* ommit the parentheses and express the
  hierarchical structure by indentation. I.e. the indentation is part of
  the grammar. This is pleasing to the eye, because many parentheses can
  be ommitted.

  The hierarchical structure in the following schematical source file is
  immediately visible without the need of parentheses.

  ┌────
  │ xxxxxxxxxxx
  │     xxx
  │     xxx
  │         xxxxxxx
  │ xxxxxxxx
  │     xxx
  └────

  Lower level blocks are indented with respect to their parent block and
  siblings at the same level are vertically aligned.

  Because of this good readability configuration languages like yaml
  have become very popular.

  Unfortunately there are not many parsers available which support
  indentation sensitivity. The library [Fmlib] has support to parse
  languages whose grammar uses indentation to structure blocks
  hierarchically.

  There are only 3 combinators needed to introduce layout parsing in
  combinator parsing. Suppose that `p' is a combinator parsing a certain
  contruct. Then we have

  • `indent 4 p': Parse the construct described by `p' indented at least
    4 columns relative to its environment

  • `align p': Parse the construct desribed by `p' aligned vertically
    with its siblings

  • `detach p': Parse the construct described by `p' without any
    indentation or alignment restrictions

  In order to parse a list of ~p~s vertically aligned and indented
  relative to its environment by at least one column we just write

  ┌────
  │ one_or_more (align p) |> indent 1
  └────

  and parse a structure with the schematic layout

  ┌────
  │ xxxxxxxx
  │ 
  │     pppppppp
  │ 
  │     pppppp
  │ 
  │     pppp
  │ 
  │ xxxxx
  └────


[Fmlib]
<https://hbr.github.io/fmlib/odoc/fmlib_parse/Fmlib_parse/index.html>


User Frienly Error Messages
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  It is important to for a parser writer to make syntax error messages
  user friendly. [Fmlib] has some support to write friendly error
  messages. There is the operator `<?>' copied from the Haskell library
  `parsec' which helps to equip combinators with descriptive error
  message in case they fail to parse the construct successfully.

  At the end of a failed parsing, the syntax (or semantic) errors have
  to be presented to the user. Suppose there is a combinator parser for
  a yaml like structure. The library writes by default for you error
  messages in the form

  ┌────
  │ 1 |
  │ 2 | names:
  │ 3 |      - Alice
  │ 3 |      - Bob
  │ 4 |
  │ 5 |   category: encryption
  │       ^
  │ 
  │ I have encountered something unexpected. I was
  │ expecting one of
  │ 
  │     - at 3 columns after
  │ 
  │         - sequence element: "- <yaml value>"
  │ 
  │     - at 2 columns before
  │ 
  │         - key value pair: "<key>: <yaml value>"
  │ 
  │     - end of input
  └────

  The raw information (line and column numbers, individual expectations,
  failed indentation or alignment expectation) is available as well so
  that you can present the error messages to the user in any different
  form.

  There is also a component [Fmlib_pretty] in the library for pretty
  printing any ascii text.


[Fmlib]
<https://hbr.github.io/fmlib/odoc/fmlib_pretty/Fmlib_pretty/index.html>

[Fmlib_pretty]
<https://hbr.github.io/fmlib/odoc/fmlib_pretty/Fmlib_pretty/index.html>


ptime 1.0.0 and mtime 1.4.0
═══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ptime-1-0-0-and-mtime-1-4-0/9344/1>


Daniel Bünzli announced
───────────────────────

  It's my pleasure to announce new releases of ptime and mtime. Ptime
  and mtime provide types and clocks for POSIX and monotonic time.

  These releases change the JavaScript support strategy for clocks by
  implementing the primitives in pure JavaScript and linking them via
  `js_of_ocaml'.

  This means that both the `ptime.clock.jsoo' and `mtime.clock.jsoo'
  libraries no longer exist[^1]. Instead simply use the `ptime.clock.os'
  or `mtime.clock.os' libraries like you would do for your regular
  programs.

  By side effect, the packages also no longer depend on any of
  `js_of_ocaml''s packages.

  Thanks to Hugo Heuzard (@hhugo) for suggesting and implementing these
  changes. Thanks also to Jonah Beckford for his Windows build patches.

  Other changes are described in the release notes for [`ptime'] and
  [`mtime'].

  Home pages: [ptime], [mtime]

  Docs & manuals: [ptime], [mtime] or `odig doc ptime mtime'

  Install: `opam install ptime mtime'

  [^1]: I had intended to only deprecate these libraries by `warning' in
  the `META' files and requiring the replacement library but it seems
  the warning won't show up in many contexts including `dune' builds. So
  a breaking change it is.


[`ptime']
<https://github.com/dbuenzli/ptime/blob/master/CHANGES.md#v100-2022-02-16-la-forclaz>

[`mtime']
<https://github.com/dbuenzli/mtime/blob/master/CHANGES.md#v140-2022-02-17-la-forclaz-vs>

[ptime] <https://erratique.ch/software/ptime>

[mtime] <https://erratique.ch/software/mtime>

[ptime] <https://erratique.ch/software/ptime/doc>

[mtime] <https://erratique.ch/software/mtime/doc>


Timedesc 0.6.0
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-timedesc-0-6-0/9349/1>


Darren announced
────────────────

  I am pleased to announce the release of [Timedesc] 0.6.0.

  Timedesc is a very comprehensive date time handling library with good
  support of time zone.


[Timedesc] <https://github.com/daypack-dev/timere>

Features:
╌╌╌╌╌╌╌╌╌

  • Timestamp and date time handling with platform independent time zone
    support
    • Subset of the IANA time zone database is built into this library
  • Supports Gregorian calendar date, ISO week date, and ISO ordinal
    date
  • Supports nanosecond precision
  • ISO8601 parsing and RFC3339 printing


Changes
╌╌╌╌╌╌╌

  This release adds a fair number of quality of life improvements and
  additional features. Many thanks to @glennsl for the suggestions and
  feedback!

  The most important sections of the changelog are as follows:

  • Main breaking changes:
    • Changes in ISO week date functions (shorting label for arguments,
      quality of life changes)
    • Removed `_date' suffix in names of `Date.Ymd_date' and
      `Date.ISO_ord_date'
  • Added "partial date" modules with ISO8601 parsing and printing
    facilities
    • `ISO_week'
    • `Ym'
  • Added additional ISO8601 printing facilities for all three calendar
    systems
    • `Date.Ymd.pp/to_iso8601' (these are just aliases to the RFC3339
      printers)
    • `Date.ISO_week_date.pp/to_iso8601'
    • `Date.ISO_ord.pp/to_iso8601'
  • Added additional ISO8601 parsing facilities for all three calendar
    systems
    • `Date.Ymd.of_iso8601[_exn]'
    • `Date.ISO_week_date.of_iso8601[_exn]'
    • `Date.ISO_ord.of_iso8601[_exn]'
  • Added additional comparison functions to `Date'
    • `lt', `le', `gt', `ge', `compare'
  • Added arithemtic functions to `Date'
  • Added `pp/to_iso8601' functions as aliases to the rfc3339 functions
    to `Timedesc'
  • Patched ISO8601 parsers and RFC3339/ISO8601 printers to handle
    second level time zone offset
    • Rare occurrence in tzdb but picked up by some new tests


OCaml from the Very Beginning now free in PDF and HTML formats
══════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-from-the-very-beginning-now-free-in-pdf-and-html-formats/9361/1>


John Whitington announced
─────────────────────────

  Thanks to a grant from the [OCaml Software Foundation], I am able to
  release my book [OCaml from the Very Beginning] at no cost in its
  existing PDF format, and in a new HTML format too.

  You can find it here:
  [https://johnwhitington.net/ocamlfromtheverybeginning/].

  The paperback and Kindle versions continue to be available from Amazon
  as before.

  The book has recently been updated to make it ready for OCaml 4.14
  which involved only minor changes to error handling and warnings. I
  have also opened the [source].


[OCaml Software Foundation] <https://ocaml-sf.org/>

[OCaml from the Very Beginning] <https://ocaml-book.com>

[https://johnwhitington.net/ocamlfromtheverybeginning/]
<https://johnwhitington.net/ocamlfromtheverybeginning/>

[source] <https://github.com/johnwhitington/mlbook>


Dune 3.0.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-0-0/9374/1>


Rudi Grinberg announced
───────────────────────

  On behalf of the dune team, I’m delighted to announce the availability
  of dune 3.0.

  The team has been working on this release for over 6 months, and
  there’s a bunch of new work to report. I’ll only highlight the some of
  the interesting new developments:

  • The watch mode has been rewritten from scratch to be faster and more
    scalable. We also no longer rely on any 3rd party tools such as
    fswatch. If any of you still have a dune workspace dune is still
    struggling with, we cannot wait to hear from you.

  • The watch mode now also starts an RPC server in the background. This
    RPC protocol is going to be the basis for other tools to interact
    with dune. Watch out for announcement on the LSP side to see how
    we’ll be making use of it to improve the editing experience.

  • The dune cache has been rewritten as well. It is now simpler and
    more reliable. There are still some components missing, such as
    distribution of the artifacts on the network. Nevertheless, we
    welcome you all to experiment with this feature and give us
    feedback.

  • We’ve addressed one of our oldest feature requests: high level rules
    for ctypes projects. This feature is still experimental, so we need
    feedback from real world projects before declaring it as mature.

  Of course, there are many other fixes, enhancements, and only a few
  breaking changes in this release. We hope you have an easy time
  upgrading.

  Happy Hacking.

  /Editor’s note: for the full changelog, please follow the archive link
  above./


Blog Post "2021 at OCamlPro"
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/blog-post-2021-at-ocamlpro/9390/1>


Fabrice Le Fessant announced
────────────────────────────

  We just published a review of what OCamlPro did in 2021:

  <https://www.ocamlpro.com/blog/2022_01_31_2021_at_ocamlpro>

  A lot of OCaml, but also some Rust, Cobol, Solidity, and a lot of
  Formal Verification! OCamlPro is always looking for skilled OCaml
  developers to hire, so if you are interested, contact us at
  contact@ocamlpro.com


Packstream 0.1
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-packstream-0-1/9392/1>


Tomasz Barański announced
─────────────────────────

  I have a pleasure to announce the release of [Packstream] 0.1.

  Packstream is a library to parse/serialize [Packstream binary format].

  This is the initial release. It is functional but very very limited in
  scope. It allows parsing a binary stream into a Packstream datatype
  and serializing the datatype into a binary stream.


[Packstream] <https://github.com/tomob/packstream>

[Packstream binary format]
<https://7687.org/packstream/packstream-specification-1.html>


OCaml 4.14.0, first beta release
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-14-0-first-beta-release/9396/1>


octachron announced
───────────────────

  The release of OCaml 4.14.0 is close.

  The set of new features has been stabilized, and most opam packages
  already work with this release. After two alpha releases, we have
  created a first beta version to help you update your softwares and
  libraries ahead of the release.

  If you find any bugs, please report them at:

  <https://github.com/ocaml/ocaml/issues>

  The full release of OCaml 4.14.0 is currently expected for the middle
  of March.

  Compared to the last alpha, we have a last minute correction for one
  of the new function in the Seq module, some documentation
  improvements, few configuration and internal tweaks.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands

  ┌────
  │ opam update
  │ opam switch create 4.14.0~beta1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  With opam 2.1, the previous command line can be simplified to
  ┌────
  │ opam update
  │ opam switch create 4.14.0~beta1
  └────
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:

  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.14.0~beta1+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  or with opam 2.1:
  ┌────
  │ opam update
  │ opam switch create <switch_name> ocaml-variants.4.14.0~beta1+options <option_list>
  └────

  where `<option_list>' is a comma separated list of `ocaml-option-*'
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 4.14.0~beta1+flambda+nffa ocaml-variants.4.14.0~beta1+options ocaml-option-flambda
  │ ocaml-option-no-flat-float-array
  └────
  All available options can be listed with `opam search ocaml-option'.

  The source code for the beta is also available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/4.14.0-beta1.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~beta1.tar.gz>


Changes compared to the last alpha
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The full list of changes for OCaml 4.14 is available at
  <https://github.com/ocaml/ocaml/blob/4.14/Changes>


Standard library
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • *additional fixes* [10583], +[10998]: Add over 40 new functions in
     Seq. (François Pottier and Simon Cruanes, review by Nicolás Ojeda
     Bär, Daniel Bünzli, Naëla Courant, Craig Ferguson, Wiktor Kuchta,
     Xavier Leroy, Guillaume Munch-Maccagnoni, Raphaël Proust, Gabriel
     Scherer and Thierry Martinez)


[10583] <https://github.com/ocaml/ocaml/issues/10583>

[10998] <https://github.com/ocaml/ocaml/issues/10998>


Documentation
┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [10397]: Document exceptions raised by Unix module functions on
    Windows (Martin Jambon, review by Daniel Bünzli, David Alsopp,
    Damien Doligez, Xavier Leroy, and Florian Angeletti)

  • [10794]: Clarify warning 57 (Ambiguous or-pattern variables under
    guard) (Wiktor Kuchta, review by Gabriel Scherer)


[10397] <https://github.com/ocaml/ocaml/issues/10397>

[10794] <https://github.com/ocaml/ocaml/issues/10794>


Build system
┄┄┄┄┄┄┄┄┄┄┄┄

  • [10828] Build native-code compilers on OpenBSD/aarch64 (Christopher
    Zimmermann)

  • [10835] Disable DT_TEXTREL warnings on x86 32 bit architecture by
    passing -Wl,-z,notext in mksharedlib and mkmaindll. Fixes relocation
    issues, reported in [9800], making local patches in Debian, Alpine,
    and FreeBSD superfluous. (Hannes Mehnert with Kate Deplaix and
    Stéphane Glondu, review by Xavier Leroy)


[10828] <https://github.com/ocaml/ocaml/issues/10828>

[10835] <https://github.com/ocaml/ocaml/issues/10835>

[9800] <https://github.com/ocaml/ocaml/issues/9800>


Code generation
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [10719]: Ensure that build_apply respects Lambda.max_arity (Stephen
    Dolan, review by Xavier Leroy)


[10719] <https://github.com/ocaml/ocaml/issues/10719>


Internal/compiler-libs
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • *additional fixes* [10718], +[11012]: Add "Shape" information to the
     cmt files. Shapes are an abstraction of modules that can be used by
     external tooling to perform definition-aware operations. (Ulysse
     Gérard, Thomas Refis and Leo White, review by Florian Angeletti)


[10718] <https://github.com/ocaml/ocaml/issues/10718>

[11012] <https://github.com/ocaml/ocaml/issues/11012>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-02-08 13:16 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-02-08 13:16 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of February 01 to 08,
2022.

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

Functori is hiring full-time engineers and Interns
Permanent position for Computer Scientist in cybersecurity verification at CEA List, France
pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
Old CWN


Functori is hiring full-time engineers and Interns
══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/functori-is-hiring-full-time-engineers-interns/9266/1>


Mohamed Iguernlala announced
────────────────────────────

  Functori, a young and dynamic company based in Paris, is hiring
  talented engineers/PhDs to expand its team. Please find more details
  in the announcement (in French):
  <https://functori.com/annonce-recrutement.pdf>

  We are also looking for interns in the fields of programming
  languages, formal methods, and blockchains (details available on
  request).

  Feel free to share with anyone who may be interested.


Permanent position for Computer Scientist in cybersecurity verification at CEA List, France
═══════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-02/msg00004.html>


ANTIGNAC Thibaud announced
──────────────────────────

  We would like to share with you an exciting opportunity to join the
  Frama-C team at CEA List (a French public research institute). We are
  opening a permanent computer scientist position to work on formal
  verification of cybersecurity properties. More details about the
  position and the qualifications expected are available here:
  <https://frama-c.com/jobs/2022-02-01-permanent-computer-scientist-cyber-security-verification.html>

  Please do not hesitate to reach out or to share with potentially
  interested people!


pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-pyml-bindgen-a-cli-app-to-generate-python-bindings-directly-from-ocaml-value-specifications/8786/5>


Ryan Moore announced
────────────────────

New version
╌╌╌╌╌╌╌╌╌╌╌

  I wanted to announce a new version of `pyml_bindgen' has been merged
  into the opam repository, version 0.2.0.  Whenever it hits, feel free
  to try it out!

  The main addition is now you can embed Python files directly into the
  generated OCaml module and it will be evaluated at run time.  In this
  way, you don't need your users to mess with the `PYTHONPATH'
  environment variable or need them to install a particular Python
  module when using the generated OCaml code. (Another thanks to
  UnixJunkie and Thierry Martinez for their help with this!)

  There were also a few bugfixes and some nice new [examples] added to
  the GitHub repository.  One cool thing about the examples is that they
  show you how to set up your project to use Dune rules to automatically
  generate Python bindings whenever the value specification files
  change!


[examples]
<https://github.com/mooreryan/ocaml_python_bindgen/tree/main/examples>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-02-01 13:00 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-02-01 13:00 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of January 25 to
February 01, 2022.

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

ppx_seq v0.1.1
OCaml Labs Joins Tarides
For Diversity and the OCaml Community: Get Involved in Outreachy Summer 2022
Set up OCaml 2.0.0-beta13
First release of scfg
Brr 0.0.3, a toolkit for programming browsers
(anonymous?) polymorphic records
2 postdoc positions on Runtime Verification at CEA LIST, Université Paris-Saclay, France
Old CWN


ppx_seq v0.1.1
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-ppx-seq-v0-1-1/9227/1>


hyphenrf announced
──────────────────

  Hello everyone, my first contribution to opam-repository has just been
  merged and is waiting to hit the caches of [opam.ocaml.org].

  [ppx_seq] is a cute un-intrusive literal syntax for `Seq'. The
  rewriter is simple and has very small surface area: just `[%seq x; y;
  z; ...]' and `[%seq.empty]'.  It tries to be maximally compatible with
  all OCaml releases from 4.07 (when `Seq' was introduced) to 4.14 and
  beyond

  The reason I created this rewriter is to make it an easier choice to
  reach first for `Seq' as a general data structure (instead of
  e.g. list). That wasn't quite attractive before because of how minimal
  the `Seq' module was, it was mostly used as an intermediate step
  between two types of collections, but now with 4.14 about to be
  released, `Seq' is becoming a first-class data structure with a very
  versatile API.

  I hope my little rewriter helps make it even more attractive to
  use. Check it out and maybe leave me some feedback.  Thanks <3


[opam.ocaml.org] <https://opam.ocaml.org>

[ppx_seq] <https://github.com/hyphenrf/ppx_seq>


OCaml Labs Joins Tarides
════════════════════════

  Archive: <https://discuss.ocaml.org/t/ocaml-labs-joins-tarides/9229/1>


Thomas Gazagnaire announced
───────────────────────────

  Gemma Gordon (@gemmag) and I are delighted to announce that OCaml
  Labs, a spinout from the University of Cambridge, is joining
  Tarides. After successfully collaborating on many OCaml projects over
  the last four years, this alliance will formally combine the expertise
  of both groups. Joining forces will accelerate OCaml development and
  its broader adoption, and enable us to continue with our shared goal
  of bringing OCaml into mainstream use. Furthermore, it will bring the
  security, portability and performance of OCaml to a large spectrum of
  use-cases: from academic endeavours such as formal methods and
  existing threats within cyber security, to real-world applications for
  climate change, sustainable agriculture, and even space exploration!

  All of OCaml Labs’ existing responsibilities and open source
  commitments will migrate over to Tarides, and thanks to how closely
  the teams already work, business will continue without interruption to
  continuity or delivery. Gemma Gordon will step up as CEO of Tarides,
  and I will lead the technological vision and strategy as CTO.

  The OCaml 5.0 release will support multicore and effects handlers,
  influencing every aspect of the language and its ecosystem. The update
  will significantly improve both performance and user experience,
  whilst maintaining existing features that the community loves. Using
  the teams’ combined experience and zest for innovation, Tarides is
  looking to the future of the OCaml language and community with
  excitement. Since Tarides’ inception we have envisioned a future where
  all OCaml applications are easily deployable as specialised, secure
  and energy-efficient MirageOS unikernels. We believe that this
  alliance is a step further in that direction.

  _This alliance will complement the commercial offerings of Tarides and
  contribute to Tarides' mission: empowering developers, communities and
  organisations to adopt OCaml as their primary programming experience
  by providing training, expertise and development services around the
  OCaml language._

  Read the full announcement [here], including details of our goals and
  the focus for 2022.  This alliance brings the headcount of Tarides up
  to 60+ people, all working towards making OCaml the best language for
  any, and every project. Join our team and reach out for commercial
  services at: [https://tarides.com/]


[here] <https://tarides.com/blog>

[https://tarides.com/] <https://tarides.com/company>


For Diversity and the OCaml Community: Get Involved in Outreachy Summer 2022
════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/for-diversity-and-the-ocaml-community-get-involved-in-outreachy-summer-2022/9234/1>


Sonja Heinze announced
──────────────────────

  As @patricoferris [has mentioned] previously, the Outreachy call for
  open-source communities and project submissions has started. As a
  reminder, [Outreachy] is an initiative that provides a framework
  through which open-source communities can offer three month
  internships directed at people from any kind of under-represented
  background in open source. With that, Outreachy helps open-source
  communities grow on several levels: diversity, experience, size, and
  popularity.

  The OCaml community participated in Outreachy in summer 2019, summer
  2020, [summer 2021], and currently in [winter 2021/22]. All our
  interns have done and are doing really amazing jobs, and summer 2022
  is just around the corner! The following timeline illustrates the
  process:

  <https://i.imgur.com/DbzeiMO.png>

  So let's start getting involved!


[has mentioned]
<https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-and-diversity-of-the-ocaml-community/8213/15?u=pitag>

[Outreachy] <https://www.outreachy.org>

[summer 2021] <https://discuss.ocaml.org/t/outreachy-summer-2021/8438>

[winter 2021/22]
<https://discuss.ocaml.org/t/announcing-our-new-outreachy-interns/8932>

Ways to Get Involved
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Community members can take on different roles in the Outreachy effort,
  and all of them are very important! Maybe the most important (and most
  involved) role is being a mentor.


Mentoring
┄┄┄┄┄┄┄┄┄

  Mentors have two responsibilities: leading the project and guiding the
  interns/applicants.


Leading the Project
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

  One responsability is leading the project. Concretely, that means
  outlining an internship project, submitting a project description to
  Outreachy, making sure that the context repo for that project gets
  ready for the application/"contribution" phase, and guiding the
  project throughout the internship, including reacting to changes.  All
  of that must match the Outreachy framework, which we [explained in
  detail] last round, based on the timeline structure shown above.


[explained in detail]
<https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-and-diversity-of-the-ocaml-community/8213#step-by-step-process-for-being-a-mentor-11>


Guiding the Intern and the Applicants
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

  Their other responsibility is personal guidance. During the
  application/"contribution" period, mentors answer questions and review
  code for multiple applicants. During the internship, they also offer
  pair-programming sessions and facilitate more specific guidance, and
  general support for their interns.

  All of that is usually quite time-intensive, so it's important to have
  some support from other community members and strong support from a
  concrete co-mentor.


Co-mentoring
┄┄┄┄┄┄┄┄┄┄┄┄

  A co-mentor does the same job as described in the "Guiding the Intern
  and the Applicants" tasks above, so having a co-mentor is very
  important! Of course, if a co-mentor also wants to take part in the
  project's direction, that's great as well! This means that the line
  between co-mentoring and mentoring isn't always clear.


Volunteering (aka "Acting as a Joker :bat:")
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  Mentors and co-mentors receive a lot of general questions related to
  OCaml and programming in addition to specific questions about the
  project. That's where Outreachy volunteers can be very helpful! They
  help all applicants and interns across projects with (usually)
  project-unspecific questions and give a very important technical base
  support.


Point Out Potential Project Ideas
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  Apart from not having enough time, the main reason that stops folks
  from becoming a mentor is the lack of project ideas. So if you have
  potential project ideas, please point them out, even if you don't have
  time to mentor!  Generally, a self-contained, uncontroversial, and
  incremental project makes the most suitable project for Outreachy.
  It's also important for a project to be associated with a repo that
  can serve as a basis for easy contributions during the application
  phase. When in doubt, don't keep your ideas to yourself. Any idea can
  be helpful!


Prepare Your Repos
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  In general, if you maintain a repo, it's really nice to be welcoming
  to new contributors. Concretely, that means having clear contributing
  guidelines, good newcomer issues, and well-labeled issues. As a nice
  side-effect, this also makes your project a better target for future
  Outreachy projects.


Ready to Get Involved?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  If you've gotten interested in any of those roles or have any other
  comments, please just answer here in the thread.  It would be super
  nice to get a discussion going and start our Outreachy efforts early!


Sudha Parimala then said
────────────────────────

  I along with @shakthimaan @gs0510 are submitting a project:

  • Extend OCaml 5's parallel benchmark suite.

  The idea is to gather parallel benchmarks available elsewhere and make
  them available in our benchmark suite, to aid the development of the
  OCaml compiler and parallel programming libraries. Relevant repos:
  [sandmark] and [current-bench].


[sandmark] <https://github.com/ocaml-bench/sandmark>

[current-bench] <https://github.com/ocurrent/current-bench>


Set up OCaml 2.0.0-beta13
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta13/9248/1>


Sora Morimoto announced
───────────────────────

Changed
╌╌╌╌╌╌╌

  • Do not install opam-depext if it's not enabled.


Fixed
╌╌╌╌╌

  • Print a proper error if the version not found in the `.ocamlformat'
    file.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta13>


First release of scfg
═════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-release-of-scfg/9249/1>


zapashcanon announced
─────────────────────

  I'm pleased to announce the first release of [scfg] on opam.

  It provides a library and an executable to work with the [scfg
  configuration file format]. (disclaimer: scfg has been created by my
  good friend @emersion)

  Here's an example of an scfg file taken from the specification:

  ┌────
  │ train "Shinkansen" {
  │ 	model "E5" {
  │ 		max-speed 320km/h
  │ 		weight 453.5t
  │ 
  │ 		lines-served "Tōhoku" "Hokkaido"
  │ 	}
  │ 
  │ 	model "E7" {
  │ 		max-speed 275km/h
  │ 		weight 540t
  │ 
  │ 		lines-served "Hokuriku" "Jōetsu"
  │ 	}
  │ }
  └────

  Scfg is a file format designed to be simple and indeed the
  implementation was really straightforward. I'm planning to use it in
  small tools I wrote (mostly [sway] tools written in OCaml) but never
  released because I couldn't stand having to use TOML, YAML or JSON for
  them…

  The library provides an executable to validate and pretty-print an
  scfg file. It'll indent it properly, remove useless quoting and
  whitespaces:

  ┌────
  │ $ scfg spec.scfg
  │ train Shinkansen {
  │   model E5 {
  │     max-speed 320km/h
  │     weight 453.5t
  │     lines-served Tōhoku Hokkaido
  │   }
  │   model E7 {
  │     max-speed 275km/h
  │     weight 540t
  │     lines-served Hokuriku Jōetsu
  │   }
  │ }
  └────

  The library is made of four modules : `Types', `Parse', `Pp' and
  `Query'.

  The `Types' module simply defines the following types, which are all
  you need to deal with scfg:

  ┌────
  │ (** A directive has a name, a list of parameters and children (a list of directive). *)
  │ type directive =
  │   { name : string
  │   ; params : string list
  │   ; children : directive list
  │   }
  │ 
  │ (** A config is a list of directives. *)
  │ type config = directive list
  └────

  The others modules can be used as follow:

  ┌────
  │ let file = {|
  │   train A-Train {
  │     bla bla bla
  │   }
  │   train "John Col Train" {
  │     tut tut tut
  │   }
  │ |}
  │ 
  │ (* parsing the file *)
  │ let config =
  │   (* there's also a `Parse.from_file` function that should be more useful *)
  │   match Scfg.Parse.from_string file with
  │   | Error e ->
  │     Format.eprintf "error: %s@." e;
  │     exit 1
  │   | Ok config -> config
  │ 
  │ (* printing the file *)
  │ let () =
  │   Format.printf "```scfg@.%a@.```@." Scfg.Pp.config config
  │ 
  │ (* querying the file *)
  │ let () =
  │   (* gets the first directive with the name `train` *)
  │   match Scfg.Query.get_dir "train" config with
  │   | None -> Format.printf "No train found.@."
  │   | Some train -> (
  │     (* get the parameter at index 0 in the `train` directive *)
  │     match Scfg.Query.get_param 0 train with
  │     | Error _e -> Format.printf "Train has no name.@."
  │     | Ok name -> Format.printf "The first train is `%s`.@." name )
  └────

  For more have a look at the [project's README], the [documentation] or
  feel free to ask here ! :partying_face:


[scfg] <https://git.zapashcanon.fr/zapashcanon/scfg>

[scfg configuration file format] <https://git.sr.ht/~emersion/scfg>

[sway] <https://swaywm.org/>

[project's README]
<https://git.zapashcanon.fr/zapashcanon/scfg/src/branch/master#scfg>

[documentation] <https://doc.zapashcanon.fr/scfg/>


Brr 0.0.3, a toolkit for programming browsers
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-brr-0-0-3-a-toolkit-for-programming-browsers/9252/1>


Daniel Bünzli announced
───────────────────────

  It's my pleasure to announce the release `0.0.3' of [`Brr'], a toolkit
  for programming browsers in OCaml with the [`js_of_ocaml'] compiler.

  Once it has made it to the repo, install with `opam install brr' and
  consult the [API docs and manuals] (or via `odig doc brr').

  Among small additions and fixes, this release brings support for
  `js_of_ocaml' 4.0.0. Thanks to Hugo Heuzard (@hhugo) who has made the
  ground work in `js_of_ocaml' this means that:

  1. `Brr', `js_of_ocaml' and ([soon]) `gen_js_api' JavaScript bindings
     can now all be used in the same program without problems (issue
     [#2]).
  2. You no longer need to specify the `-no-check-prim' flag at
     bytecode link time. Linking against the `brr' library is
     sufficient, see the [build instructions].

  The [release notes] have all the details.


[`Brr'] <https://erratique.ch/software/brr>

[`js_of_ocaml'] <https://ocsigen.org/js_of_ocaml>

[API docs and manuals] <https://erratique.ch/software/brr/doc/>

[soon] <https://github.com/LexiFi/gen_js_api/pull/164>

[#2] <https://github.com/dbuenzli/brr/issues/2>

[build instructions]
<https://erratique.ch/software/brr/doc/web_page_howto.html>

[release notes]
<https://github.com/dbuenzli/brr/blob/master/CHANGES.md#v003-2022-01-30-la-forclaz-vs>


(anonymous?) polymorphic records
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/anonymous-polymorphic-records/9256/1>


nrolland asked
──────────────

  Is there a way to avoid to create records only to preserve
  polymorphism ?

  Say, for this, in haskell style
  ┌────
  │ h :: (forall r. (r -> a) -> (f r -> f b)) -> f a -> f b
  │ h malg = malg id
  └────


octachron replied
─────────────────

  You can use objects, they can have polymorphic methods:

  ┌────
  │ let f (id:<f:'a. 'a -> 'a>) = id#f 0, id#f "zero"
  └────


Maëlan also replied
───────────────────

  The following doesn’t help reducing the syntactic noise, but note that
  when using a record for non-prenex polymorphism like this, your record
  has only one field and is immutable, so (with a recent enough OCaml)
  you can unbox it and get rid of the runtime overhead:

  ┌────
  │ type ('a, 'b) fwrap = { f : 'r. ('r -> 'a) -> 'r list -> 'b list } [@@unboxed]
  │ 
  │ let apply_id : type a b. (a, b) fwrap -> a list -> b list =
  │   fun w xs -> w.f Fun.id xs
  │ (* is compiled the same as just: *)
  │ let apply_id_magic : type a b. (a, b) fwrap -> a list -> b list =
  │   fun w xs -> (Obj.magic w) Fun.id xs
  │ 
  │ let mwrap : type a. (a, a) fwrap = { f = List.map }
  │ (* is compiled to nothing at all (alias of List.map). *)
  └────


2 postdoc positions on Runtime Verification at CEA LIST, Université Paris-Saclay, France
════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-02/msg00001.html>


Julien Signoles announced
─────────────────────────

  The Software Safety and Security Lab at CEA LIST, Université
  Paris-Saclay, France has 2 open postdoc positions in the area of
  runtime verification for code safety and security:

  • Designing Compilation Techniques for Improving Efficiency of E-ACSL,
    a Runtime Assertion Checker for C Programs

    <http://julien-signoles.fr/positions/postdoc-eacsl.pdf>

  • Control Flow Integrity for Remote Attestation

    <http://julien-signoles.fr/positions/postdoc-cfi.pdf>

  The candidates will:
  • solve challenging research problems;
  • implement their results in Frama-C, an industrial-strength
    open-source framework for analyses of C code;
  • evaluate their solutions on concrete benchmarks or/and use cases;
  • publish their results in international conferences and journals.

  Strong knowledge in at least one of the following areas is welcome:
  • programming
    • OCaml and C
    • formal semantics
  • formal verification
    • runtime verification, static analysis, formal specification
      languages, …
  • compilation
    • code generation, program transformation, type system, …

  Interested applicants should send a CV and a motivation letter to
  Julien Signoles (julien dot signoles at cea dot fr).


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-01-25 12:44 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-01-25 12:44 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of January 18 to 25,
2022.

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

wu-manber-fuzzy-search 0.1.0 (new library)
findlib-1.9.2
Signals and Threads on Memory Management
OCaml 4.14.0, first alpha release
A brief survey for Learn-OCaml Community
Blog post: Js_of_ocaml, a bundle size study
Interesting OCaml Articles
Old CWN


wu-manber-fuzzy-search 0.1.0 (new library)
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-wu-manber-fuzzy-search-0-1-0-new-library/9173/1>


Ifaz Kabir announced
────────────────────

  I'm happy to introduce wu-manber-fuzzy-seach, my library for doing
  fuzzy searches using the Wu and Manber fuzzy search algorithm.

  The novel part of this library particularly, when compared to
  `agrep/ocamlagrep', is that I additionally provide a right-leaning
  variant of the algorithm. The variant reports better matches and error
  counts when looking at the first match. Here's an example of the
  differences.

  ┌────
  │ # open Wu_Manber;;
  │ # StringSearch.(search ~k:2 ~pattern:"brown" ~text:"quick brown fox" |> report);;
  │ - : string = "Pattern matched with 2 errors at character 9 of text"
  │ # StringSearch.(search_right_leaning ~k:2 ~pattern:"brown" ~text:"quick brown fox" |> report);;
  │ - : string = "Pattern matched with 0 errors at character 11 of text"
  └────

  It's a pure OCaml implementation, using `Optint.Int63.t' as
  bit-vectors. I don't current support all the extensions that
  `agrep/ocamlagrep' supports, and will definitely not match the
  performance: OCaml+C vs pure OCaml.

  The documentation for the library can be found [here].

  It's not on `opam' yet, but there is a [PR].

  Expect more bitvector, Levenshtein distance, and fuzzy search
  shenanigans in the near future!


[here] <https://ifazk.github.io/wu-manber-fuzzy-search/>

[PR] <https://github.com/ocaml/opam-repository/pull/20479>


findlib-1.9.2
═════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2022-01/msg00040.html>


Gerd Stolpmann announced
────────────────────────

  findlib-1.9.2 is out. The only change is a fix for a build problem
  regarding the OCaml-5 trunk.

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

  <http://projects.camlcity.org/projects/findlib.html>

  An updated OPAM package will follow soon.


Signals and Threads on Memory Management
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/signals-and-threads-on-memory-management/9190/1>


gasche said
───────────

  I just had an excellent time listening to the last Signals and Threads
  podcast episode on [Memory Management], with Stephen Dolan (@stedolan)
  as the guest and Yaron Minsky (@Yaron_Minsky) as the host discussing:
  • memory management in programming languages in general
  • memory management in OCaml
  • ongoing research by Stephen and Leo White (@lpw25) on
    memory-management and data-representation features for OCaml
    (unboxed types, local values on the stack).

  The link <https://signalsandthreads.com/memory-management/> contains
  both the audio and a full text transcript.

  I would warmly recommend giving it a try if you are interested in
  programming language implementation. There is new stuff to learn for
  everyone, and I also liked the presentation of the parts I was already
  familiar with.


[Memory Management] <https://signalsandthreads.com/memory-management/>


Yaron Minsky replied
────────────────────

  Thanks for the nice words. Interviewing Dolan was fun and I learned a
  lot.

  Local types are still very new: we're hoping to start rolling it out
  in a limited way internally in the next few weeks, and I expect we'll
  learn a lot from that. We plan on discussing it more publicly as well,
  but that's a bit farther out. In the meantime, the source is all
  available [on Github] if anyone wants to poke around.

  The approach to stack allocation is different and simpler than the one
  in Rust, as Dolan explained in the episode.  Instead of having
  implicit, polymorphic lifetime variables, function arguments can be
  marked as local, which prevents the function in question from stashing
  a reference to those types. This avoids the need to deal with
  higher-rank polymorphism, which Rust's lifetime approach requires, and
  as a result makes inference work nicely.

  Another neat trick is that you can create functions that can allocate
  on the parent stack frame (by dint of not having their own stack
  frame). This lets you build smart constructors for stack-allocated
  values.

  Local types are apparently an example of modal types, though I don't
  really know enough type theory to have a deep sense of what that
  means. But it's a powerful thing, and local types appear to be useful
  for more than just stack allocation, as we're just starting to
  discover.


[on Github] <https://github.com/ocaml-flambda/ocaml-jst>


Yaron Minsky then added
───────────────────────

  And, I suppose as I should always mention: we're looking for people to
  come and work with Dolan and Leo and the rest of the team on this kind
  of stuff.

  More here:

  <https://blog.janestreet.com/applied-PL-research/>


OCaml 4.14.0, first alpha release
═════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-14-0-first-alpha-release/9191/1>


octachron announced
───────────────────

  The set of new features for the future version 4.14.0 of OCaml has
  been (finally) stabilized, three months after the release of OCaml
  4.13.1. I am thus happy to announce the first alpha release for OCaml
  4.14.0 .

  This alpha version is here to help fellow hackers join us early in our
  bug hunting and opam ecosystem fixing fun (see below for the
  installation instructions). You can see the progress on this front at
  <https://github.com/ocaml/opam-repository/issues/20501> .

  If you find any bugs, please report them here:

  <https://github.com/ocaml/ocaml/issues>

  Most major OCaml developer tools are already supported with this alpha
  (from odoc to merlin), thus I expect us to switch to beta releases in
  the beginning of February. The full release is expected to happen in
  late February.

  This early release will give us time to focus on the release of OCaml
  5.0.

  If you are interested by the list of new features and the ongoing list
  of bug fixes, the updated change log for OCaml 4.14.0 is available at:

  <https://github.com/ocaml/ocaml/blob/4.14/Changes>

  Happy hacking, Florian Angeletti for the OCaml team.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands
  ┌────
  │ opam update
  │ opam switch create 4.14.0~alpha1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  With opam 2.1, the previous command line can be simplified to
  ┌────
  │ opam update
  │ opam switch create 4.14.0~alpha1
  └────
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.14.0~alpha1+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  or with opam 2.1:
  ┌────
  │ opam update
  │ opam switch create <switch_name> ocaml-variants.4.14.0~alpha1+options <option_list>
  └────

  where `<option_list>' is a comma separated list of ocaml-option-*
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 4.14.0~alpha1+flambda+nffa ocaml-variants.4.14.0~alpha1+options ocaml-option-flambda
  │ ocaml-option-no-flat-float-array
  └────
  All available options can be listed with `opam search ocaml-option'.

  If you want to test this version, it is advised to install the alpha
  opam repository

  <https://github.com/kit-ty-kate/opam-alpha-repository>

  with
  ┌────
  │ opam repo add alpha git://github.com/kit-ty-kate/opam-alpha-repository.git
  └────
  This alpha repository contains various fixes in the process of being
  upstreamed.

  The source code for the alpha is also available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/4.14.0-alpha1.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~alpha1.tar.gz>


A brief survey for Learn-OCaml Community
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/a-brief-survey-for-learn-ocaml-community/9193/1>


Erik Martin-Dorel announced
───────────────────────────

  [This post is just a follow-up of an earlier message on [caml-list],
  intended to reach more learn-ocaml instructors, so you can ignore this
  one if you already replied!]

  The OCaml Software Foundation is developing the teaching platform
  Learn-OCaml that provides auto-graded exercises for OCaml, and was
  initially authored by OCamlPro for the OCaml MOOC:
  <https://ocaml-sf.org/learn-ocaml>.

  The platform is free software and easy to deploy; this is great, but
  as a result we keep learning of users/deployments that we had no idea
  of. We would be interested in having a better view of our user-base.

  If you use Learn-OCaml as a teacher, could you fill *[this Evento
  survey]* to let us know?  (the survey will be closed on 2022-02-07)

  → It contains these questions:
  • Where are you using Learn-OCaml? (in which university (a specific
    course?), which company, online community or…?)
  • Would you like to see your university/company added in
    [github.com/ocaml-sf/learn-ocaml-places]?
  • How many students/learners use your deployment in a year?

  And just to recall, a few links:

  • For an example of Learn-OCaml instance, see
    <https://discuss.ocaml.org/t/interesting-ocaml-exercises-from-francois-pottier-available-online/7050>
  • Last October we had a 0.13.0 release with several new features:
    <https://discuss.ocaml.org/t/ann-release-of-ocaml-sf-learn-ocaml-0-13-0/8577>
  • For any question related to Learn-OCaml, feel free to create a
    discussion topic on <https://discuss.ocaml.org>, category
    *`Community'*, tag *`learn-ocaml'* (/similarly to this discussion
    topic!/ :slight_smile:)
  • And if need be, opening an issue in
    <https://github.com/ocaml-sf/learn-ocaml/issues> if of course warmly
    welcome as well.


[caml-list]
<https://sympa.inria.fr/sympa/arc/caml-list/2021-12/msg00007.html>

[this Evento survey]
<https://evento.renater.fr/survey/learn-ocaml-community-survey-vsn3yc7j>

[github.com/ocaml-sf/learn-ocaml-places]
<https://github.com/ocaml-sf/learn-ocaml-places#readme>


Blog post: Js_of_ocaml, a bundle size study
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/blog-post-js-of-ocaml-a-bundle-size-study/9211/1>


Javier Chávarri announced
─────────────────────────

  Hi all, I hope your Monday is going great. :slight_smile:

  I wanted to analyze bundle size performance in Js_of_ocaml, so I
  rewrote an existing ReScript web app to compare both outputs.

  Here is the blog post with all the data, conclusions, and takeaways:

  <https://www.javierchavarri.com/js_of_ocaml-bundle-size-study/>

  It has been a very interesting experiment, that helped me learn more
  about Js_of_ocaml and the way it generates JavaScript code, and also
  improve some small things along the way in the libraries I was using
  for the project.

  The conclusions, while maybe already known by others, are also quite
  exciting to me, as the experiment confirms my suspicion that
  Js_of_ocaml bundle size scales just fine as applications get more
  complex, so it is suitable for a quite significant number of real
  world scenarios.

  I hope you find it interesting and exciting as well. Please share any
  feedback you might have! Or any questions if anything is unclear.


Interesting OCaml Articles
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/interesting-ocaml-articles/1867/94>


Yotam Barnoy said
─────────────────

  <https://blog.darklang.com/first-thoughts-on-rust-vs-ocaml/#tooling-musing>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-01-11  8:20 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-01-11  8:20 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of January 04 to 11,
2022.

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

New release of PPrint (20220103)
Bogue, the OCaml GUI
Cohttp 5.0.0 and 2.5.6
Multicore OCaml: December 2021 and the Big PR
Set up OCaml 2.0.0-beta12
Old CWN


New release of PPrint (20220103)
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-new-release-of-pprint-20220103/9097/1>


François Pottier announced
──────────────────────────

  I am pleased to announce a new release of PPrint, the pretty-printing
  library, with [improved documentation].

  The documentation can also be viewed offline:

  ┌────
  │ opam update
  │ opam install pprint.20220103
  │ opam install odig
  │ odig odoc                 # this may take some time
  │ odig doc pprint           # this opens the doc in your browser
  └────

  Happy pretty-printing!


[improved documentation]
<http://cambium.inria.fr/~fpottier/pprint/doc/pprint/>


Bogue, the OCaml GUI
════════════════════

  Archive: <https://discuss.ocaml.org/t/ann-bogue-the-ocaml-gui/9099/1>


sanette announced
─────────────────

  I'm happy to announce a brand new version of [Bogue], a GUI (Graphical
  User Interface) library entirely written in `ocaml', using SDL2 for
  hardware accelerated graphics.

  The doc can be found [here], it will be enriched over time.

  Install with `opam install bogue'

  In addition to the library, this installs an executable `boguex' to
  showcase about 50 useful constructions, see `boguex -h' for the list.

  Some screenshots of a demo compiled with the latest version:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/6/619a6b3c5d7a9860e4c24df7d8b931815e9b95a1.png>

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/3/3e5e04d1db0022d4070b7fd3dab45f4399828e90.png>

  Note that many widgets are not shown in this demo: tables, menus,
  drop-down select lists, knob buttons,… I will add more images to the
  doc when I have some time!


[Bogue] <https://github.com/sanette/bogue>

[here] <http://sanette.github.io/bogue/Principles.html>


Cohttp 5.0.0 and 2.5.6
══════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-cohttp-5-0-0-and-2-5-6/9109/1>


Marcello Seri announced
───────────────────────

  We are glad to announce the release of version [5.0.0] and [2.5.6] of
  cohttp and its dependent packages.

  The latter is a bug fix release that in particular backports the
  compatibility with the upcoming release 0.15 of core and async.

  The first introduces the breaking changes [announced in the previous
  release]. I append the changelog below, which explains in details the
  changes and emphasizes the breaking changes:


[5.0.0]
<https://github.com/ocaml/opam-repository/pull/20246#issue-1080986510>

[2.5.6]
<https://github.com/ocaml/opam-repository/pull/20245#issue-1080822215>

[announced in the previous release]
<https://discuss.ocaml.org/t/ann-release-of-cohttp-4-0-0/7537>

Cohttp.Header: new implementation (lyrm #747)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • New implementation of Header modules using an associative list
    instead of a map, with one major semantic change (function `get',
    see below), and some new functions (`clean_dup', `get_multi_concat')
  • More Alcotest tests as well as fuzzing tests for this particular
    module.


Purpose
┄┄┄┄┄┄┄

  The new header implementation uses an associative list instead of a
  map to represent headers and is focused on predictability and
  intuitivity: except for some specific and documented functions, the
  headers are always kept in transmission order, which makes debugging
  easier and is also important for [RFC7230§3.2.2] that states that
  multiple values of a header must be kept in order.

  Also, to get an intuitive function behaviour, no extra work to enforce
  RFCs is done by the basic functions. For example, RFC7230§3.2.2
  requires that a sender does not send multiple values for a non
  list-value header. This particular rule could require the `Header.add'
  function to remove previous values of non-list-value headers, which
  means some changes of the headers would be out of control of the
  user. With the current implementation, an user has to actively call
  dedicated functions to enforce such RFCs (here `Header.clean_dup').


[RFC7230§3.2.2] <https://tools.ietf.org/html/rfc7230#section-3.2.2>


Semantic changes
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  Two functions have a semantic change : `get' and `update'.


get
┈┈┈

    `get' was previously doing more than just returns the value
  associated to a key; it was also checking if the searched header could
  have multiple values: if not, the last value associated to the header
  was returned; otherwise, all the associated values were concatenated
  and returned. This semantics does not match the global idea behind the
  new header implementation, and would also be very inefficient.

  ⁃ The new `get' function only returns the last value associated to the
    searched header.
  ⁃ `get_multi_concat' function has been added to get a result similar
    to the previous `get' function.


update
┈┈┈┈┈┈

  `update' is a pretty new function (#703) and changes are minor and
  related to `get' semantic changes.

  ⁃ `update h k f' is now modifying only the last occurrences of the
    header `k' instead of all its occurrences.
  ⁃ a new function `update_all' function has been added and work on all
    the occurrences of the updated header.


New functions :
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  ⁃ `clean_dup' enables the user to clean headers that follows the
    [RFC7230§3.2.2] (no duplicate, except `set-cookie')
  ⁃ `get_multi_concat' has been added to get a result similar to the
    previous `get' function.


[RFC7230§3.2.2] <https://tools.ietf.org/html/rfc7230#section-3.2.2>


Cohttp.Header: performance improvement (mseri, anuragsoni #778)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

    *Breaking* the headers are no-longer lowercased when parsed, the
  headers key comparison is case insensitive instead.


cohttp-lwt-unix: Adopt ocaml-conduit 5.0.0 (smorimoto #787)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  *Breaking* `Conduit_lwt_unix.connect''s `ctx' param type chaged from
   `ctx' to `ctx Lazy.t'


other changes
╌╌╌╌╌╌╌╌╌╌╌╌╌

  • cohttp-mirage: fix deprecated fmt usage (tmcgilchrist #783)
  • lwt_jsoo: Use logs for the warnings and document it (mseri #776)
  • lwt: Use logs to warn users about leaked bodies and document it
    (mseri #771)
  • lwt, lwt_unix: Improve use of logs and the documentation, fix bug in
    the Debug.enable_debug function (mseri #772)
  • lwt_jsoo: Fix exception on connection errors in chrome (mefyl #761)
  • lwt_jsoo: Fix `Lwt.wakeup_exn' `Invalid_arg' exception when a js
    stack overflow happens in the XHR completion handler (mefyl #762).
  • lwt_jsoo: Add test suite (mefyl #764).

  We wish to thank to all the users and the contributors for their help
  leading to this release.


Multicore OCaml: December 2021 and the Big PR
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/multicore-ocaml-december-2021-and-the-big-pr/9115/1>


Anil Madhavapeddy announced
───────────────────────────

  Welcome to the December 2021 [Multicore OCaml] monthly report!  The
  [previous updates] along with this update have been compiled by
  myself, @ctk21, @kayceesrk and @shakthimaan.

  Well, it's finally here! @kayceesrk opened the [Multicore OCaml
  PR#10831] to the main OCaml development repository that represents the
  "minimum viable" implementation of multicore OCaml that we decided on
  in [November's core team review].  The branch pushes the limits of
  GitHub's rendering capability, with around 4000 commits.

  Once the PR was opened just before Christmas, the remaining effort has
  been for a number of developers to pore over [the diff] and look for
  any unexpected changes that crept in during multicore development. A
  large number of code changes, improvements and fixes have been merged
  into the ocaml-multicore trees since the PR was opened to facilitate
  this upstreaming process. We're expecting to have the PR merged during
  January, and then will continue onto the "post-MVP" tasks described
  last month, but working directly from ocaml/ocaml from now on.  We
  therefore remain on track to release OCaml 5.00 in 2022.

  In the multicore ecosystem, progress also continued:
  • `Eio' continues to improve as the recommended effects-based
    direct-style IO library to use with Multicore OCaml.
  • A newer `domainslib.0.4.0' has been released that includes bug fixes
    and API changes.
  • The continuous benchmarking pipeline with further integration
    enhancements between Sandmark and current-bench is making progress.

  We would like to acknowledge the following external contributors as
  well::

  • Danny Willems (@dannywillems) for an OCaml implementation of the
    Pippenger benchmark and reporting an undefined behaviour.
  • Matt Pallissard (@mattpallissard) reported an installation issue
    with `Eio' with vendored uring.
  • Edwin Torok (@edwintorok) for contributing a PR to `domainslib' to
    allow use of a per-channel key.

  As always, the Multicore OCaml updates are listed first, which contain
  the upstream efforts, improvements, fixes, test suite, and
  documentation changes. This is followed by the ecosystem updates to
  `Eio', `Tezos', and `Domainslib'.  The Sandmark, sandmark-nightly and
  current-bench tasks are finally listed for your reference.

  /editor’s note: please follow the archive link above for the full
  changelog./


[Multicore OCaml] <https://github.com/ocaml-multicore/ocaml-multicore>

[previous updates] <https://discuss.ocaml.org/tag/multicore-monthly>

[Multicore OCaml PR#10831] <https://github.com/ocaml/ocaml/pull/10831>

[November's core team review]
<https://discuss.ocaml.org/t/multicore-ocaml-november-2021-with-results-of-code-review/8934#core-team-code-review-1>

[the diff] <http://github.com/ocaml/ocaml/pull/10831.diff>


Stéphane Lavergne asked and Robin Björklin replied
──────────────────────────────────────────────────

        To clarify for relative newbies like myself: this would be
        a new way to do concurrent I/O, like Async and Lwt, but
        unlike those, it wouldn't require the use of a promise
        monad? In other words, does this mean that we'll have the
        choice between Async, Lwt and Eio in the near future for
        our concurrent I/O needs?

  That's correct as far as I can tell. This presentation provides an
  introduction to the current state of eio:
  <https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5-c6bb9092be89>


Set up OCaml 2.0.0-beta12
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta12/9123/1>


Sora Morimoto announced
───────────────────────

Fixed
╌╌╌╌╌

  • Fallback to the version in which the assets exist if no assets exist
    in the latest opam release.
  • Instruct Cygwin setup to use "sys" symlinks during setup (partial
    workaround for bug with native symlinks in Cygwin setup - some
    depexts may still be affected)

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta12>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2022-01-04  7:56 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2022-01-04  7:56 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of December 28, 2021
to January 04, 2022.

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

A hack for toplevel breakpoints using effect handlers
Multi-shot continuations gone forever?
New release of Menhir (20211230)
Improved documentation for Fix
pp-binary-ints 0.1.1
Old CWN


A hack for toplevel breakpoints using effect handlers
═════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/a-hack-for-toplevel-breakpoints-using-effect-handlers/9065/1>


wiktor announced
────────────────

  I started playing with effect handlers and wondered if they could be
  used to implement toplevel breakpoints. It's a big hack and probably
  unsound at the moment, but it works and here's an example interaction:

  ┌────
  │ let arr =
  │   let fact n =
  │     let arr = Array.make (n+1) 1 in
  │     let rec loop i =
  │       if i <= n then begin
  │ 	Break.break ["i", i; "arr", arr];
  │ 	arr.(i) <- arr.(i-1) * i;
  │ 	loop (i+1)
  │       end
  │     in
  │     (loop 1; arr)
  │   in
  │     fact 5;;
  │ # (* We hit a breakpoint and obtain the continuation k *)
  │   k ();;
  │ - : bool = true
  │ # (* the bools are leaking from the execute_phrase function
  │    * inside the toplevel *)
  │   k ();;
  │ - : bool = true
  │ # i;;
  │ - : int = 3
  │ # arr;;
  │ - : int array = [|1; 1; 2; 1; 1; 1|]
  │ # (* let's disturb the computation of factorials *)
  │   arr.(i-1) <- 42;;
  │ - : unit = ()
  │ # k ();;
  │ - : bool = true
  │ # (* btw: here the user is like a scheduler for yield-based async *)
  │   k ();;
  │ - : bool = true
  │ # k ();;
  │ val arr : int array = [|1; 1; 42; 126; 504; 2520|]
  │ - : bool = true
  └────

  Currently I don't try to clean up bindings or values, which is a
  source of unsoundness. After the last `k ()' we got two results: First
  the computation of `let arr ...' finished, and then the computation of
  `k ()' finished. But `k' is a part of the execution of `let arr ...',
  so these two executions "intersect" without one being contained in the
  other. This makes the question of what should the current variable
  bindings be complicated. Setting the bindings at end of execution is
  futile, when a continuation may in such a way leak bindings from
  breakpoint time.

  Possibly a stack discipline for the execution of phrases is required
  to make the environments behave properly: at the end of executing a
  phrase we cancel (with another effect, maybe) other executions which
  "depend" on the current execution (evaluate the `k' obtained from a
  breakpoint in the current execution). This should eliminate these
  "intersections" and we could throw out the bindings added by the
  cancelled executions.

  I haven't tried anything with polymorphism yet, but type variables
  should probably be changed into abstract types inside the binders.

  Here's the code:
  <https://github.com/ocaml-multicore/ocaml/compare/multicore-pr...wiktorkuchta:toplevel-break>


wiktor later said
─────────────────

  Well, this might have been unnecessary, as most of it can be done
  properly in userspace (with more syntactic overhead).

  ┌────
  │ open EffectHandlers
  │ open Deep
  │ 
  │ type ('a, 'b) res =
  │   | Bp of 'a * ((unit, ('a, 'b) res) continuation)
  │   | Fin of 'b
  │ 
  │ module type P1 = sig  val i : int  val arr : int array end
  │ type payload = P1 of (module P1)
  │ type _ eff += Break : payload -> unit eff
  │ 
  │ let arr () =
  │   let fact n =
  │     let arr = Array.make (n+1) 1 in
  │     let rec loop i =
  │       if i <= n then begin
  │ 	perform (Break (P1 (module struct let i = i let arr = arr end)));
  │ 	arr.(i) <- arr.(i-1) * i;
  │ 	loop (i+1)
  │       end
  │     in
  │     (loop 1; arr)
  │   in
  │     fact 5;;
  │ 
  │ let with_break th =
  │   try_with (fun () -> Fin (th ())) ()
  │   { effc = fun (type a) (e : a eff) ->
  │       match e with
  │       | Break p -> Some (fun (k : (a,_) continuation) -> Bp (p, k))
  │       | _ -> None }
  │ 
  │ let cont = function
  │   | Bp (_, k) -> continue k ()
  │   | Fin _ -> failwith "computation finished, cannot continue"
  │ 
  │ let get = function
  │   | Bp (r, _) -> r
  │   | Fin _ -> failwith "computation finished, no breakpoint payload"
  │ 
  │ let get1 r = match get r with P1 m -> m
  └────

  ┌────
  │ # let r = with_break arr;;
  │ val r : (payload, int array) res = Bp (P1 <module>, <abstr>)
  │ # open (val get1 r);;
  │ val i : int = 1
  │ val arr : int array = [|1; 1; 1; 1; 1; 1|]
  └────

  The main pain point is having to define the payload types. In basic
  cases the payload type could be just a simple polymorphic variant. It
  would be nice if it could be completely inferred, but it's unlikely as
  `Break` has to have a statically known argument.

  With a bit of help from tooling (ppxes for code generation and
  shorthands in the toplevel), this could be better than printf
  debugging.


Guillaume Munch-Maccagnoni then said
────────────────────────────────────

  This is an interesting experiment.
  • This reminds me of the idea of high-level stack inspection for
    debugging and security (articulated for instance in Clements' PhD
    thesis _[Portable and high-level access to the stack with
    Continuation Marks]_; here's [another more recent paper] from the
    Racket people that might be relevant). One can ask whether a PPX can
    provide high-level stack inspection or if one needs support from the
    compiler for that. It's nice to experiment.
  • A few years ago someone asked whether there could be a use to
    untyped algebraic effects in OCaml (in the sense that they do not
    appear in the effect annotation in function types). I proposed
    debugging as an example. Someone suggested that it is not too hard
    to adapt the interface types of all functions in the call chain to
    add the appropriate effect annotation (and remove it afterwards),
    but I was not convinced.


[Portable and high-level access to the stack with Continuation Marks]
<https://www2.ccs.neu.edu/racket/pubs/dissertation-clements.pdf>

[another more recent paper]
<https://dl.acm.org/doi/10.1145/3385412.3385981>


Multi-shot continuations gone forever?
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/multi-shot-continuations-gone-forever/9072/1>


cyberpink asked
───────────────

  What happens with multi-shot continuations now that
  Obj.clone_continuation was removed?
  ([https://github.com/ocaml-multicore/ocaml-multicore/pull/651])

  Anything that requires a "fork" operation, like say, a probabilistic
  programming EDSL, needs this. None of the old examples I've looked at
  like [Delimcc on top of effects] have been updated to use a new
  method, and I haven't been able to find any hints of one.

  Are multi-shot continuations just not possible now? Are there plans to
  add something equivalent back in later?


[https://github.com/ocaml-multicore/ocaml-multicore/pull/651]
<https://github.com/ocaml-multicore/ocaml-multicore/pull/651>

[Delimcc on top of effects]
<https://github.com/ocaml-multicore/effects-examples/blob/master/delimcc.ml>


Nicolás Ojeda Bär replied
─────────────────────────

  Yes, multi-shot continuations are gone and is unlikely that they will
  find their way back any time soon. One (good) reason is explained in
  <https://dl.acm.org/doi/10.1145/3434314> :

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/8/8d26520ef0f790fd3dc4407458d925c1a28fdbca.png>

  and

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/b/b28fa14f967364743277c0132a804c430d2d66d1.png>


Guillaume Munch-Maccagnoni then said
────────────────────────────────────

  I think the question still stands. You cut the sentence “_Extending
  our system with multi-shot continuations is future work (§8)_”. Also
  the paper is about a particular model based on separation logic rather
  than OCaml itself (for instance the authors also mention that their
  continuations are affine instead of linear unlike in OCaml multicore).

  Nevertheless, the multicore designers were aware that duplicating
  continuations makes it complicated to reason about resources. The
  topic of mixing continuations and linearity has been better studied
  from the angle of algebraic models of computation and proof
  theory. Essentially, with an effect system you could ensure that
  certain kinds of effects do not happen in the delimited part of the
  program (including allocating a resource), which controls copiability
  of the stack from the point of view of reasoning about the
  program. This is inspired by some logics that mix classical and
  intuitionistic or linear logic. From this angle the ability to copy a
  continuation would be restricted to a sub-part of the language which
  is pure to some degree. This should also be a suitable starting point
  if one wanted to develop a program logic to formalise the reasoning
  about such programs.

  However according to [#651] there were more technical reasons to drop
  `clone_continuation', such as breaking compiler optimizations. I am
  curious as well to know whether there are plans to reintroduce
  `clone_continuation' at some point, but obviously this would require
  some effort.


[#651] <https://github.com/ocaml-multicore/ocaml-multicore/pull/651>


KC Sivaramakrishnan said
────────────────────────

  @nojb and @gadmm have already answered why we've dropped support for
  `clone_continuation' now. We will need to track the copiability of the
  continuation in the continuation type and compiler optimisations also
  need to be made aware of the possibility of copying. Given the
  pervasive nature of its effects, there are no immediate plans to bring
  the feature back. We will have to come back to this after we have
  typed effects.

        Anything that requires a “fork” operation, like say, a
        probabilistic programming EDSL

  One can get pretty far with PPL with just one-shot continuations. My
  student and I did some experiments building a DSL for a PPL to learn
  about the space: <https://github.com/Arnhav-Datar/EffPPL>. Having
  spoken to PPL experts there are indeed some usecases where multi-shot
  continuations are useful, but from what I understand, the one-shotness
  isn't a blocker for PPL.

  I would be interested in collecting usecases where multi-shot
  continuations are absolutely necessary.


gasche then said
────────────────

  Interesting!

  My (probably naive) mental model of HANSEI-style libraries, using
  multishot continuations, is that they are extensions/generalization of
  a non-probabilistic "logic/non-deterministic monad" that searches for
  the set of solutions to a problem. Multishot continuations are
  naturally used in non-deterministic computations at backtracking
  points, to explore different search directions and collect the
  result. It is possible to avoid multishot continuations by replaying
  the whole search from the start each time (reference: [Capturing the
  future by replaying the past]), but this involves duplicated
  computations so it is less efficient (reference: [Asymptotic speedup
  with first-class control]).

  Can you give some intuition of how other approaches to probalistic
  inference work, that do not require multishot continuations? Are they
  also duplicating computations, or are they using a magic trick to
  avoid this issue with a different inference algorithm?

  I tried to find an answer to this question by reading the [internship
  report], but I couldn't locate an answer. (The report mentions HANSEI
  in the related work, but it does not discuss this question.) The
  report explains that the inference algorithm, called HMC (Hamiltonian
  Monte Carlo), uses automatic differenciation; so it uses a sort of
  symbolic manipulation / analysis of the probabilistic program to
  sample. But does this avoid repeated computations?  It may be the case
  instead that the differential is as large or larger than the program
  itself, and that the search algorithm using this differential in
  effect perform a program-sized computation at each search step,
  duplicating computations.


[Capturing the future by replaying the past]
<https://arxiv.org/pdf/1710.10385>

[Asymptotic speedup with first-class control]
<https://arxiv.org/abs/2007.00605>

[internship report]
<https://github.com/Arnhav-Datar/EffPPL/blob/main/EffPPL_Report.pdf>


Sadiq said
──────────

  Not a PPL but I've been hacking on a little effects-based model
  checker for concurrent data structures that implements dynamic partial
  order reduction (<https://github.com/sadiqj/dscheck/> - a
  WIP!). Multi-shot continuations would have been very useful.

  I ended up implementing something that involves maintaining a schedule
  and repeatedly replaying the computation. It looks very similar to
  what [Capturing the future..] proposes.


[Capturing the future..] <https://arxiv.org/pdf/1710.10385>


New release of Menhir (20211230)
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-new-release-of-menhir-20211230/9077/1>


François Pottier announced
──────────────────────────

  Dear OCaml & Menhir users,

  I am pleased to announce a new release of Menhir, with a major
  improvement.

  The code back-end has been rewritten from the ground up by Émile
  Trotignon and by myself, and now produces efficient and well-typed
  OCaml code. The infamous Obj.magic is not used any more.

  Furthermore, the new code back-end produces code that is more
  aggressively optimized, leading to a significant reduction in memory
  allocation and a typical performance improvement of up to 20% compared
  to the previous code back-end.

  ┌────
  │ opam update
  │ opam install menhir.20211230
  └────

  Happy well-typed parsing in 2022!


2021/12/30
╌╌╌╌╌╌╌╌╌╌

  • The code back-end has been rewritten from the ground up by Émile
    Trotignon and François Pottier, and now produces efficient and
    *well-typed* OCaml code. The infamous `Obj.magic' is not used any
    more.

    The table back-end and the Coq back-end are unaffected by this
    change.

    The main side effects of this change are as follows:

    • The code back-end now needs type information. This means that
      /either/ Menhir's type inference mechanism must be enabled (the
      	 easiest way of enabling it is to use Menhir via `dune'
      	 and to check that the `dune-project' file says `(using
      	 menhir 2.0)' or later)
      /or/ the type of every nonterminal symbol must be explicitly given
           via a `%type' declaration.

    • The code back-end no longer allows the type of any symbol to be an
      open polymorphic variant type, such as `[> `A ]'. As a workaround,
      we suggest using a closed polymorphic variant instead.

    • The code back-end now adheres to the /simplified/ error-handling
      strategy, as opposed to the /legacy/ strategy.

      For grammars that do /not/ use the `error' token, this makes no
      difference.

      For grammars that use the `error' token in the limited way
      permitted by the simplified strategy, this makes no difference
      either. The simplified strategy makes the following requirement:
      the `error' token should always appear at the end of a production,
      whose semantic action should abort the parser by raising an
      exception.

      Grammars that make more complex use of the `error' token, and
      therefore need the `legacy' strategy, cannot be compiled by the
      new code back-end.  As a workaround, it is possible to switch to
      the table back-end (using `--table --strategy legacy') or to the
      ancient code back-end (using `--code-ancient'). *In the long run,
      we recommend abandoning the use of the `error' token*. Support for
      the `error' token may be removed entirely at some point in the
      future.

    The original code back-end, which has been around since the early
    days of Menhir (2005), temporarily remains available (using
    `--code-ancient'). It will be removed at some point in the future.

    The new code back-end offers several levels of optimization, which
    remain undocumented and are subject to change in the future. At
    present, the main levels are roughly as follows:

    • `-O 0 --represent-everything' uses a uniform representation of the
      stack and produces straightforward code.
    • `-O 0' uses a non-uniform representation of the stack; some stack
      cells have fewer fields; some stack cells disappear altogether.
    • `-O 1' reduces memory traffic by moving `PUSH' operations so that
      they meet `POP' operations and cancel out.
    • `-O 2' optimizes the reduction of unit productions (that is,
      productions whose right-hand side has length 1) by performing a
      limited amount of code specialization.

    The default level of optimization is the maximum level, `-O 2'.

  • The new command line switch `--exn-carries-state' causes the
    exception `Error' to carry an integer parameter: `exception Error of
    int'. When the parser detects a syntax error, the number of the
    current state is reported in this way. This allows the caller to
    select a suitable syntax error message, along the lines described in
    [Section 11] of the manual. This command line switch is currently
    supported by the code back-end only.

  • The `$syntaxerror' keyword is no longer supported.

  • Document the trick of wrapping module aliases in `open struct
    ... end', like this: `%{ open struct module alias M =
    MyLongModuleName end %}'.  This allows you to use the short name `M'
    in your grammar, but forces OCaml to infer types that refer to the
    long name `MyLongModuleName'.  (Suggested by Frédéric Bour.)


[Section 11]
<http://cambium.inria.fr/~fpottier/menhir/manual.html#sec68>


Improved documentation for Fix
══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-improved-documentation-for-fix/9079/1>


François Pottier announced
──────────────────────────

  My last contribution for 2021 is an improved documentation for Fix, a
  library that helps with various algorithmic constructions that involve
  memoization, recursion, and numbering.

  The documentation can be [viewed online].

  It can also be viewed locally (on your own machine) as follows:

  ┌────
  │ opam update
  │ opam install fix.20211231
  │ opam install odig
  │ odig odoc                 # this may take some time
  │ odig doc fix              # this opens the doc in your browser
  └────

  Happy fix'in' in 2022!


[viewed online] <http://cambium.inria.fr/~fpottier/fix/doc/fix/>


pp-binary-ints 0.1.1
════════════════════

  Archive: <https://discuss.ocaml.org/t/ann-pp-binary-ints-0-1-1/9080/1>


Ifaz Kabir announced
────────────────────

  Tired of printing octals and hexadecimals and then mentally converting
  them to bits. Ever wanted to just see the bits in an int? Now you can!

  Just run `opam install pp-binary-ints' and off you go:
  ┌────
  │ # Pp_binary_ints.Int.to_string 0b10101001;;
  │ - : string = "10101001"
  └────

  You can find the documentation for the project and more examples of
  how to use it [here].

  The library is very customizable.

  • You can choose to print with `0b' prefixes and `_' separators.
  • You can choose to print zeros just like the non-zeros, with prefixes
    and separators.
  • If you use zero padding, you can control how many leading zeros show
    up with the `~min_width' argument.
  • It correctly handles the edge cases when adding `_' separators: you
    won’t get leading underscores.
  • It includes pretty printers that work with `Format' and `Fmt' , not
    just `to_string' functions.
  • Supports `int', `int32', `int64', and `nativeint'.
  • Don't like the default prefixes and suffixes? Customize the prefixes
    and suffixes with the provided functor.


[here]
<https://ifazk.github.io/pp-binary-ints/pp-binary-ints/index.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
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-12-28  8:59 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-12-28  8:59 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of December 21 to 28,
2021.

Happy Winter Solstice!

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

New release of Feat
Debugger support for OCaml
Old CWN


New release of Feat
═══════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-12/msg00010.html>


François Pottier announced
──────────────────────────

  I am happy to announce a new release of Feat, a library that offers
  support for counting, enumerating, and sampling objects of a certain
  kind, such as (say) the inhabitants of an algebraic data type.

  This new release integrates a contribution by Jonah Beckford. The
  library is now split in three packages: `feat-core' is parameterized
  over an implementation of big integers; `feat' instantiates
  `feat-core' with big integers provided by `zarith'; `feat-num'
  instantiates it with big integers provided by `num'.

  ┌────
  │ opam update
  │ opam install feat
  │ # or: opam install feat-num
  └────

  More details can be found here:

  <https://gitlab.inria.fr/fpottier/feat/>


Debugger support for OCaml
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/debugger-support-for-ocaml/9057/1>


Christian Lindig asked
──────────────────────

  What is the current state of debugger support for OCaml? I am aware of
  ocamldebug but every time I'm trying to use it I feel thrown back to
  2000 where it essentially existed in the same form (and still has no
  command line editing built in). Despite the powerful concept of time
  traveling, it does not seem very useful today. For example, it can't
  be attached to a running program and it does not work with native
  code. What is the state of GDB support? What debugger would one use on
  macOS?


linoscope replied
─────────────────

  Have you taken a look at ocamlearlybird ([github], [announcement])? I
  have never used it myself, but based on [the demo] it seems pretty
  nice.


[github] <https://github.com/hackwaly/ocamlearlybird>

[announcement]
<https://discuss.ocaml.org/t/ann-ocamlearlybird-1-0-0-beta1/7180>

[the demo] <https://imgur.com/U3GDHXM>


Sid Kshatriya also replied
──────────────────────────

  I agree that debugging in OCaml seems to be stuck in time.

  This is extremely unfortunate because it is able to do time traveling
  (as you mention) which is something that many other languages still
  cannot boast.

  • `ocamldebug' does not work properly when there is more than 1 OS
    thread
  • As types are erased during compile time in OCaml, it can be
    difficult to debug polymorphic functions. Rust and C/C++
    monomorphise all code so there is never any confusion about the type
    of anything in the debugger. Golang and Java have type information
    available during runtime so again, debugging is easy. In this
    respect OCaml is similar to Haskell while using the byte-code
    debugger.
  • The future of ocamldebug is unknown on multicore

  As far as GDB support is concerned, there was a project to improve GDB
  support (so you could print out variables like in ocamldebug IIUC) but
  it never got merged into trunk.

  However, if you are interested in low level debugging in gdb, here is
  a [recent] answer related to this.

  My guess is that `ocamldebug' will continue to work for the single
  domain, single thread case in OCaml 5.00 but ocamldebug is currently
  broken in multicore there (AFAIK).


[recent]
<https://discuss.ocaml.org/t/multicore-ocaml-september-2021-effect-handlers-will-be-in-ocaml-5-0/8554/9>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-12-21  9:11 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-12-21  9:11 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of December 14 to 21,
2021.

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

Are you teaching using the Learn-OCaml platform?
A SOCKS implementation for OCaml
Old CWN


Are you teaching using the Learn-OCaml platform?
════════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-12/msg00007.html>


Erik Martin-Dorel announced
───────────────────────────

  The OCaml Software Foundation is developing the teaching platform
  Learn-OCaml that provides auto-graded exercises for OCaml, and was
  initially authored by OCamlPro for the OCaml MOOC:
  <https://ocaml-sf.org/learn-ocaml/>

  The platform is free software and easy to deploy; this is great, but
  as a result we keep learning of users/deployments that we had no idea
  of. We would be interested in having a better view of our
  user-base. If you use Learn-OCaml as a teacher, could you answer this
  email (To: e.mdorel@gmail.com) and let us know?

  Ideally we would like to know:

  • Where are you using Learn-OCaml?  → in which university (in a
    specific course?), or in which company, online community or … ?
  • How many students/learners use your deployment in a year?

  Also FYI:

  • For an example of Learn-OCaml instance, see
    <https://discuss.ocaml.org/t/interesting-ocaml-exercises-from-francois-pottier-available-online/7050>
  • Last October we had a 0.13.0 release, full of new features:
    <https://discuss.ocaml.org/t/ann-release-of-ocaml-sf-learn-ocaml-0-13-0/8577>
  • For any question related to Learn-OCaml, feel free to create a
    discussion topic on <https://discuss.ocaml.org/> , category
    Community, tag /learn-ocaml/.
  • And if need be, opening an issue in
    <https://github.com/ocaml-sf/learn-ocaml/issues> if of course warmly
    welcome as well.


A SOCKS implementation for OCaml
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/a-socks-implementation-for-ocaml/9041/1>


Renato Alencar announced
────────────────────────

  I have been working on a SOCKS implementation for OCaml and specially
  for MirageOS. It's not really complete or stable yet (not even
  published), it only has a couple of proof of concepts on the examples
  directory and it doesn't integrate with the well known libraries of
  the ecosystem.

  I would like to ask for feedback, and some thoughts about how could we
  have that in Conduit and Cohttp for example, so It'd be just plugged
  in into those libraries without having to directly depending on it. I
  plan to implement that for those libraries and have it submitted
  upstream, but not without some clear thoughts about how to make a
  clear interface for that.

  Besides being sloppy, I have a few issues described on GitHub, and it
  should be addressed on the next few days. Anyone is welcome to discuss
  those issues as some of them are still foggy for me, and having some
  other views on that would be great.

  <https://github.com/renatoalencar/ocaml-socks-client>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-12-14 11:02 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-12-14 11:02 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of December 07 to 14,
2021.

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

kqueue-ml 0.2.0 and poll 0.1.0
SWIPl-OCaml v0.5 - Never write your own unification algorithms again!
opam 2.1.2
Set up OCaml 2.0.0-beta10
A hassle-free setup to release binaries for different platforms: the opam release process experiment
Set up OCaml 2.0.0-beta11
What's the best way to save an huge amount of data in a file
p5scm 0.1.0
nanoid 1.0.0
Other OCaml News
Old CWN


kqueue-ml 0.2.0 and poll 0.1.0
══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-kqueue-ml-0-2-0-and-poll-0-1-0/8958/1>


Anurag Soni announced
─────────────────────

  I'd like to announce new releases for [kqueue-ml] (version 0.2.0) and
  an initial release of [poll] (version 0.1.0).

  *Kqueue-ml*: Thin bindings to the kqueue event notification
   system. Changes since the last release:

  • Remove dependency on ctypes
  • Limit support to 64 bit systems
  • Adds constant values to be used as filter flags in the public API

  Installation: [opam install kqueue]

  Caveat: This is again mostly tested on macOS, but I plan to work on
  testing and fixing bugs for getting the library to work well on the
  various BSD systems, so please open issues if you use it on a BSD
  system and notice problems (Thanks!).

  *Poll*: Portable OCaml interface to macOS/Linux/Windows native IO
   event notification mechanisms

  Installation: [opam install poll]

  This is the first release of poll, which builds on top of `kqueue-ml'
  and adds bindings to the system IO event notifications on linux and
  windows to provide a portable polling interface. It uses kqueue on
  macOS, epoll on linux, and uses [wepoll] on windows so it can leverage
  IOCP on windows instead of select. All io events will be level
  triggered, i.e. there will be a notification as long as the file
  descriptor being watched is ready to read/write.

  If you experience any problems, please open an issue on the Github
  Issue tracker :slightly_smiling_face:


[kqueue-ml] <https://github.com/anuragsoni/kqueue-ml/>

[poll] <https://github.com/anuragsoni/poll>

[opam install kqueue] <https://opam.ocaml.org/packages/kqueue/>

[opam install poll] <https://opam.ocaml.org/packages/poll/poll.0.1.0/>

[wepoll] <https://github.com/piscisaureus/wepoll>


SWIPl-OCaml v0.5 - Never write your own unification algorithms again!
═════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-swipl-ocaml-v0-5-never-write-your-own-unification-algorithms-again/8968/1>


Kiran Gopinathan announced
──────────────────────────

  Hey all! I am just posting to announce a new package I've been working
  on: OCaml bindings to SWI-Prolog (ver 8.5 or higher)!

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/b/b5a466fc6bc98f83b6935205ea9b4ff1d16a324d.png>

  It's currently in the process of being submitted to OPAM, but it's my
  first time writing a package with bindings to C (using ctypes), so
  some further changes might be needed? maybe?, but you can find the
  source code repository here: [repo]/[github mirror].

  As a sneak peek of what the API looks like, here's a hello world:
  ┌────
  │ (* initialise SWIProlog *)
  │ let () = Swipl.initialise ()
  │ (* setup the prolog database with some facts *)
  │ let () = Swipl.load_source "hello :- writeln('hello world')."
  │ (* construct a Swipl term in OCaml *)
  │ let hello = Swipl.Syntax.(!"hello")
  │ (* send the term to the Prolog engine *)
  │ let () = Swipl.with_ctx @@ fun ctx -> Swipl.call ctx hello
  └────

  I've taken care to provide some detailed documentation + quick start
  guide using odoc (see
  <https://gopiandcode.github.io/SWIPL-OCaml/swipl/index.html>) - the
  quick start guide shows a step by step walkthrough on using the
  library to write a type inference algorithm for lambda calculus using
  OCaml+Prolog (no need to write your own UF).

  Anyway, hope this might be useful for others - I have spent way too
  long racking my brains on writing dumb custom unification algorithms,
  but now, no more!


[repo] <https://gitlab.com/gopiandcode/swipl-ocaml>

[github mirror] <https://github.com/Gopiandcode/SWIPL-OCaml>


Kiran Gopinathan later added
────────────────────────────

  Here's another example that might be interesting for those who have
  experience with SWI-Prolog.

  You can even get native interaction with CHR:
  <https://en.wikipedia.org/wiki/Constraint_Handling_Rules> is a very
  elegant framework which comes bundled with SWI Prolog that allows
  users to write complex domain specific constraint solving engines in a
  concise declaritive way.

  Here's a CHR system that models the interaction between `salt' and
  `water' (basic I know, but look up CHR to see some more powerful
  examples):
  ┌────
  │ let () = Swipl.load_source "
  │ :- use_module(library(chr)).
  │ 
  │ :- chr_constraint salt/0, water/0, salt_water/0.
  │ 
  │ salt, water <=> salt_water.
  │ 
  │ reducesTo_(Goal, C) :-
  │ 	call(Goal),
  │ 	call(user:'$enumerate_constraints'(C)).
  │ reducesTo(Goal, Constraints) :-
  │ 	findall(Constraint, reducesTo_(Goal, Constraint), Constraints).
  │ "
  └────

  Which we can then embed into OCaml using the following code:
  ┌────
  │ let solve_constraints ls =
  │   (* Create a new term variable context *)
  │   Swipl.with_ctx (fun ctx ->
  │     (* create a term for the result *)
  │     let result = Swipl.fresh ctx in
  │     (* encode the constraint store *)
  │     let goal = encode ls in
  │     (* send the query to the Prolog engine *)
  │     Swipl.call ctx (reducesTo goal result);
  │     (* extract the result *)
  │     decode ctx result
  │   )
  │ (* val solve_constraints: t list -> t list *)
  └────
  (Again, some steps have been omitted for brevity, and you should check
  out the quick start guide for a step by step walkthrough).


opam 2.1.2
══════════

  Archive: <https://discuss.ocaml.org/t/ann-opam-2-1-2/8973/1>


Kate announced
──────────────

  We are pleased to announce the minor release of [opam 2.1.2].

  This opam release consists of [backported] fixes, including:

  • Fallback on `dnf' if `yum' does not exist on RHEL-based systems
    ([#4825])

  • Use `--no-depexts' in CLI 2.0 mode. This further improves the use of
    opam 2.1 as a drop-in replacement for opam 2.0 in CI, for example
    with setup-ocaml in GitHub Actions. ([#4908])

  To upgrade simply run:
  ┌────
  │ bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.1.2"
  └────


[opam 2.1.2] <https://github.com/ocaml/opam/releases/tag/2.1.2>

[backported] <https://github.com/ocaml/opam/issues/4920>

[#4825] <https://github.com/ocaml/opam/pull/4825>

[#4908] <https://github.com/ocaml/opam/pull/4908>


Set up OCaml 2.0.0-beta10
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta10/8974/1>


Sora Morimoto announced
───────────────────────

Added
╌╌╌╌╌

  • Added "extends" experimentally.


Changed
╌╌╌╌╌╌╌

  • Remove some hacks as `--no-depexts' is now used in CLI 2.0 mode from
    opam 2.1.2.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta10>


A hassle-free setup to release binaries for different platforms: the opam release process experiment
════════════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/a-hassle-free-setup-to-release-binaries-for-different-platforms-the-opam-release-process-experiment/8975/1>


Kate announced
──────────────

  On top of the [opam 2.1.2 announcement], I’d like share an experiment
  with the opam release script used for this release.

  As you might know, for each releases of opam we provide pre-compiled
  binaries for ease of use.  We’ve had a release script which up to this
  point required a specific setup to get it running correctly. For
  instance we had to setup a local OpenBSD machine (possibliy
  virtualised), a macOS/x86_64 machine and a macOS/arm64. This setup is
  rather tedious to reproduce.

  To improve this situation I’ve experimented over the past week with
  [QEMU] and [Rosetta 2] to make it a "one click script":

  <https://github.com/ocaml/opam/pull/4947>

  This change makes so that the script now only requires a
  macOS/arm64. From there you can:
  • compile locally for macOS/arm64 binaries
  • compile locally for macOS/x86_64 binaries (using Rosetta 2)
  • compile for BSDs (using QEMU)
  • compile for Linux (using Docker)

  With this, the [binaries] for this release have been compiled with
  this more reproducible setup, and now include FreeBSD/x86_64 binaries
  as well :sparkles:

  If someone wants to have a similar setup to distribute binaries here
  is the git repository (using Git LFS to store the large files). Feel
  free to use and experiment with it:

  <https://gitlab.com/kit-ty-kate/qemu-base-images>

  For now it only has OpenBSD/x86_64 and FreeBSD/x86_64 images but it
  could theoretically have more. Although I’m not accepting PRs for now
  (for obvious security reasons), I’m open to suggestions to add more
  platforms. See the [README] for high level details about the setup.


[opam 2.1.2 announcement]
<https://discuss.ocaml.org/t/ann-opam-2-1-2/8973>

[QEMU] <https://en.wikipedia.org/wiki/QEMU>

[Rosetta 2] <https://en.wikipedia.org/wiki/Rosetta_(software)#Rosetta_2>

[binaries] <https://github.com/ocaml/opam/releases/tag/2.1.2>

[README]
<https://gitlab.com/kit-ty-kate/qemu-base-images/-/blob/master/README.md>


Set up OCaml 2.0.0-beta11
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta11/9002/1>


Sora Morimoto announced
───────────────────────

Fixed
╌╌╌╌╌

  • Add support for more styles for the ocamlformat configuration in
    lint-fmt action.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta11>


What's the best way to save an huge amount of data in a file
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/whats-the-best-way-to-save-an-huge-amount-of-data-in-a-file/9003/5>


Deep in this thread, Simon Cruanes announced
────────────────────────────────────────────

  What a coincidence, I wrote an [Avro library] very recently. The paint
  is still fresh. However, it might be worth giving it a try as it's
  exactly the targeted use case: many rows of relatively simple data,
  encoded as binary; it also supports gzip compression (per "block" of N
  many rows, with N configurable). And there's no need to worry about
  endianess.

  It typically uses code generation from a schema (a json file).

  There's libraries for Avro in java (with all the Spark ecosystem) and
  also python (see "fastavro").


[Avro library] <https://github.com/c-cube/ocaml-avro>


p5scm 0.1.0
═══════════

  Archive: <https://discuss.ocaml.org/t/ann-p5scm-0-1-0/9014/1>


Jason Nielsen announced
───────────────────────

  I’ve released [p5scm] which is now up on `opam'.  It is a scheme-like
  implementation on top of `camlp5''s [pa_schemer.ml] extension.  I know
  that `camlp5' isn't the cool kid on the block these days but it is a
  powerful tool and pretty cool in my estimation ;-).


[p5scm] <https://github.com/drjdn/p5scm>

[pa_schemer.ml]
<https://github.com/camlp5/camlp5/blob/master/etc/pa_schemer.ml>


nanoid 1.0.0
════════════

  Archive: <https://discuss.ocaml.org/t/ann-nanoid-1-0-0/9017/1>


mefyl announced
───────────────

  I'm pleased to announce the release of [nanoid 1.0.0]. NanoID are
  [popular unique ids] amongst the javascript ecosystem. This library
  brings an equivalent native implementation and a virtual library to
  transparently branch between the native implementation and the
  original javascript one. The intent is to enable pieces of code
  generating such ids to be moved transparently between frontend and
  backend of a web stack.

  This is an humble first contribution to gain some experience and will
  hopefully be followed by more of our internal developments.


[nanoid 1.0.0] <https://github.com/routineco/ocaml-nanoid>

[popular unique ids] <https://github.com/ai/nanoid>


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

>From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Monorobot: a Slack bot for monorepos]
  • [opam 2.1.2 release]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Monorobot: a Slack bot for monorepos]
<https://tech.ahrefs.com/monorobot-a-slack-bot-for-monorepos-374260e2ca43?source=rss----303662d88bae--ocaml>

[opam 2.1.2 release] <http://opam.ocaml.org/blog/blog/opam-2-1-2/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-11-30 10:51 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-11-30 10:51 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of November 23 to 30,
2021.

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

opam 2.1.1, opam 2.0.10, and opam-depext 1.2
OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
New release of Fix
New release of Menhir (20211125)
Lwt 5.5.0, Lwt_domain 0.1.0, Lwt_react.1.1.5
OCaml's CI is gradually moving to GitHub Actions
How to combine 3 monads: Async/Lwt, Error and State?
Old CWN


opam 2.1.1, opam 2.0.10, and opam-depext 1.2
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-opam-2-1-1-opam-2-0-10-opam-depext-1-2/8872/1>


R. Boujbel announced
────────────────────

  We are pleased to announce several minor releases: [opam 2.0.10],
  [opam 2.1.1], and [opam-depext 1.2].

  The opam releases consist of backported fixes, while `opam-depext' has
  been adapted to be compatible with opam 2.1, to allow for workflows
  which need to maintain compatibility with opam 2.0. With opam 2.1.1,
  if you export `OPAMCLI=2.0' into your environment then workflows
  expecting opam 2.0 should now behave even more equivalently.

  You'll find more information in the [blog post ].


[opam 2.0.10] <https://github.com/ocaml/opam/releases/tag/2.0.10>

[opam 2.1.1] <https://github.com/ocaml/opam/releases/tag/2.1.1>

[opam-depext 1.2]
<https://github.com/ocaml-opam/opam-depext/releases/tag/1.2>

[blog post ] <https://opam.ocaml.org/blog/opam-2-0-10-2-1-1-depext/>


OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
══════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-otoml-0-9-0-a-compliant-and-flexible-toml-parsing-manipulation-and-pretty-printing-library/8152/10>


Daniil Baturin announced
────────────────────────

  A new 0.9.3 relase is available. Still not 1.0.0 just in case. The
  change I'm most glad I managed to make is that the lexer is now
  re-entrant and doesn't use any mutable state. Where can I apply for
  the "Designed for multicore OCaml" certification sticker? ;)


Breaking change in the functor interface
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  I found an oversight that took a breaking change to fix. It didn't
  break any package that was already in the OPAM repository, so I'm glad
  I noticed it before it caused anyone trouble.

  My idea to make the functor take separate integer and float modules
  turned out to be misguided: it wouldn't compose with `Otoml.get_float
  ~strict:false' and similar functions that apply type conversions.

  Logically, `Otoml.get_float ~strict:false (Otoml.integer 5)' should
  produce `Otoml.TomlFloat 5.0'. However, it means that `get_float'
  needs to know how to convert integers to float. If integer and float
  types are in separate modules, that isn't possible.

  So I combined both integers and floats in a single `TomlNumber'. That
  way people who want to bring their own bignum libraries will have to
  write more code, but numbers will behave as they are expected to in a
  dynamically typed format.

  ┌────
  │ module BigNumber = struct
  │   type int = Z.t
  │   type float = Decimal.t
  │ 
  │   let int_of_string = Z.of_string
  │   let int_to_string = Z.to_string
  │   let int_of_boolean b = if b then Z.one else Z.zero
  │   let int_to_boolean n = (n <> Z.zero)
  │ 
  │   (* Can't just reuse Decimal.to/of_string because their optional arguments
  │      would cause a signature mismatch. *)
  │   let float_of_string s = Decimal.of_string s
  │ 
  │   (* Decimal.to_string uses "NaN" spelling
  │      while TOML requires all special float values to be lowercase. *)
  │   let float_to_string x = Decimal.to_string x |> String.lowercase_ascii
  │   let float_of_boolean b = if b then Decimal.one else Decimal.zero
  │   let float_to_boolean x = (x <> Decimal.zero)
  │ 
  │   let float_of_int = Decimal.of_bigint
  │   let int_of_float = Decimal.to_bigint
  │ end
  │ 
  │ module Otoml = Otoml.Base.Make (BigNumber) (Otoml.Base.StringDate)
  └────

  The next release will likely be 1.0.0 for real.


New release of Fix
══════════════════

  Archive: <https://discuss.ocaml.org/t/ann-new-release-of-fix/8895/1>


François Pottier announced
──────────────────────────

  I am pleased to announce a new release of Fix, with several new
  modules contribued by Frédéric Bour (thanks!).

  In short, Fix is a toolkit that helps perform memoization and fixed
  point computations (including data flow analyses). More generally, it
  offers a number of basic algorithmic building blocks that can be
  useful in many circumstances.

  ┌────
  │ opam update
  │ opam install fix.20211125
  └────

  Documentation can be found here:

  • <https://gitlab.inria.fr/fpottier/fix/-/blob/master/README.md>
  • <http://cambium.inria.fr/~fpottier/fix/doc/fix/Fix/index.html>

  Enjoy,

  François Pottier
  francois.pottier@inria.fr
  <http://cambium.inria.fr/~fpottier/>


2021/11/25
╌╌╌╌╌╌╌╌╌╌

  • The new module `CompactQueue' offers a minimalist mutable FIFO
    queue. It is comparable with OCaml's `Queue' module. In comparison
    with `Queue', it uses a more compact internal representation:
    elements are stored contiguously in a circular array. This has a
    positive impact on performance: both time and memory consumption are
    reduced. This data structure is optimized for maximum
    throughput. (Contributed by Frédéric Bour, reviewed by François
    Pottier.)

  • The new functor `DataFlow.ForCustomMaps' offers a forward data flow
    analysis that is tuned for greater performance. (Contributed by
    Frédéric Bour, reviewed by François Pottier.)

  • The new module `Indexing' offers a safe API for manipulating indices
    into fixed-size arrays. This API involves some dynamic checks as
    well as static type checks, thereby (hopefully) greatly reducing the
    risk of confusion in code that uses many arrays and many indices
    into these arrays. (Contributed by Frédéric Bour, reviewed by
    François Pottier.)

  • In `DataFlow', allow the function `foreach_root' (which is part of
    the signature `DATA_FLOW_GRAPH') to call `contribute x _' several
    times at a single root `x'.


New release of Menhir (20211125)
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-new-release-of-menhir-20211125/8896/1>


François Pottier announced
──────────────────────────

  I am pleased to announce a new release of Menhir, with an exciting
  contribution by Frédéric Bour: a groundbreaking performance
  improvement in `menhir --list-errors'. This is made possible by an
  entirely new reachability algorithm, which has been designed and
  implemented by Frédéric, and which is described in our paper "Faster
  Reachability Analysis for LR(1) Parsers". This is the link to the
  paper:

  <http://cambium.inria.fr/~fpottier/publis/bour-pottier-reachability.pdf>

  To install the new release, just type

  ┌────
  │ opam update
  │ opam install menhir.20211125
  └────

  Enjoy!

  François Pottier
  Francois.Pottier@inria.fr
  <http://cambium.inria.fr/~fpottier/>

  • The command `menhir --list-errors' has been sped up by a factor of
    up to x100, and requires up to x1000 less memory, thanks to a new
    LR(1) reachability algorithm, which has been designed and
    implemented by Frédéric Bour.

  • Better document the restricted way in which the `error' token must
    be used when using `--strategy simplified'. Menhir now checks that
    this token is used only at the end of a production, and warns if
    this is not the case. (Better yet, our suggestion is to not use the
    `error' token at all!)

  • The `$syntaxerror' keyword is now forbidden when using `--strategy
    simplified'. This keyword will be entirely removed in the next
    release. Incidentally, we have just found out that it behaves
    differently under the code back-end and under the table back-end.

  • Disable OCaml warning 39 (unused rec flag) in the OCaml code
    produced by Menhir's code back-end. This does not affect the table
    back-end.  (Reported by Armaël Guéneau.)

  • Fix a bug in `--random-*' which could cause Menhir to diverge if the
    grammar uses the `error' token.

  • Warn if a terminal symbol is named `Error'. This creates a name
    clash in the public interface of the generated parser.

  • Menhir now requires OCaml 4.03.0 (instead of 4.02.3) and Dune 2.8.0
    (instead of 2.0.0).


Lwt 5.5.0, Lwt_domain 0.1.0, Lwt_react.1.1.5
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-lwt-5-5-0-lwt-domain-0-1-0-lwt-react-1-1-5/8897/1>


Raphaël Proust announced
────────────────────────

  It is my pleasure to announce the release of Lwt version 5.5.0,
  Lwt_domain version 0.1.0, Lwt_react version 1.1.5, Lwt_ppx version
  2.0.3 and Lwt_ppx_let version 5.5.0.

  <https://github.com/ocsigen/lwt/releases/tag/5.5.0>

  All those packages can be installed via opam as usual.


:rotating_light:  Deprecation
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  One notable change is the deprecation of `Lwt_main.yield' and
  `Lwt_unix.yield'. It is recommended to use `Lwt.pause' instead.


:rocket:  Lwt_domain: an interface to multicore parallelism
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Another notable change is the addition of the Lwt_domain package. This
  package includes a single module `Lwt_domain' with functions to
  execute some computations in parallel, using the features of Multicore
  OCaml. The package requires an OCaml compiler with domains support to
  install.

  Code for this package is the work of @sudha with reviews and packaging
  from Lwt contributors.


Other changes
╌╌╌╌╌╌╌╌╌╌╌╌╌

  The full list of changes is available in the [CHANGES file].


[CHANGES file] <https://github.com/ocsigen/lwt/blob/5.5.0/CHANGES>


OCaml's CI is gradually moving to GitHub Actions
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocamls-ci-is-gradually-moving-to-github-actions/8902/1>


Sora Morimoto announced
───────────────────────

  The OCaml team started switching to GitHub Actions last year for some
  of the official OCaml repositories. Also, we have released some CI
  related stuff, such as setup-ocaml, to the community. Some OCaml
  hackers also know that CI in the OCaml community is gradually
  switching to GitHub Actions nowadays.

  However, what gradually became a problem when we started switching was
  that the number of concurrent jobs that could run in a free account on
  GitHub was not enough for our activeness.

  One of the major pain points for compiler contributors is that the
  wait time for CI to complete, which is unrelated to the actual build,
  is too long. However, this has been a pain point in all services, even
  before GitHub Actions.

  The GitHub team did their best to help us make it better. As a result,
  they offered to upgrade the OCaml organization's plan to the team plan
  for free, which means that we can now benefit from a range of
  features, including access to 3x more concurrent runners than before.

  • About team plan:
    <https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration>
  • Concurrency/plan:
    <https://docs.github.com/en/get-started/learning-about-github/githubs-products#github-team>

  We would like to thank GitHub for supporting our team and Ahmed Bilal,
  who supported this effort.


How to combine 3 monads: Async/Lwt, Error and State?
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/how-to-combine-3-monads-async-lwt-error-and-state/8906/9>


Deep in this thread, Ivan Gotovchits said
─────────────────────────────────────────

  The monads library provides the transformers for some well-known
  monads. All these monads have a more or less standard implementation,
  offering the same performance as any other monadic library can
  offer. Like there is no better way of implementing the state monad
  other than a function. We have experimented a lot with different
  performance optimizations, such as boxing and unboxing it and inlining
  various operators, and keep experimenting to get the maximum from the
  current compiler. In BAP, we heavily use the monads library, first of
  all for our [knowledge representation and reasoning engine], which is
  the foundation for all BAP analyses. We also use it for [emulating
  binary programs].  The rich interface is here to make our life easier
  and more comfortable when we use monads. It definitely comes for free¹
  as the number of functions doesn't affect the performance of the
  underlying monad.

  But… there is always a but :) Stacking monads using a transformer does
  have a price. Even with the flambda compiler. The latter is doing an
  excellent job of unstacking them and eliminating the overhead of
  having a chain of monads. But our latest experiments show that a
  custom-made monad (still with the monads library) performs better
  under either branch of the compiler. We [have rewritten our main
  monads] that were relying on transformers and got from 20% to 50%
  performance improvement. But that is not to say that the monads
  library itself is slow or that we're not using it, it is to say that
  there are other options to transformers that might work in some cases.
  See the linked PR if you want to learn the trick.

  ¹⁾ Provided that we ignore the size of the executable, e.g., linking
  the core_kernel library results in a quite large binary, which may
  increase the startup time. Insignificantly, but in some use cases, it
  might be a significant factor.


[knowledge representation and reasoning engine]
<https://binaryanalysisplatform.github.io/bap/api/master/bap-knowledge/Bap_knowledge/Knowledge/index.html>

[emulating binary programs]
<https://binaryanalysisplatform.github.io/bap/api/master/bap-primus/Bap_primus/Std/index.html>

[have rewritten our main monads]
<https://github.com/BinaryAnalysisPlatform/bap/pull/1361>


Ivan Gotovchits then said
─────────────────────────

  As it was already suggested, you can use [monad transformers], to
  compose several monads into a single monad. As a show-case, we will
  use the [monads] library (disclaimer, I am an author of this library),
  which you can install with

  ┌────
  │ opam install monads
  └────

  It offers most of the well-known monads in a form of a monad
  transformer, which in terms of OCaml, is a functor that takes a monad
  and returns a new monad that enriches it with some new behavior. For
  example, to make a non-deterministic error monad, we can do
  `Monad.List.Make(Monad.Result.Error)' and get a monadic structure
  (i.e., a module that implements the [Monad.S] interface) that is both
  a list monad and an error monad.  The small caveat is that the
  operations of the wrapped monad, the error monad in our case, are not
  available directly, so we have to _lift_ them, e.g.,
  ┌────
  │ let fail p = lift @@ Monad.Result.Error.fail p
  └────
  So that in the end, the full implementation of the transformed monad
  still requires some boilerplate code,

  ┌────
  │ module ListE = struct
  │   type 'a t = 'a list Monad.Result.Error.t
  │   include Monad.List.Make(Monad.Result.Error)
  │   let fail p = lift@@Monad.Result.Error.fail p
  │   (* and so on for each operation that is specific to the wrapped monad *)
  │ end
  └────

  Now, let's try wrapping the Lwt monad into the state. We don't want to
  add the Error monad because Lwt is already the error monad and adding
  an extra layer of errors monad is not what we want. First of all, we
  need to adapt the `Lwt' monad to the `Monad.S' interface, e.g.,
  ┌────
  │ module LwtM = struct
  │   type 'a t = 'a Lwt.t
  │   include Monad.Make(struct
  │       type 'a t = 'a Lwt.t
  │       let return = Lwt.return
  │       let bind = Lwt.bind
  │       let map x ~f = Lwt.map f x
  │       let map = `Custom map
  │     end)
  │ end
  └────

  If we want to keep the state type monomorphic, then we will need a
  module for it. Suppose your state is represented as,
  ┌────
  │ module State = struct
  │   type t = string Map.M(String).t
  │ end
  └────

  Now, we can use it to build our `State(Lwt)' Russian doll,
  ┌────
  │ module IO = struct
  │   include Monad.State.T1(State)(LwtM)
  │   include Monad.State.Make(State)(LwtM)
  │ 
  │   (* let's lift [read] as an example *)
  │   let read fd buf ofs len =
  │     lift (Lwt_unix.read fd buf ofs len)
  │ end
  └────

  The `Monad.State.T1' functor is used to create the types for the
  generated monad. You can write them manually, of course, like as we
  did in the List(Error) example, but the type generating modules are
  here for the convenience¹

  Now, let's get back to the problem of the lifting. It looks tedious to
  impossible to lift every operation from Lwt.  Commonly, we try to put
  the smaller monad inside, to minimize the work, but it doesn't work
  with Lwt as the latter is not a transformer. So what is the solution?
  For me, the solution is to not lift the operations at all, but
  instead, define your IO abstraction and hide that it is using Lwt
  underneath the hood. This will make the code that uses this new
  abstraction more generic and less error-prone so that it can focus on
  the business logic and the implementation details could be hidden
  inside the monad implementation. This is what the monads are for,
  anyway.

  ¹⁾ We omit the types from the output of the `Make' functor since for a
  long time OCaml didn't allow the repetition of types in a structure so
  having the types in it will prevent us from composing various flavors
  of monads using `include'. It is also a long-time convention widely
  used in many OCaml libraries, including Core and Async. A convention
  that we probably don't need anymore.


[monad transformers] <https://en.wikipedia.org/wiki/Monad_transformer>

[monads]
<https://binaryanalysisplatform.github.io/bap/api/master/monads/Monads/Std/index.html>

[Monad.S]
<https://binaryanalysisplatform.github.io/bap/api/master/monads/Monads/Std/Monad/index.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
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-11-16  8:41 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-11-16  8:41 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of November 09 to 16,
2021.

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

Early preview of the Algorithmic with OCaml Book
pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
ocaml-wayland (pure OCaml wayland protocol library)
Set up OCaml 2.0.0-beta6
Set up OCaml 2.0.0-beta7
Set up OCaml 2.0.0-beta8
phylogenetics, a library for molecular evolution
release of svmwrap: a wrapper around libsvm-tools
GeoPub - A XMPP web client
Old CWN


Early preview of the Algorithmic with OCaml Book
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/early-preview-of-the-algorithmic-with-ocaml-book/8785/1>


Damien Guichard announced
─────────────────────────

  Please report bugs, bad English & nonsenses.  But do not report
  omissions (it is work-in-progress plus it's not an ocaml bible).

  <https://www.cjoint.com/c/KKjulI1Dx03>

  Why the book is not bottom up, instead some concepts are used without
  explained ?

  • Because some notions (what is the `unit' type ? what is a queue ?)
    are considered easy-enough to go without saying.

  What will be in the missing chapter 6 ?

  • Type polymorphism, universal quantification, `Stdlib.compare', weak
    polymorphism, constrained polymorphism, phantom types, type
    variance.

  What will be in the chapters 12 and more ?
  • High performance lexing
  • Recursive-descent parsing
  • The art of searching
  • Detailed construction of the ERic 0.3 application

  Will the source files go to a repository ?

  • No. The source files are already included in the zip archive.


pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value specifications
════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-pyml-bindgen-a-cli-app-to-generate-python-bindings-directly-from-ocaml-value-specifications/8786/1>


Ryan Moore announced
────────────────────

  I wanted to announce the first release of [pyml_bindgen], a CLI app
  for generating Python bindings using [pyml] directly from OCaml value
  specifications.

  Manually writing bindings to Python libraries can get tedious pretty
  quickly.  `pyml_bindgen' aims to help you avoid a lot of the
  repetitive work when binding Python libraries by letting you focus on
  the OCaml side of things and (mostly) not worrying about the
  implementation of the pyml bindings.


[pyml_bindgen] <https://github.com/mooreryan/ocaml_python_bindgen>

[pyml] <https://github.com/thierry-martinez/pyml/>

Quick start
╌╌╌╌╌╌╌╌╌╌╌

  First, install `pyml_bindgen'.  It is available on [Opam].

  ┌────
  │ $ opam install pyml_bindgen
  └────

  Say you have a Python class you want to bind and use in OCaml.
  (Filename: `adder.py')

  ┌────
  │ class Adder:
  │     @staticmethod
  │     def add(x, y):
  │ 	return x + y
  └────

  To do so, you write OCaml value specifications for the class and
  methods you want to bind.  (Filename: `val_specs.txt')

  ┌────
  │ val add : x:int -> y:int -> unit -> int
  └────

  Then, you run `pyml_bindgen'.

  ┌────
  │ $ pyml_bindgen val_specs.txt adder Adder --caml-module Adder > lib.ml
  └────

  Now you can use your generated functions in your OCaml code.
  (Filename: `run.ml')

  ┌────
  │ open Lib
  │ 
  │ let () = Py.initialize ()
  │ 
  │ let result = Adder.add ~x:1 ~y:2 ()
  │ 
  │ let () = assert (result = 3)
  └────

  Finally, set up a dune file and run it.

  ┌────
  │ (executable
  │  (name run)
  │  (libraries pyml))
  └────

  ┌────
  │ $ dune exec ./run.exe
  └────


[Opam] <https://opam.ocaml.org/packages/pyml_bindgen/>


Documentation
╌╌╌╌╌╌╌╌╌╌╌╌╌

  For more information on installing and using `pyml_bindgen', check out
  the [docs].  There you will find lots of tips and examples to help you
  get started!


[docs] <https://mooreryan.github.io/ocaml_python_bindgen/>


ocaml-wayland (pure OCaml wayland protocol library)
═══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-wayland-pure-ocaml-wayland-protocol-library/7616/2>


Thomas Leonard announced
────────────────────────

  ocaml-wayland has been very stable over the last few months and so
  I've now released [version 1.0]. The main changes are improved error
  handling and diagnostics.

  I've been using this to write an Xwayland adaptor, which acts as an
  X11 window manager to Xwayland, converting between the two
  protocols. This allows running X11 apps in VMs and having them appear
  alongside other application windows on the host. It can also be used
  to fix other problems, such as support for HiDPI screens and Sway's
  buggy clipboard support:

  <https://roscidus.com/blog/blog/2021/10/30/xwayland/>


[version 1.0]
<https://github.com/talex5/ocaml-wayland/releases/tag/v1.0>


Set up OCaml 2.0.0-beta6
════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta6/8795/1>


Sora Morimoto announced
───────────────────────

Changed
╌╌╌╌╌╌╌

  • Unlock opam 2.1 on the Ubuntu and macOS runners.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta6>


Set up OCaml 2.0.0-beta7
════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta7/8796/1>


Sora Morimoto announced
───────────────────────

Fixed
╌╌╌╌╌

  • Return an empty array to avoid depext failure when depext flags are
    not passed.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta7>


Set up OCaml 2.0.0-beta8
════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta8/8821/1>


Sora Morimoto announced
───────────────────────

Changed
╌╌╌╌╌╌╌

  • Use 2.1 mode instead of 2.0 mode on the Ubuntu and macOS runners.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta8>


phylogenetics, a library for molecular evolution
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-phylogenetics-a-library-for-molecular-evolution/8812/1>


Philippe announced
──────────────────

  I'm happy to announce the availability on opam of [phylogenetics], a
  bioinformatics library dedicated to [molecular evolution] and
  phylogeny. It provides a few algorithms and data structures that can
  be useful to study how biological sequences like proteins or genes
  have evolved, or to simulate datasets under various evolutionary
  models.

  Comments/questions welcomed on the repo's issue tracker!


[phylogenetics] <https://github.com/biocaml/phylogenetics>

[molecular evolution]
<https://en.wikipedia.org/wiki/Molecular_evolution>


release of svmwrap: a wrapper around libsvm-tools
═════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-svmwrap-a-wrapper-around-libsvm-tools/8818/1>


UnixJunkie announced
────────────────────

  I am pleased to announce the availability in opam of the svmwrap
  package.  A wrapper around libsvm's svm-train and svm-predict
  executables.  Currently, only regression modeling is supported, using
  the linear, RBF, sigmoid or polynomial kernel.

  <https://github.com/UnixJunkie/svmwrap>

  The quite scary usage looks like this:
  ┌────
  │ usage: svmwrap
  │   -i <filename>: training set or DB to screen
  │   --feats <int>: number of features
  │   [-o <filename>]: predictions output file
  │   [-np <int>]: ncores
  │   [--kernel <string>] choose kernel type {Lin|RBF|Sig|Pol}
  │   [-c <float>]: fix C
  │   [-e <float>]: epsilon in the loss function of epsilon-SVR;
  │   (0 <= epsilon <= max_i(|y_i|))
  │   [-g <float>]: fix gamma (for RBF and Sig kernels)
  │   [-r <float>]: fix r for the Sig kernel
  │   [--iwn]: turn ON instance-wise-normalization
  │   [--scale]: turn ON [0:1] scaling (NOT PRODUCTION READY)
  │   [--no-plot]: no gnuplot
  │   [{-n|--NxCV} <int>]: folds of cross validation
  │   [-q]: quiet
  │   [-v|--verbose]: equivalent to not specifying -q
  │   [--seed <int>]: fix random seed
  │   [-p <float>]: training set portion (in [0.0:1.0])
  │   [--pairs]: read from .AP files (atom pairs; will offset feat. indexes by 1)
  │   [--train <train.liblin>]: training set (overrides -p)
  │   [--valid <valid.liblin>]: validation set (overrides -p)
  │   [--test <test.liblin>]: test set (overrides -p)
  │   [{-l|--load} <filename>]: prod. mode; use trained models
  │   [{-s|--save} <filename>]: train. mode; save trained models
  │   [-f]: force overwriting existing model file
  │   [--scan-c]: scan for best C
  │   [--scan-e <int>]: epsilon scan #steps for SVR
  │   [--scan-g]: scan for best gamma
  │   [--regr]: regression (SVR); also, implied by -e and --scan-e
  │   [--e-range <float>:<int>:<float>]: specific range for e
  │   (semantic=start:nsteps:stop)
  │   [--c-range <float,float,...>] explicit scan range for C
  │   (example='0.01,0.02,0.03')
  │   [--g-range <float,float,...>] explicit range for gamma
  │   (example='0.01,0.02,0.03')
  │   [--r-range <float,float,...>] explicit range for r
  │   (example='0.01,0.02,0.03')
  └────

  For people who know my linwrap opam package (a wrapper around
  liblinear tools), this is quite similar.
  <https://github.com/UnixJunkie/linwrap>


GeoPub - A XMPP web client
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-geopub-a-xmpp-web-client/8819/1>


pukkamustard announced
──────────────────────

  I'd like to announce an initial, proof-of-concept release of GeoPub -
  an XMPP web client. Unlike many XMPP clients the focus is not on
  instant messaging but on creating, displaying and managing things such
  as events, maps, information on local organizations and other local
  knowledge (see [the openEngiadina] project for the context).

  This initial release is not really anything useful but a
  proof-of-concept how such an application can be developed using XMPP
  and OCaml. There are many rough edges and broken hacks that need
  fixing. I'd be very grateful for your feedback, thoughts and ideas.

  The source code of the app is on [codeberg] and a pre-built hosted
  version is available [here].

  The application consists of some parts and ideas that I'd like to
  illustrate separately:


[the openEngiadina] <https://openengiadina.net>

[codeberg] <https://codeberg.org/openEngiadina/geopub>

[here] <https://geopub.openengiadina.net/>

ocaml-xmpp
╌╌╌╌╌╌╌╌╌╌

  [ocaml-xmpp] is a XMPP client library for OCaml (documentation
  available [online].


[ocaml-xmpp] <https://codeberg.org/openEngiadina/ocaml-xmpp>

[online] <https://inqlab.net/projects/ocaml-xmpp/>

Reactive
┄┄┄┄┄┄┄┄

  ocaml-xmpp is reactive in the sense that the XMPP connection is
  abstracted as a React event of Stanzas (small pieces of information
  that flow over XMPP):

  ┌────
  │ val stanzas : t -> Stanza.t React.event
  └────

  This React event can be filtered for messages in a specific
  conversation, for example.


Transports
┄┄┄┄┄┄┄┄┄┄

  XMPP works with different transport mechanisms and ocaml-xmpp supports
  this. Currently ocaml-xmpp can be used from Unix with a TCP/SSL
  connection to a XMPP server and from web browsers with a WebSocket
  connection. This is implemented by abstracting the XMPP transport:

  ┌────
  │ module type TRANSPORT = sig
  │   (** {2 Connection} *)
  │ 
  │   type options
  │   (** Additional options that may be passed to the transport *)
  │ 
  │   type t
  │   (** Type of an instantiated connection to an XMPP server *)
  │ 
  │   val connect : host:string -> options -> t Lwt.t
  │ 
  │   val close : t -> unit Lwt.t
  │ 
  │   val closed : t -> unit Lwt.t
  │ 
  │   (** {2 XML Stream} *)
  │ 
  │   type stream
  │ 
  │   val open_stream : t -> to':string -> stream Lwt.t
  │ 
  │   val stream_id : stream -> string Lwt.t
  │ 
  │   val send_xml : stream -> Xmlc.t -> unit Lwt.t
  │ 
  │   val signals : stream -> Xmlc.signal Lwt_stream.t
  │ 
  │   val stop_stream : stream -> unit Lwt.t
  │ end
  └────

  A transport establishes the underlying connection to a server and can
  create XML streams (in XMPP a connection is by multiple XML streams
  sequentially). For technical reasons XML parsing is also handled by
  the transport and a stream of XML signals (element start, data,
  element end) is returned. This is due to the fact that XML parsing in
  XMPP needs to be done slightly differently when using TCP (a single
  XML document over the entire stream) or WebSockets (every WebSocket
  frame is a parse-able XML document).

  The Unix/TCP/SSL transport uses Markup.ml and whereas the WebSocket
  transport uses Xmlm (and Brrr).


Parser combinators for XML
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  For parsing streams of XML signals to OCaml types ocaml-xmpp contains
  a parser combinator helper library: [Xmlc]. This allows parser for XML
  such as this:

  ┌────
  │ <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>w4iu4ckn3kjbqvcd@demo.openengiadina.net/z8Pkzfa8</jid></bind>
  └────

  to be parses like this:

  ┌────
  │ Xmlc.Parser.(
  │   element (Ns.bind "bind") (fun _ ->
  │     element (Ns.bind "jid") (fun _ ->
  │       text >>| String.concat "" >>= fun jid_s ->
  │       match Jid.of_string jid_s with
  │       | Some jid -> return jid
  │       | None -> fail_with "invalid JID")))
  └────


[Xmlc] <https://inqlab.net/projects/ocaml-xmpp/xmlc/Xmlc/index.html>


XMPP extensions
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  Inspiration for the scope of the core library is taken from the
  [Strophe] XMPP libraries - everything that does not have directly to
  do with XMPP transport, authentication or stream management is kept
  outside of the core library.

  There are already some "extension" libraries outside of the core for
  useful XMPP features (e.g. [Roster management], [PubSub] and
  [pinging]).

  One thing that I do want to add to the core library is stream
  management according to [XEP-0198]. I expect this addition to change
  the core library API - the API is not stable yet!

  Much inspiration was taken from [Jackline] - an OCaml XMPP client -
  and in particular [this post] on Jackline. Many thanks to @hannes.


[Strophe] <http://strophe.im/>

[Roster management]
<https://inqlab.net/projects/ocaml-xmpp/xmpp/Xmpp_roster/index.html>

[PubSub]
<https://inqlab.net/projects/ocaml-xmpp/xmpp/Xmpp_pubsub/index.html>

[pinging]
<https://inqlab.net/projects/ocaml-xmpp/xmpp/Xmpp_ping/index.html>

[XEP-0198] <https://xmpp.org/extensions/xep-0198.html>

[Jackline] <https://github.com/hannesm/jackline>

[this post] <https://hannes.nqsb.io/Posts/Jackline>


reactor
╌╌╌╌╌╌╌

  GeoPub uses Brr. I had some trouble figuring out a suitable
  "architecture" for managing complex logic and ended up hacking an
  [Elm] inspired helper library: [reactor.mli]. State updates for the
  entire application are then handled in a single [update function].

  I'm not yet very happy with this machinery and I'm pretty sure I'm
  using react in wrong and dangerous ways. I'd be very grateful for
  ideas on how to improve this. THis might be related to this
  discussion:
  <https://discuss.ocaml.org/t/structuring-frp-specifically-note-applications/8645/17>.

  The reason for using React over Note is because ocaml-xmpp uses a lot
  of Lwt and `Lwt_react' provides nice bindings for working with both. I
  guess something similar could be created for Note (e.g. `Lwt_note')
  and I'm open to using Note (also in ocaml-xmpp).


[Elm] <https://elm-lang.org/>

[reactor.mli]
<https://codeberg.org/openEngiadina/geopub/src/branch/main/src/reactor/reactor.mli>

[update function]
<https://codeberg.org/openEngiadina/geopub/src/branch/main/src/geopub/main.ml#L28>


Leaflet
╌╌╌╌╌╌╌

  GeoPub displays a map using the [Leaflet.js] JavaScript
  library. GeoPub contains OCaml bindings to Leaflet using Brr:
  [leaflet.mli]. Writing this was very straightforward and pleasant (I
  like Brr!).

  One issue I have is that the Leaflet map needs to be manipulated very
  imperatively, whereas the rest of the application is much more
  functional. This causes some mismatches. I guess one needs to find a
  way of hiding the impressiveness of Leaflet (e.g. like
  [react-leaflet]).


[Leaflet.js] <https://leafletjs.com/>

[leaflet.mli]
<https://codeberg.org/openEngiadina/geopub/src/branch/main/src/leaflet/leaflet.mli>

[react-leaflet] <https://github.com/PaulLeCam/react-leaflet>


Guix for build and development environments
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  I use [Guix] for providing a build and development environment. With
  guix installed one can run `guix shell' in the GeoPub repository to
  get a reproducible build environment. All dependencies are fetched and
  made available by Guix in this environment (e.g. `ocaml-xmpp' or the
  OCaml compiler).

  I will publish `ocaml-xmpp' on OPAM once the API is more stable and an
  initial release can be made.


[Guix] <https://guix.gnu.org/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-11-09 10:08 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-11-09 10:08 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of November 02 to 09,
2021.

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

OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
Build System Engineer at Jane Street
Real-world use example of ts2ocaml
First release of `ts2ocaml' - generates OCaml bindings from .d.ts files!
OUPS meetups are back!
Old CWN


OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
══════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-otoml-0-9-0-a-compliant-and-flexible-toml-parsing-manipulation-and-pretty-printing-library/8152/9>


Daniil Baturin announced
────────────────────────

  OTOML 0.9.2 is now available from the OPAM repository.


Breaking changes
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  It makes a breaking change to the `get_array' accessor: it now has
  type `Otoml.get_array' now has type `?strict:bool -> (t -> 'a) -> t ->
  'a list' , that is, it requires an accessor function that will be
  applied to every item of the array.

  For example, you can use `Otoml.find t (Otoml.get_array
  Otoml.get_string) ["foo"]' to retrieve an array of strings from a TOML
  document's key `foo' .

  The motivation for the change is that it allows retrieving arrays of
  unwrapped OCaml values in one step. The old behaviour can still be
  emulated using an identify function for the accessor, for example the
  built-in `Otoml.get_value : 'a -> 'a' .


New features
╌╌╌╌╌╌╌╌╌╌╌╌

  New `Otoml.path_exists t ["some"; "table"; "key"]' allows checking if
  a key path exists in a TOML document.

  `Otoml.Printer.to_string/to_channel' functions now provide
  `~force_table_array' option. When set to true, it forces every array
  that contains nothing but tables to be rendered using the `[[...]]~'
  table array syntax.


Bug fixes
╌╌╌╌╌╌╌╌╌

  Unicode escape sequences are now printed correctly.

  If a table has subtables and non-table items, the non-table items are
  forcibly moved before the first subtable for printing. This way the
  output parses correctly, otherwise the non-table items would be
  mistakenly treated as subtable members. This way hand-constructed TOML
  tables are always formatted correctly even if the user inserts
  non-table items after a subtable.


Testing
╌╌╌╌╌╌╌

  I added a minimal test suite for the read-write interface. If anyone
  wants to contribute to it, that will be much appreciated. Ideally, all
  lookup functions and all accessors/constructors should be tested to
  work as expected.

  Both parser and formatter are now tested with the
  [github.com/BurntSushi/toml-test] and are fully compliant (one
  formatter test is skipped because the test itself is malformed).


[github.com/BurntSushi/toml-test]
<https://github.com/BurntSushi/toml-test>


Future plan
╌╌╌╌╌╌╌╌╌╌╌

  My idea was to call it 1.0.0 when it passes both parsing and formatter
  tests. That goal is reached now, but I'd like to see if anyone has any
  more ideas for the API that cannot be implemented without breaking
  changes. If not, I'll call it 1.0.0 in the next release.


Build System Engineer at Jane Street
════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-build-system-engineer-at-jane-street/8737/1>


Andrey Mokhov announced
───────────────────────

  Jane Street is looking for new build system engineers! I've worked in
  this team for two years and I love the job.  Here is why:

  • You frequently change focus from low-level work, like debugging a
    weird file-system issue, to high-level work, like designing a cloud
    build cache.

  • Your colleagues are amazing. If you're like me, you'll feel like an
    imposter in most conversations but it's OK since everyone is kind
    and helpful, so you'll learn something new every day.

  • Most of your work is open-source and benefits the wider OCaml
    community.

  For balance, let me also say a few words about challenges.

  • Build systems accumulate years of knowledge of many people on how to
    get things done. When this knowledge goes out of date, you are often
    the only person to fix it. For this reason, build systems work can
    be daunting.

  • It's far from our core business, so you don't get to work on any of
    our cool trading systems. Your role is to empower others.

  • Our team is small, so we may have to turn down some good
    candidates. However, please don't get discouraged by this! If in
    doubt, send me a message and we'll chat.

  • There is no remote work for now.

  To apply, follow [this link] and mention the build systems role in
  your application.

  Our plans for 2022 include: implementing cloud builds in Dune, better
  integration with other tools like IDEs and the OCaml compiler, and
  making Dune even faster than it is today. To learn more about our
  work, listen to [this podcast].

  And feel free to message me or @jeremiedimino if you have any
  questions!


[this link]
<https://janestreet.com/join-jane-street/position/4274814002/>

[this podcast] <https://signalsandthreads.com/build-systems/>


Real-world use example of ts2ocaml
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/real-world-use-example-of-ts2ocaml/8745/1>


Sora Morimoto announced
───────────────────────

  Some OCaml/JavaScript enthusiasts may know that we spent almost two
  years working on a tool automatically generating OCaml bindings from
  TypeScript's type definition files. To prepare for its release, we
  just published a repository to show an example use of it.

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/3/3473fc11da0c56335e8de2b91bd7d9172444913a_2_1380x374.png>

  <https://github.com/ocsigen/ts2ocaml-example>

  This example generates and actually uses a binding to a small
  JavaScript library called [pretty-bytes], and it doesn't only generate
  the binding, but also converts JSDoc comments to odoc ones.

  We believe we can release ts2ocaml as early as this month, please look
  forward to the new announcement!


[pretty-bytes] <https://github.com/sindresorhus/pretty-bytes>


First release of `ts2ocaml' - generates OCaml bindings from .d.ts files!
════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-release-of-ts2ocaml-generates-ocaml-bindings-from-d-ts-files/8772/1>


Cannorin announced
──────────────────

  We're pleased to announce that ts2ocaml is now public!

  <https://github.com/ocsigen/ts2ocaml>

  This is a tool which parses TypeScript definition files (`.d.ts') of a
  JS package and then generates an OCaml binding for the package.

  ts2ocaml currently supports js_of_ocaml as a target via
  [LexiFi/gen_js_api], and ReScript is also going to be supported too!

  You can install ts2ocaml from NPM: `npm install -g @ocsigen/ts2ocaml'.
  Please take a look at the documentation on our GitHub repository
  before using it.

  Also, we appreciate any feedback or bug reports, especially since this
  is the first release of ts2ocaml!

  This tool is heavily inspired by ts2fable, which generates Fable (F#
  AltJS) bindings from `.d.ts' files. This tool is also written in
  Fable. Thank you very much for the great language and an awesome
  ecosystem, Fable team!


[LexiFi/gen_js_api] <https://github.com/LexiFi/gen_js_api>


OUPS meetups are back!
══════════════════════

  Archive: <https://discuss.ocaml.org/t/oups-meetups-are-back/8776/1>


zapashcanon announced
─────────────────────

  We (@Vertmo, @lsylvestre, Colin González and myself) are happy to
  announce that the [OUPS (OCaml Users in PariS) meetups] are back.

  If you're not familiar with OUPS, the idea is to have people using
  OCaml (developers, applications' users, researchers, …) to meet in
  Paris where a talk is given, followed by some discussions while eating
  pizza and drinking beer.

  We're planning to have the first meetup happening this year in
  December.

  Thus we're looking for speakers willing to give a talk for the first
  meetups or the following ones.

  The talks usually happen at [IRILL]'s offices, [4 Place Jussieu, 75005
  Paris]. We'll prefer talks in french and with someone able to be
  physically present, but we're open about english and remote talks.

  If you want to give a talk in December or in the future, you can let
  us know here or [on zulip] where we plan to have our main discussions.
  We also have [a group on Framagit] where we'll store some stuff. If
  you don't like Zulip, I'm also on IRC (#oups in [libera.chat]) and
  [matrix] but not everyone is.

  The four of us are doing a PhD in the following places: [ENS] ([Parkas
  team]), [Université de Paris] ([Irif]) + [Nomadic Labs], [Université
  Paris-Saclay] ([LMF]) + [OCamlPro], [Sorbonne Université] ([APR team -
  LIP6]) ; so we have a good coverage of the OCaml users in Paris but we
  don't know everyone. Even if you don't want to give a talk, if you
  know someone that may be interested, please talk to him about OUPS !
  :)

  Also, if there's a subject you'd like to hear about at OUPS, you can
  tell us and we'll try to find a speaker to give a talk about it.

  We'll come back to you very quickly about the December meetup.


[OUPS (OCaml Users in PariS) meetups]
<https://www.meetup.com/fr-FR/ocaml-paris/>

[IRILL] <https://www.irill.org/>

[4 Place Jussieu, 75005 Paris]
<https://www.openstreetmap.org/#map=19/48.84650/2.35457>

[on zulip] <https://oups.zulipchat.com>

[a group on Framagit] <https://framagit.org/oups>

[libera.chat] <https://libera.chat/>

[matrix] <https://matrix.to/#/#oups:matrix.org>

[ENS] <https://www.ens.psl.eu/>

[Parkas team] <https://parkas.di.ens.fr/>

[Université de Paris] <https://u-paris.fr/>

[Irif] <https://www.irif.fr/>

[Nomadic Labs] <https://www.nomadic-labs.com/>

[Université Paris-Saclay] <https://www.universite-paris-saclay.fr/>

[LMF] <https://lmf.cnrs.fr/>

[OCamlPro] <https://www.ocamlpro.com/>

[Sorbonne Université] <https://www.sorbonne-universite.fr/>

[APR team - LIP6] <https://www.lip6.fr/recherche/team.php?acronyme=APR>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-11-02  8:50 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-11-02  8:50 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of October 26 to
November 02, 2021.

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

Lists.ocaml.org: service temporarily sunsetted
Talk at Func Prog Sweden
First OPAM releases of Scad_ml and [@@deriving scad]
Other OCaml News
Old CWN


Lists.ocaml.org: service temporarily sunsetted
══════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/lists-ocaml-org-service-temporarily-sunsetted/8692/1>


Anil Madhavapeddy announced
───────────────────────────

  *This note does not concern the main OCaml email list, which continues
  to be available through <https://sympa.inria.fr/sympa/arc/caml-list/>*

  The lists.ocaml.org e-mail service has been going through a rough time
  in the past few years, with vast swathes of spam regularly hitting our
  ingress email server and require manual unblocking every time.  It was
  set up [back in 2012] as an augmentation of the main OCaml mailing
  list and really helped with some big projects in the early days (the
  design of and migration to ppx from camlp4, for example).  However, in
  the intervening years e-mail has reduced in importance as a primary
  community communication mechanism (as evidenced, for example, in this
  forum).

  With the latest spam surge, I've moved the service into read-only mode
  with all the mailboxes and archives still available on the website,
  but with mail delivery and list creation/admin disabled. All existing
  links should continue to work to historical links online without
  change.  The only mailing list on there that was still active to my
  knowledge is the opam-commits cron list, which will be replaced by an
  ocurrent-based deployer for that website shortly.

  I hope to bring e-mail back to ocaml.org sometime in 2022, as it's an
  important communications medium that is highly accessible. One
  challenge is spam, and another is the inflexibility of GNU Mailman and
  its upgrade mechanism (essentially a manual process from 2 to
  3). Therefore, if there is anyone in the community interested in
  building a simple e-mail list manager in OCaml, that would be of
  interest :slight_smile:


[back in 2012]
<https://sympa.inria.fr/sympa/arc/caml-list/2012-12/msg00015.html>


Talk at Func Prog Sweden
════════════════════════

  Archive: <https://discuss.ocaml.org/t/talk-at-func-prog-sweden/8703/1>


Leonardo Laguna Ruiz announced
──────────────────────────────

  Here's a link for the talk I gave at the Func Prog Sweden meetup. In
  that talk I show the process we follow some years ago in order to move
  all our code base to OCaml and why it was an excellent decision.

  <https://youtu.be/FGXiAARXE2M>

  [Wolfram System Modeler] is a simulation environment that can be used
  to model multi-domain systems. For example systems composed of
  electrical, thermal, hydraulic, mechanical, etc, components.

  One of the main parts of System Modeler is the model compiler (Kernel)
  which takes models written in the Modelica language and compiles them
  into efficient simulation executables. This compiler was ported to
  OCaml by using custom tool that performed the code to code translation
  of our old code base.

  Slides
  <https://a2076202-c90b-450e-901b-cb56c346913c.usrfiles.com/ugd/a20762_adfa899586c7413a8c17f7b708dbc177.pdf>


[Wolfram System Modeler] <https://www.wolfram.com/system-modeler/>


First OPAM releases of Scad_ml and [@@deriving scad]
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-opam-releases-of-scad-ml-and-deriving-scad/8718/1>


geoffder announced
──────────────────

  I'd like to announce the first release onto opam of [Scad_ml] and
  [ppx_deriving_scad]. The former being a DSL front-end to the
  [OpenSCAD] solid modelling language, and the latter providing
  transformation function generation for custom types (a pattern that I
  have found useful during my time using `Scad_ml'.

  When I decided I wanted to pick up OpenScad, I was pleasantly
  surprised to discover that the `Scad_ml' library already existed on
  GitHub, credits to <https://github.com/namachan10777>. Over time I
  filled out the rest of the OpenSCAD language coverage, as well as some
  additional helpful math, and reorganized things to try and keep it
  from getting too messy as more and more was tacked on. Finally, after
  some help in the ocaml discord (from NULL and octachron), we also now
  can track whether shapes are 2D or 3D with minimal changes to the user
  interface, preventing misapplications of operations that would
  otherwise only appear in the OpenSCAD console.

  The `[@@deriving scad]' ppx is my solution to make a habit I developed
  to get around the otherwise fully declarative nature of working in
  OpenSCAD more ergonomic. Shapes in OpenSCAD cannot be queried in any
  way, so upon creation, the locations of it's vertices or it's origin
  are not available. Of course, since you created it, you know exactly
  it's dimensions, and where you have moved it, but what if you want to
  use the location of one of it's vertices, wherever that ends up after
  a series of transformations? What I did for some time before learning
  how to write a ppx, was put the coordinates I cared about into a
  record with the shape, and mapped over the type (by hand (and regex))
  with the relevant functions (typically transform and rotate). Turns
  out writing a ppx with `Ppxlib' and `metaquot' isn't so bad, and I
  really wish I did it sooner!

  Anyway, to the few of you out there that might use OpenSCAD, I hope
  that these tools might come in handy!


[Scad_ml] <https://github.com/namachan10777/scad-ml>

[ppx_deriving_scad] <https://github.com/geoffder/ppx_deriving_scad>

[OpenSCAD] <https://openscad.org/>


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

>From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Hiring a Developer Educator]
  • [Verification for Dummies: SMT and Induction]
  • [SCoP Passed Phase 1 of the DAPSI Initiative!]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Hiring a Developer Educator]
<https://blog.janestreet.com/hiring-a-developer-educator/>

[Verification for Dummies: SMT and Induction]
<https://www.ocamlpro.com/2021/10/14/verification-for-dummies-smt-and-induction/>

[SCoP Passed Phase 1 of the DAPSI Initiative!]
<https://tarides.com/blog/2021-10-14-scop-selected-for-dapsi-phase2>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-10-19  8:23 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-10-19  8:23 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of October 12 to 19,
2021.

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

Verification for Dummies: SMT and Induction
OCaml Café: Wed, Oct 13 @ 1pm (U.S. Central)
Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
Release of ocaml-sf/learn-ocaml:0.13.0
Old CWN


Verification for Dummies: SMT and Induction
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/verification-for-dummies-smt-and-induction/8631/1>


OCamlPro announced
──────────────────

  We are pleased to share with you [Verification for Dummies: SMT and
  Induction], a complete and detailed series of blogposts written by
  Adrien Champion about Induction as a formal verification technique.

  The subject is treated with many concrete and executable examples. All
  examples can be (and should be) launched locally by readers thanks to
  small and easy to find tools. Modification and experimentation are
  strongly encouraged!

  Take a look at all the notions covered:

  • introduction to formal logics and formal frameworks;
  • SMT-solving: modern, low-level verification building blocks;
  • declarative transition systems;
  • transition system unrolling;
  • BMC and induction proofs over transition systems;
  • candidate strengthening.

  We hope you enjoy reading and we look forward to your feedback!


[Verification for Dummies: SMT and Induction]
<https://www.ocamlpro.com/2021/10/14/verification-for-dummies-smt-and-induction/>


OCaml Café: Wed, Oct 13 @ 1pm (U.S. Central)
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-cafe-wed-oct-13-1pm-u-s-central/8610/14>


Claude Jager-Rubinson announced
───────────────────────────────

  The video of @dra27's talk on OPAM is now available:
  <https://youtu.be/RHSdlH4el0g>. Thanks so much for the great talk,
  David!  And thanks to everybody who attended!  (The video starts a
  couple of minutes into the talk because yours truly forgot to start
  recording.  D'oh!)

  We already have some ideas for the next meeting but if there's a topic
  that you'd like to hear about or are interested on presenting on,
  please message me.


Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-windows-friendly-ocaml-4-12-distribution-2nd-preview-release-0-2-0/8488/3>


jbeckford announced
───────────────────

  0.2.5 is available. This release brings significant user friendly
  improvements.

  There is a new binary called `with-dkml.exe'. Just plop `with-dkml' in
  front of a Windows command that requires access to Unix scripts
  (ie. `with-dkml opam install') and it should just work.

  There is now a section called **Beyond Basics** in [the Diskuv OCaml
  user documentation] that walks through:
  • the first and second tutorials of [Getting Started - Learn OCaml]
  • the bare Opam essentials you need as a beginner (how to find and
    select an Opam switch, and how to find and install packages using
    `with-dkml opam install'), all without leaving the Command Prompt
  • installing Visual Studio Code with the OCaml plugin

  Huge thanks to @Butanium who lent me much of his time to validate
  usability from the perspective of a newcomer. More feedback is always
  welcome.

  Links:
  • [Installation instructions for the latest version]
  • [Release notes for all versions]

  PS. You won't need `with-dkml' most of the time. The Beyond Basics
  documentation shows how to run Dune and the OCaml native compiler
  directly from the Visual Studio Command Prompt.


[the Diskuv OCaml user documentation]
<https://diskuv.gitlab.io/diskuv-ocaml/index.html>

[Getting Started - Learn OCaml] <https://ocaml.org/learn/tutorials/>

[Installation instructions for the latest version]
<https://diskuv.gitlab.io/diskuv-ocaml/index.html#two-step-installation-instructions>

[Release notes for all versions]
<https://gitlab.com/diskuv/diskuv-ocaml/-/releases>


Release of ocaml-sf/learn-ocaml:0.13.0
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-ocaml-sf-learn-ocaml-0-13-0/8577/6>


Erik Martin-Dorel announced
───────────────────────────

  Just FYI, a bugfix release learn-ocaml `0.13.1' has just been tagged
  and:

  • [released in GitHub] ← see the Release Notes and binaries-assets
  • [pushed to Docker Hub] ← `ocamlsf/learn-ocaml' being the official
    distribution of Learn-OCaml
  • [submitted to OPAM default repository]


[released in GitHub]
<https://github.com/ocaml-sf/learn-ocaml/releases/tag/v0.13.1>

[pushed to Docker Hub]
<https://hub.docker.com/r/ocamlsf/learn-ocaml/tags>

[submitted to OPAM default repository]
<https://github.com/ocaml/opam-repository/pull/19787>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-09-28  6:37 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-09-28  6:37 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of September 21 to
28, 2021.

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

Brr 0.0.2, a toolkit for programming browsers
Become an Outreachy Mentor: support the growth and diversity of the OCaml community
OCaml 4.13.0 (and 4.12.1)
Other OCaml News
Old CWN


Brr 0.0.2, a toolkit for programming browsers
═════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-brr-0-0-2-a-toolkit-for-programming-browsers/8521/1>


Daniel Bünzli announced
───────────────────────

  It's my pleasure to announce the release `0.0.2' of [`Brr'], a toolkit
  for programming browsers in OCaml with the [`js_of_ocaml'] compiler.

  Once it has made it to the repo, install with `opam install brr' and
  consult the [API docs and manuals] (or via `odig doc brr').

  This release fixes binding bugs, adds a few new bindings and tweaks
  some existing signatures. Thanks to all of those who provided bug
  reports, suggestions and code.

  The [release notes] have all the details.


[`Brr'] <https://erratique.ch/software/brr>

[`js_of_ocaml'] <https://ocsigen.org/js_of_ocaml>

[API docs and manuals] <https://erratique.ch/software/brr/doc/>

[release notes]
<https://github.com/dbuenzli/brr/blob/master/CHANGES.md#v002-2020-09-23-zagreb>


Become an Outreachy Mentor: support the growth and diversity of the OCaml community
═══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-and-diversity-of-the-ocaml-community/8213/13>


Thibaut Mattio announced
────────────────────────

  I've submitted two projects for the winter session:

  • Integrate a package health check in ocaml.org

  To essentially integrate a version of check.ocamllabs.io that can be
  used by opam-repository maintainers and opam users into the next
  version of ocaml.org (<https://v3.ocaml.org>).

  • Support `.eml' files in OCaml's VSCode extension

  To add support for Dream's [`.eml' files] syntax in the extension, and
  eventually have error reporting for these files from OCaml LSP Server.

  I'm more than interested in having co-mentors for these two projects,
  so if you wanted to mentor Outreachy interns but didn't have any
  project ideas, don't hesitate to reach out :slight_smile:

  Another way to help that does not involve mentoring is to find good
  first issues that will help onboard and select candidates for the
  projects. Any help on this effort to identify, create and document
  good first issues for the different projects is more than welcome!


[`.eml' files]
<https://github.com/aantron/dream/tree/master/example/7-template>


OCaml 4.13.0 (and 4.12.1)
═════════════════════════

  Archive: <https://discuss.ocaml.org/t/ocaml-4-13-0-and-4-12-1/8529/1>


octachron announced
───────────────────

  The OCaml team ha the pleasure of celebrating the 175th anniversary of
  the discovery of Neptune by announcing the joint releases of OCaml
  version 4.13.0 and 4.12.1 .

  Some of the highlights in the 4.13.0 release are:

  • Safe points: a multicore prerequisite that ensures that
    ocamlopt-generated code can always be interrupted.
  • The best-fit GC allocation policy is now the default policy (and
    many other GC improvements).
  • Named existential type variables in pattern matching: `Showable
    (type a) (x, show : a * (a -> string))'.

  • Improved error messages for functor application and functor types.
  • Let-punning for monadic let: `let* x = x in' can be shortened to
    `let* x in'.
  • Module type substitutions: `SIG with module type T = F(X).S'.

  • Many other quality of life improvements
  • Many bug fixes

  The 4.12.1 release is a collection of safe bug fixes, cherry-picked
  from the 4.13.0 development cycle. If you were using OCaml 4.12.0 and
  cannot yet upgrade to 4.13.0, this release is for you.

  The full list of changes can be found in the changelogs
  below. (*Editor note*: as it’s quite long, it is not included
  here. Please follow the link to the original article to read it.)

  Those releases are available as OPAM switches, and as a source
  download here:

  • <https://github.com/ocaml/ocaml/archive/4.13.0.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.13/>

  and there:

  • <https://github.com/ocaml/ocaml/archive/4.12.1.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.12/>


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Announcing Tezos’ 8th protocol upgrade proposal: Hangzhou]
  • [Measuring OCaml compilation speed after a refactoring]
  • [Writing Lifters Using Primus Lisp]
  • [Tarides Returns to FIC 2021]
  • [Generating static and portable executables with OCaml]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Announcing Tezos’ 8th protocol upgrade proposal: Hangzhou]
<https://marigold.dev/blog/announcing-hangzhou/>

[Measuring OCaml compilation speed after a refactoring]
<http://gallium.inria.fr/blog/measuring-compilation-time/>

[Writing Lifters Using Primus Lisp]
<http://binaryanalysisplatform.github.io/2021/09/15/writing-lifters-using-primus-lisp/>

[Tarides Returns to FIC 2021]
<https://tarides.com/blog/2021-09-06-tarides-returns-to-fic-2021>

[Generating static and portable executables with OCaml]
<https://www.ocamlpro.com/2021/09/02/generating-static-and-portable-executables-with-ocaml/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-09-21  9:09 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-09-21  9:09 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of September 14 to
21, 2021.

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

opam-grep: search through the sources of all the packages in opam-repository
Hardcaml MIPS CPU Learning Project and Blog
Puzzling through some GADT errors
Parany for multicore OCaml
OCaml 4.13.0, second release candidate
Unicode 14.0.0 update for Uucd, Uucp, Uunf and Uuseg
Set up OCaml 2.0.0-beta4
Become an Outreachy Mentor: support the growth and diversity of the OCaml community
The OCaml 4.13 preview for Merlin is now available
Old CWN


opam-grep: search through the sources of all the packages in opam-repository
════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-opam-grep-search-through-the-sources-of-all-the-packages-in-opam-repository/8434/3>


Kate announced
──────────────

  I've just released opam-grep.0.2.0 with quite a bit of change compared
  to the previous version. Here is the highlight:
  • Complete rewrite from shell script to OCaml, making it more portable
  • Use the faster `ripgrep' and `ugrep' over `grep' when available
    (suggestion by @Engil)
  • Use the `progress' library to show progress instead of a
    non-portable/DIY spinner

  See the [changelog] for the full list of relevant changes.

  *Big thanks to @CraigFe for the `progress' library (such a treat!) and
  to @dbuenzli for `bos' and `cmdliner' in particular, making it easy to
  do such rewrite* :relaxed:


[changelog]
<https://github.com/kit-ty-kate/opam-grep/blob/master/CHANGES.md>


Hardcaml MIPS CPU Learning Project and Blog
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/hardcaml-mips-cpu-learning-project-and-blog/8088/10>


Alexander (Sasha) Skvortsov announced
─────────────────────────────────────

  Hi everyone! We are excited to announce that we have completed this
  project and blog. Progress has been slow these past few months due to
  work, internships, and college, but we’ve now released [v1.0.0 on
  GitHub]. We also published posts on:

  • [Design patterns, conventions, and testing]
  • [How the Always DSL can be used to write safe “pseudo-imperative”
    code in Hardcaml]
  • [Hardcaml’s testing and interactive simulation tools]
  • [A recap of some interesting hardware/CPU features in our design]

  Finally, we published a [conclusion blog post], which wraps up some
  strengths/weaknesses of Hardcaml, as well as some takeaways on OCaml
  and blogging more generally.

  Thank you to @andyman and @fyquah95 for building Hardcaml, and for
  helping us out on GitHub issues! We really appreciate your time and
  suggestions.

  Overall, we’ve come to the conclusion that Hardcaml is a much better
  tool for hardware design than Verilog. This has been a great
  experience, and we walk away with a better understanding of hardware,
  functional programming, and technical writing.


[v1.0.0 on GitHub]
<https://github.com/askvortsov1/hardcaml-mips/releases/tag/v1.0.0>

[Design patterns, conventions, and testing]
<https://ceramichacker.com/blog/14-8x-design-patterns-conventions-and-testing>

[How the Always DSL can be used to write safe “pseudo-imperative” code
in Hardcaml]
<https://ceramichacker.com/blog/15-9x-always-dsl-and-the-control-unit>

[Hardcaml’s testing and interactive simulation tools]
<https://ceramichacker.com/blog/16-10x-testing-and-debugging-hardcaml>

[A recap of some interesting hardware/CPU features in our design]
<https://ceramichacker.com/blog/18-11x-cpu-functionality-wrap-up>

[conclusion blog post]
<https://ceramichacker.com/blog/20-1212-project-conclusion>


Puzzling through some GADT errors
═════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/puzzling-through-some-gadt-errors/8478/8>


Deep in this thread, gasche said
────────────────────────────────

  Not exactly what you are asking for, but @Octachron wrote an excellent
  [chapter on GADTs] in the OCaml manual, which could be recommended to
  people starting GADT programming. It explains why recursive functions
  on GADT need "explicit polymorphic annotations" in less
  "implementation driven" terms.

  (The chapter also demonstrates the new naming scheme for existential
  type variables introduced by GADT constructors, which can help a lot
  working through type errors, but are still a bit heavy and deserve a
  gentle introduction.)


[chapter on GADTs] <https://ocaml.org/releases/4.12/manual/gadts.html>


octachron then added
────────────────────

  I have only written the nomenclature part and a bit of the explanation
  for recursive functions in this chapter, @garrigue is the author of
  most of this chapter.


Parany for multicore OCaml
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/parany-for-multicore-ocaml/8495/1>


UnixJunkie announced
────────────────────

  There is now an implementation using multicore-OCaml in the 'domains'
  branch.

  <https://github.com/UnixJunkie/parany/tree/domains>

  People are very welcome to give it a try and share the speedup they
  observe, especially compared to fork-based parallelism.

  Thanks to @nilsbecker for having motivated me.


UnixJunkie later added
──────────────────────

  If you don't use the domains branch, then parany is using fork-based
  parallelism.  If you want to use the domains branch, you need to
  install multicore-ocaml first:
  ┌────
  │ opam switch create 4.12.0+domains
  │ eval `opam config env`
  └────


OCaml 4.13.0, second release candidate
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-13-0-second-release-candidate/8496/1>


octachron announced
───────────────────

  The release of OCaml 4.13.0 is expected for next week.

  Since we had a native code generation bug fix and two minor
  configuration tweaks since the first release candidate, we are
  publishing a second release candidate.  If you find any bugs, please
  report them here:

  <https://github.com/ocaml/ocaml/issues>

  Happy hacking, Florian Angeletti for the OCaml team.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands
  ┌────
  │ opam update
  │ opam switch create 4.13.0~rc2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:

  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.13.0~rc2+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────

  where <option_list> is a comma separated list of ocaml-option-*
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 4.13.0~rc2+flambda+nffa
  │ --packages=ocaml-variants.4.13.0~rc2+options,ocaml-option-flambda,ocaml-option-no-flat-float-array
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  All available options can be listed with "opam search ocaml-option".

  The source code for the release candidate is also available at these
  addresses:

  • <https://github.com/ocaml/ocaml/archive/4.13.0-rc2.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.0~rc2.tar.gz>


Changes since the first release candidate
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • [#10626], [#10628]: Wrong reloading of the x86-64 instruction for
    integer multiplication by a constant, causing the assembler to
    reject the ocamlopt-generated code. (Xavier Leroy, report by Dave
    Aitken, review by Vincent Laviron)

  • [#10176], [#10632(new in rc2)]: By default, call the assembler
    through the C compiler driver (Sébastien Hinderer, review by Gabriel
    Scherer, David Allsopp and Xavier Leroy)

  • [#10451], [#10635(new in rc2)]: Replace the use of iconv with a C
    utility to convert $(LIBDIR) to a C string constant on Windows when
    building the runtime. Hardens the generation of the constant on Unix
    for paths with backslashes, double-quotes and newlines. (David
    Allsopp, review by Florian Angeletti and Sébastien Hinderer)


[#10626] <https://github.com/ocaml/ocaml/issues/10626>

[#10628] <https://github.com/ocaml/ocaml/issues/10628>

[#10176] <https://github.com/ocaml/ocaml/issues/10176>

[#10632(new in rc2)] <https://github.com/ocaml/ocaml/issues/10632>

[#10451] <https://github.com/ocaml/ocaml/issues/10451>

[#10635(new in rc2)] <https://github.com/ocaml/ocaml/issues/10635>


Unicode 14.0.0 update for Uucd, Uucp, Uunf and Uuseg
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-unicode-14-0-0-update-for-uucd-uucp-uunf-and-uuseg/8497/1>


Daniel Bünzli announced
───────────────────────

  Unicode 14.0.0 was released on the 14th of september.

  It adds 838 new characters to the standard including, for our friends
  from Central Asia, support for [Old Uyghur].  For information about
  all the other additions, see [the announcement page].

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

  Best,

  Daniel

  P.S. Though I'm not very fond of the concept, I recently enabled
  sponsors on my github account as an experiment. So I'd like to thanks
  my [github sponsors], @davesnx became the first one monday.


[Old Uyghur]
<https://unicode.org/charts/PDF/Unicode-14.0/U140-10F70.pdf>

[the announcement page]
<http://blog.unicode.org/2021/09/announcing-unicode-standard-version-140.html>

[github sponsors] <https://github.com/sponsors/dbuenzli/>


Set up OCaml 2.0.0-beta4
════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta4/8501/1>


Sora Morimoto announced
───────────────────────

Changed
╌╌╌╌╌╌╌

  • Set `OPAMSOLVERTIMEOUT' to `1000' to avoid a timeout even if the
    opam solver is slow.
  • Increase cache hit ratio by loosening restore keys of opam cache.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta4>


Become an Outreachy Mentor: support the growth and diversity of the OCaml community
═══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-and-diversity-of-the-ocaml-community/8213/8>


Sonja Heinze announced
──────────────────────

  Hey all, I've just submitted an Outreachy project for the winter
  round. The project is to write the basic ppx_deriving plugins in
  ppxlib; that is, the ones that don't already have a version based on
  ppxlib. I think both, having them available to use, and having their
  code available as simple examples of how to use Ppxlib.Deriving would
  be very nice! And improving ppxlib's documentation and finding simple
  issues on already existing PPXs to prepare for Outreachy, will be
  beneficial as well.

  Of course, it's not clear if someone with the right interest comes
  along for this project, but if we don't find an intern for it this
  round, I can just re-submit the same project next round.


Sonja Heinze
────────────

  Btw, the deadline to submit projects was extended and is now Sept
  23rd. So the timeline in our post above is slightly outdated.


The OCaml 4.13 preview for Merlin is now available
══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-the-ocaml-4-13-preview-for-merlin-is-now-available/8436/6>


Continuing this thread, Kate announced
──────────────────────────────────────

  The OCaml 4.13 preview for ocaml-lsp-server is now available as well.

  To install it along with the OCaml 4.13 rc, please refer to the first
  post.

  If you encounter any problems while using ocaml-lsp-server, please
  feel free to report it directly in
  <https://github.com/ocaml/ocaml-lsp/pull/506>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-09-07 13:23 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-09-07 13:23 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of August 31 to
September 07, 2021.

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

Just reinvented OOP
v3.OCaml.org: A roadmap for OCaml's online presence
Become an Outreachy Mentor: support the growth and diversity of the OCaml community
Generating static and portable executables with OCaml
OCaml quant-developer at Bloomberg. London or New York
HTTP client library
Other OCaml News
Old CWN


Just reinvented OOP
═══════════════════

  Archive: <https://discuss.ocaml.org/t/just-reinvented-oop/8399/1>


Yawar Amin said
───────────────

  ┌────
  │ let ( .![] ) obj f = f obj
  │ 
  │ type person = { id : int; name : string }
  │ 
  │ let id { id; _ } = id
  │ 
  │ let bob = { id = 1; name = "Bob" }
  │ let next_id = bob.![id].![succ]
  └────

  ==> 2


Kiran Gopinathan replied
────────────────────────

  Haha, what a coincidence, just did the same very recently while
  translating a rust library to OCaml:
  <https://github.com/Gopiandcode/ego/blob/5daf312f8a444f9abcde5996c671b9282727a972/lib/generic.ml#L211>
  ┌────
  │ let eclasses = eg.@[eclasses] in
  │ let cost_map = Id.Map.create 10 in
  │ let node_total_cost node =
  │   let has_cost id = Id.Map.mem cost_map (eg.@[find] id) in
  │   if List.for_all has_cost (L.children node)
  │   then let cost_f id = fst @@ Id.Map.find cost_map (eg.@[find] id) in Some (E.cost cost_f
  │ node)
  │   else None in
  │   (* ... *)
  └────
  with `.@[]' defined as:
  ┌────
  │ let (.@[]) self fn = fn self [@@inline always]
  └────

  for bonus(?) points, you can name the first parameter self:
  ┌────
  │ let add_enode self (node: Id.t L.shape) =
  │   let node = self.@[canonicalise] node in
  │   (* ... *)
  └────
  I don't normally write code like this in OCaml, but in this case, it
  made porting from rust easier, because the code mostly looked the
  same.


hyphenrf also replied
─────────────────────

  You can use the multiple-indexing syntax to implement slicing (well,
  technically subs) sugar:
  ┌────
  │ let (.:[;..]) s = function
  │   | [|start; finish|] -> String.sub s start (finish - start)
  │   | _ -> raise (Invalid_argument "slice takes exactly two indexes")
  └────
  ┌────
  │ # "hello world".:[1;5];;
  │ - : string = "ello"
  └────
  The new indexing syntax is quite versatile :>


Kiran Gopinathan added
──────────────────────

  Oh wow, this is perfect! brb, off to reimplement the python slicing
  semantics in OCaml:
  ┌────
  │ let (.@[;..]) ls = function[@warning "-8"]
  │   | [| start; -1 |] ->
  │     List.to_iter ls
  │     |> Iter.zip_i
  │     |> Iter.drop_while (Pair.fst_map ((>) start))
  │     |> Iter.map snd
  │   | [| start; finish |] ->
  │     List.to_iter ls
  │     |> Iter.zip_i
  │     |> Iter.drop_while (Pair.fst_map ((>) start))
  │     |> Iter.take_while (Pair.fst_map ((>) finish))
  │     |> Iter.map snd
  │   | [| start; finish; step |] ->
  │     List.to_iter ls
  │     |> Iter.zip_i
  │     |> Iter.drop_while (Pair.fst_map ((>) start))
  │     |> Iter.take_while (Pair.fst_map ((>) finish))
  │     |> Iter.filter (Pair.fst_map (fun ind -> (ind - start) mod step = 0))
  │     |> Iter.map snd
  └────


v3.OCaml.org: A roadmap for OCaml's online presence
═══════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/v3-ocaml-org-a-roadmap-for-ocamls-online-presence/8368/19>


Continuing this thread, Anil Madhavapeddy replied to many comments
──────────────────────────────────────────────────────────────────

  Many thanks for all the constructive comments and suggestions so far,
  and also for those who have gotten in touch to contribute. Please do
  keep them coming (either on this thread or on the various issue
  trackers that @jonludlam and @patricoferris have pointed to).  I'll
  answer some earlier questions here:

        Having said that, the colors on the [packages landing page
        ] feel very aggressive to me. Might be my setup here, but
        I would like to have a slightly less harsh contrast.

        Also, there is a bit of an overlap in content with
        [https://ocamlverse.github.io/ ] for some things (eg best
        practices, community) but the (to me) most valuable
        feature is missing: The ecosystems overview, where I can
        find packages sorted thematically. Could such a section
        also have a place in the packages subpage somewhere?
        Alternatively, maybe opam can allow to “tag” packages in
        the future so one could see all packages for graphics,
        databases etc.

  The styling of the /packages sub-URL does indeed differ from the main
  design, but this is simply due to a temporary technical detail. The
  majority of the site uses React/NextJS to generate the frontend, and
  this uses the now-trendy medium-contrast colours and also features
  like fast-page-switching that NextJS offers.  However, the
  documentation portion generated around 2.7 million individual pages
  when run across the full opam repository, and so we restored to
  dynamic generation of the content for that. What's going to happen
  next is a rationalisation of the code across the ReScript and OCaml
  frontends so that there will be no observable difference in the colour
  schemes across the full site.

  Regarding creating a categorised list of recommendations, that is
  absolutely in scope for the v3 iteration of the site. However, this
  metadata should ideally live in the opam-repository (for example,
  using `tags' as you suggest, which opam already supports). If anyone
  would like to have a go at this, I'd encourage PRs to the
  opam-repository to add the relevant tag metadata for a
  codex. Meanwhile, @lambda_foo @tmattio and @patricoferris are working
  on the core OCaml Platform workflow information for the guides section
  of the website which will cover opam, merlin, lsp-server, dune and so
  on.

        Do we have access to all of the previous years’ workshops
        to add to [watch.ocaml.org]?  I can see pieces of 2015,
        2017, 2020 and this year. @avsm

        Is it possible to add the ML Workshop as well?

  Absolutely. The watch.ocaml.org has held up nicely after the OCaml
  Workshop, so I think it's in good shape to populate with more
  videos. This needs a volunteer to help us upload the past [nine years]
  of videos from YouTube to watch.ocaml.org. If anyone wants to have a
  go, please message me and I'll create you an account.

        It’s a bit unclear what you meant in this paragraph. Does
        that mean that you plan to kill the ocaml planet ? I would
        find it a little bit sad.

        One of the reason why you may feel it doesn’t work well
        may be that it has been constantly broken in the current
        version of the site…

  I'm not sure why you think the current ocaml.org new feed has been
  broken – it's been working fairly reliably for the past decade. The
  only real problem came up a few times when a feed's domain expired and
  got taken over by domain squatters, at which point we got spam into
  the main page of ocaml.org.

  What I meant with that part of the announcement is that the
  syndication feed should not be mistaken with original news on the
  website. Right now it's difficult to distinguish official
  announcements (such as compiler or opam releases) as they are a little
  scattered (e.g. on opam.ocaml.org). The plan is to combine the
  [platform-blog] with the new website directly. I've also been
  considering just having a special tag on this forum so that nice
  announcement posts could also be syndicated to the website easily (for
  example, @gasche's compiler newsletters).

  My general desire is to _grow_ the planet feed and syndication system,
  but to clearly demarcate them as not being published by ocaml.org and
  to manage them via more modern decentralised techniques that feature
  spam, moderation and archival. PeerTube is a good example of this for
  videos that is working well, and I'd welcome suggestions for Atom/RSS
  (there must be something in this space, ideally ActivityPub-based).

  Depending on how the experiments go, it's very likely that we'll have
  a Matrix homeserver for ocaml.org where CI bots can report status
  information (see this [prototype PR]) for ocaml-ci that will also
  apply to opam-repository. The goal here is to for ocaml.org to publish
  its data using an open protocol, which can then be syndicated into
  whatever technologies are in vogue (e.g. Discord, Slack, Teams, …).

  So if you spot some decentralised syndication system that you think
  might be interesting for OCaml, please do let me know.  Even better,
  if you'd like to develop one to tailor it to our needs, let me know
  even sooner ;-)


[packages landing page ] <https://v3.ocaml.org/packages>

[https://ocamlverse.github.io/ ] <https://ocamlverse.github.io/>

[watch.ocaml.org] <http://watch.ocaml.org>

[nine years] <https://ocaml.org/meetings/ocaml/2012/>

[platform-blog] <https://github.com/ocaml/platform-blog>

[prototype PR] <https://github.com/ocurrent/ocaml-ci/pull/362>


Become an Outreachy Mentor: support the growth and diversity of the OCaml community
═══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-and-diversity-of-the-ocaml-community/8213/3>


Anil Madhavapeddy announced
───────────────────────────

  There's been a very disappointing response to this call for mentors to
  increase the diversity of our community. Precisely *noone* has been in
  touch for the winter call, leaving the burden of mentorship on the
  same people that did all the work this summer.

  Before making [new calls for programs like GSoC], let's get Outreachy
  onto more sustainable ground please. We are purely limited by
  mentorship time at present. This can be as simple as organising new
  first issues for projects in the ecosystem, and all the way to pair
  programming with a mentee. You can chose how to be involved.


[new calls for programs like GSoC]
<https://discuss.ocaml.org/t/v3-ocaml-org-a-roadmap-for-ocamls-online-presence/8368/16?u=avsm>


Generating static and portable executables with OCaml
═════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/generating-static-and-portable-executables-with-ocaml/8405/1>


OCamlPro announced
──────────────────

  It has been a few times now that we have been tasked to generate
  portable binaries for different projects. Over time, we have gathered
  quite some know-how and, seeing the question frequently arise in the
  community, we decided to share this experience.

  You can find the article written by Louis Gesbert on[ the OCamlPro
  blog]


        Distributing OCaml software on opam is great (if I dare
        say so myself), but sometimes you need to provide your
        tools to an audience outside of the OCaml community, or
        just without recompilations or in a simpler way.

        However, just distributing the locally generated binaries
        requires that the users have all the required shared
        libraries installed, and a compatible libc. It's not
        something you can assume in general, and even if you don't
        need any C shared library or are confident enough it will
        be installed everywhere, the libc issue will arise for
        anyone using a distribution based on a different kind, or
        a little older than the one you used to build.

        There is no built-in support for generating static
        executables in the OCaml compiler, and it may seem a bit
        tricky, but it's not in fact too complex to do by hand,
        something you may be ready to do for a release that will
        be published. So here are a few tricks, recipes and advice
        that should enable you to generate truly portable
        executables with no external dependency whatsoever. Both
        Linux and macOS will be treated, but the examples will be
        based on Linux unless otherwise specified.

  Don't hesitate to share your thoughts with us, have a good reading!


[ the OCamlPro blog]
<https://www.ocamlpro.com/2021/09/02/generating-static-and-portable-executables-with-ocaml/>


OCaml quant-developer at Bloomberg. London or New York
══════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-quant-developer-at-bloomberg-london-or-new-york/8409/1>


Philip Craig announced
──────────────────────

  Extend a financial contracts DSL that is implemented in OCaml.

  It's London or New York based. It's not a remote position.

  Please see details and/or apply at
  (<https://careers.bloomberg.com/job/detail/93825>)


HTTP client library
═══════════════════

  Archive: <https://discuss.ocaml.org/t/ann-http-client-library/8428/1>


Hannes Mehnert announced
────────────────────────

  we just released to the opam-repository the [`http-lwt-client']
  package, which consists of both a library doing HTTP requests and a
  binary (`hurl') that does HTTP requests.

  The code is based on [HTTP/AF] and [H2], and uses [tls] for HTTPS
  connections. Both HTTP/1(.1) and HTTP/2 protocols are supported. The
  motivation behind this package is to have a http client that has a
  reasonably small dependency cone, is purely implemented in OCaml, and
  uses the asynchronous task library lwt.

  This package uses [happy-eyeballs] to connect to a remote host via
  IPv4 and IPv6, as proposed by IETF [RFC 8305]: on any computer with
  either IPv4 or IPv6 connectivity, a remote IPv6 or IPv4 server will be
  connected. Preference is given to IPv6.

  If a https url is provided, the server certificate is verified using
  the [ca-certs] package.

  If you experience any issues or have further needs for this package,
  please report an issue on the GitHub issue tracker.

  The installation is just an `opam install http-lwt-client' away :)


[`http-lwt-client'] <https://github.com/roburio/http-lwt-client>

[HTTP/AF] <https://github.com/inhabitedtype/httpaf>

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

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

[happy-eyeballs] <https://github.com/roburio/happy-eyeballs>

[RFC 8305] <https://tools.ietf.org/html/rfc8305>

[ca-certs] <https://github.com/mirage/ca-certs>


Hannes Mehnert later added
──────────────────────────

  now [0.0.2] is released that unifies the response type and API
  (previously it was a variant and clients had to write code for both
  HTTP1 and HTTP2). Now, a single record and Status/Headers/Version
  module aliases are provided (very close to HTTP/AF). Enjoy.


[0.0.2] <https://github.com/ocaml/opam-repository/pull/19410>


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Goodbye Core_kernel]
  • [Tarides Engineers to Present at ICFP 2021]
  • [Benchmarking OCaml projects with current-bench]
  • [What the interns have wrought, 2021 edition]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Goodbye Core_kernel] <https://blog.janestreet.com/goodbye-Core_kernel/>

[Tarides Engineers to Present at ICFP 2021]
<https://tarides.com/blog/2021-08-26-tarides-engineers-to-present-at-icfp-2021>

[Benchmarking OCaml projects with current-bench]
<https://tarides.com/blog/2021-08-26-benchmarking-ocaml-projects-with-current-bench>

[What the interns have wrought, 2021 edition]
<https://blog.janestreet.com/what-the-interns-have-wrought-2021/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-08-24 13:44 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-08-24 13:44 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of August 17 to 24,
2021.

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

routes v1.0.0 released
Feather 0.3.0
Release of GopCaml-mode (0.0.3) and GopCaml-mode-Merlin (0.0.4) - Wizardry release
Share my experience about running OCaml on WebAssembly
Old CWN


routes v1.0.0 released
══════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-routes-v1-0-0-released/8319/1>


Anurag Soni announced
─────────────────────

  I'd like to announce release of version 1.0.0 of [routes]. The PR to
  opam repository has been merged, and the new release should be
  available via opam once the package cache refreshes.

  *Routes* provides a DSL for bi-directional URI dispatch. It allows
  writing route definitions that can be used for both matching, and
  printing URI paths.

  Changes since the last opam release:

  • Support for merging two routers by adding a union operation ([#115],
    [@Chattered])
  • Support for wildcard parameters ([#118], [#129], [@Lupus]) ->
    Compile time checks ensure that wildcard parameters can only be
    defined at the end of a route
  • Support `map' operation for path parameter definitions, and support
    defining path prefixes that can be pre-prended to other routes
    ([#121], [@Chattered])
  • Addition of a `ksprintf' style function for routes. ([#123],
    [@Chattered])

  Examples of how to use the library are available in the [tests] and in
  a [small demo]

  Documentation can be found [here]

  *Edit*

  1.0.0 is available via opam now -
  <http://opam.ocaml.org/packages/routes/routes.1.0.0/>


[routes] <https://github.com/anuragsoni/routes/>

[#115] <https://github.com/anuragsoni/routes/pull/115>

[@Chattered] <https://github.com/Chattered>

[#118] <https://github.com/anuragsoni/routes/pull/118>

[#129] <https://github.com/anuragsoni/routes/pull/129>

[@Lupus] <https://github.com/Lupus>

[#121] <https://github.com/anuragsoni/routes/pull/121>

[#123] <https://github.com/anuragsoni/routes/pull/123>

[tests]
<https://github.com/anuragsoni/routes/blob/b9bb8a0f50b7bd9fbd0c79113142ea82830ce2bb/test/routing_test.ml>

[small demo]
<https://github.com/anuragsoni/routes/blob/b9bb8a0f50b7bd9fbd0c79113142ea82830ce2bb/example/no_http.ml>

[here] <https://anuragsoni.github.io/routes/>


Feather 0.3.0
═════════════

  Archive: <https://discuss.ocaml.org/t/ann-feather-0-3-0/8322/1>


Charles announced
─────────────────

  I'm happy to announce Feather 0.3.0! Feather is a minimal library for
  bash-like scripting and process execution.  ([github/tutorial],
  [documentation]) This release adds two major features:


[github/tutorial] <https://github.com/charlesetc/feather>

[documentation]
<https://www.charlesetc.com/feather/feather/Feather/index.html>

1. A new interface for collecting the exit status, stdout, and stderr of a Feather command.
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  For example, you can easily print a process's stderr if it exits
  non-zero:

  ┌────
  │ open Feather;;
  │ let stderr, status =
  │   process "ls" [ "/tmp/does-not-exist" ] |> collect stderr_and_status
  │ in
  │ if status <> 0 then failwith ("ls failed with stderr:\n" ^ stderr)
  └────
  where the types are

  ┌────
  │ val process : string -> string list -> cmd
  │ 
  │ type 'a what_to_collect
  │ val stderr_and_status : (string * int) what_to_collect
  │ 
  │ val collect :
  │   ?cwd:string ->
  │   ?env:(string * string) ->
  │   'a what_to_collect ->
  │   cmd ->
  │   'a
  └────

  as you can imagine, we expose several of these
  `what_to_collect''s. Here's the full set:

  ┌────
  │ val stdout : string what_to_collect
  │ val stderr : string what_to_collect
  │ val status : int what_to_collect
  │ 
  │ val stdout_and_stderr : (string * string) what_to_collect
  │ val stdout_and_status : (string * int) what_to_collect
  │ val stderr_and_status : (string * int) what_to_collect
  │ 
  │ type everything = { stdout : string; stderr : string; status : int }
  │ val everything : everything what_to_collect
  └────
  We considered different design approaches here. I think what we landed
  on keeps the call site readable and the types of the interface simple.

  It should be noted: the simplest way to run a command without
  collecting anything is to use [Feather.run].


[Feather.run]
<https://www.charlesetc.com/feather/feather/Feather/index.html#val-run>


2. The ability to wait on background processes and collect their output.
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Starting with Feather 0.1.0, you were able to start processes in the
  background, but the only way to wait for them to complete was to use
  Feather's [async wrapper].  For those wanting an async-less,
  direct-style interface, we now expose new methods to do this properly:

  ┌────
  │ type 'a background_process
  │ 
  │ val run_in_background :
  │   ?⁠cwd:string ->
  │   ?⁠env:(string * string) Base.list ->
  │   cmd ->
  │   unit background_process
  │ 
  │ val collect_in_background :
  │   ?cwd:string ->
  │   ?env:(string * string) list ->
  │   'a what_to_collect ->
  │   cmd ->
  │   'a background_process
  │ 
  │ val wait : 'a background_process -> 'a
  │ val wait_all : unit -> unit
  └────
  where an example use might be

  ┌────
  │ let server_process =
  │    process "my-server.exe" [] |> collect_in_background stdout_and_status
  │ in
  │ ... do other things ...
  │ match Feather.wait server_process with
  │ | (stdout, 0) -> ...
  │ | (_, 1) -> ...
  └────

  Thanks again to @Firobe and @tmarti2 for their contributions to this
  release! I think we've made a lot of progress here and I'm excited to
  see where things go :slight_smile:


[async wrapper]
<https://www.charlesetc.com/feather/feather_async/Feather_async/index.html>


Release of GopCaml-mode (0.0.3) and GopCaml-mode-Merlin (0.0.4) - Wizardry release
══════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-release-of-gopcaml-mode-0-0-3-and-gopcaml-mode-merlin-0-0-4-wizardry-release/8333/1>


Kiran Gopinathan announced
──────────────────────────

  I'm pleased to announce the latest version of *GopCaml-mode* (0.0.3),
  and the new release of *GopCaml-mode-Merlin* (0.0.4).

  GopCaml-mode-Merlin is a brand *new!* variant of GopCaml-mode that
  uses the Merlin parser rather than the OCaml compiler-libs one, and
  thus has some level of robustness to invalid syntax:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/a/a09586b9db3bf19667b6969c701a40f0791a2a9d.gif>

  If that's piqued your interest, I'd recommend checking out the release
  posts for the previous versions for more details on what GopCaml can
  do, and how to get it: [0.0.2 release], [0.0.1 release]

  The Merlin parser seems to assign text-regions for syntactic
  constructs slightly more liberally than the standard OCaml parser, so
  the overlays can feel a bit weird if you're used to the normal GopCaml
  overlays, but the benefit is that all your favorite structural
  movement/transformation operations work even when you're dealing with
  ill-formed programs, allowing for a more fluid editing experience:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/9/9f2976b47018e2d892b9cea09da913d07f8c1f00.gif>


[0.0.2 release]
<https://discuss.ocaml.org/t/ann-release-of-gopcaml-mode-0-0-2-unicode-compatibility-update/7425>

[0.0.1 release]
<https://discuss.ocaml.org/t/introducing-gopcaml-mode-structural-ocaml-editing/5310>

Detailed Changelog
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • *new!* [for GopCaml-mode-Merlin] *Robustness to ill-formated syntax*
    • Vendored a copy of Merlin to reuse its parser and thereby gain
      it's robustness to invalid syntax.
  • *new!* *Added support for customisable verbosity*
    • Customise the Emacs variable `gopcaml-messaging-level` to change
      the level of messages that are output by GopCaml. Set it to
      `'none` to disable messages entirely.
  • *new!* *Fixed bug when starting zipper mode at the start of a file.*
    • Zipper mode selects the immediately prior byte position to avoid
      inconsistencies when the cursor is just on the edge of an
      expression, but when the cursor is at position 1, this causes an
      error as 0 is not a valid point.
  • *new!* *Special casing of shebangs*
    • Added support for handling shebangs at the start of a buffer.
    • Implemented as part of a larger library for preprocessing
      buffertext before running the parser on it - could be extended to
      support additional preprocessing in the future.
    • Another possible direction for extension is to use an Emacs
      callback to modify the text, although this may not be ideal, as
      the parsing has to be as fast as possible.


Get Gopcaml-mode
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Its as easy as 1, 2, 3!

  1. Install from opam (either `gopcaml-mode` xor
     `gopcaml-mode-merlin`):

     ┌────
     │ opam install gopcaml-mode
     └────
     or
     ┌────
     │ opam install gopcaml-mode-merlin
     └────

  2. Compile your emacs with support for dynamic modules
  3. Load gopcaml-mode in your init.el:
     ┌────
     │ (let ((opam-share (ignore-errors (car (process-lines "opam" "var" "share")))))
     │     (when (and opam-share (file-directory-p opam-share))
     │       ;; Register Gopcaml mode
     │       (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
     │ 	(autoload 'gopcaml-mode "gopcaml-mode" nil t nil)
     │ 	(autoload 'tuareg-mode "tuareg" nil t nil)
     │ 	(autoload 'merlin-mode "merlin" "Merlin mode" t)
     │       ;; Automatically start it in OCaml buffers
     │       (setq auto-mode-alist
     │       (append '(("\\.ml[ily]?$" . gopcaml-mode)
     │ 	  ("\\.topml$" . gopcaml-mode))
     │ 	auto-mode-alist))
     │       ))
     └────

  See the [release post ] for version 0.0.1 for detailed instructions on
  how you can install it.


[release post ]
<https://discuss.ocaml.org/t/introducing-gopcaml-mode-structural-ocaml-editing/5310>


Contribute
╌╌╌╌╌╌╌╌╌╌

  • Github: [GitHub - Gopiandcode/gopcaml-mode: [MIRROR] Ultimate Ocaml
    Editing Mode]
  • Gitlab: [Kiran Gopinathan / gopcaml-mode · GitLab ]


[GitHub - Gopiandcode/gopcaml-mode: [MIRROR] Ultimate Ocaml Editing
Mode] <https://github.com/Gopiandcode/gopcaml-mode>

[Kiran Gopinathan / gopcaml-mode · GitLab ]
<https://gitlab.com/gopiandcode/gopcaml-mode>


Share my experience about running OCaml on WebAssembly
══════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/share-my-experience-about-running-ocaml-on-webassembly/8343/1>


Vincent Chan announced
──────────────────────

  In the last two weeks, I was working on migrating OCaml to
  WebAssembly. I wrote an article to share my experience.

  [Run OCaml in the browser by WebAssembly | by Vincent Chan | Aug, 2021
  | Medium]


[Run OCaml in the browser by WebAssembly | by Vincent Chan | Aug, 2021 |
Medium]
<https://okcdz.medium.com/run-ocaml-in-the-browser-by-webassembly-31ce464594c6>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-08-17  6:24 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-08-17  6:24 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of August 10 to 17,
2021.

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

http-multipart-formdata v3.0.1 released
Call for participation: ML Family Workshop 2021
Coq-of-ocaml to translate OCaml to Coq
Old CWN


http-multipart-formdata v3.0.1 released
═══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-http-multipart-formdata-v3-0-1-released/8261/2>


Continuing the thread from last week, Hannes Mehnert asked
──────────────────────────────────────────────────────────

  Thanks for your work on that. I'm curious about the different
  "multipart" libraries now available for OCaml – anyone has a brief
  comparison of them?

  • [http-multipart-formdata] as announced above
  • [multipart_form] by @dinosaure
  • [multipart-form-data] by cryptosense

  Are there functional differences? Correctness? Performance? Or just a
  matter of style and co-development?


[http-multipart-formdata]
<https://github.com/lemaetech/http-multipart-formdata>

[multipart_form] <https://github.com/dinosaure/multipart_form/>

[multipart-form-data]
<https://github.com/cryptosense/multipart-form-data>


Bikal Lem replied
─────────────────

  One obvious difference among the three is `http-multipart-formdata'
  doesn't depend on any IO/Promise libraries, such as lwt or async. so
  you may find it easier to integrate in your project.

  `mulitpart-form-data' exposes a callback based streaming api, whereas
  http-multipart-formdata exposes a non-callback, non-blocking based API
  streaming api.

  The API surface of `http-multipart-formdata' is kept as low as
  possible, primarily 3 API calls - `boundary, reader' and `read' call.

  The dependency list of `http-multipart-formdata' is the thinnest. This
  may or may not be an issue depending on your aesthetics. However,
  relatively/comparatively the less your dependencies, the easier it is
  to integrate the lib with other OCaml libs and environments such as
  various OSes.


Bikal Lem added
───────────────

  I should also add `http-multipart-formdata' has been implemented with
  zero-copy streaming and minimal allocation in mind.


Call for participation: ML Family Workshop 2021
═══════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-08/msg00005.html>


Jonathan Protzenko announced
────────────────────────────

  We are happy to announce that the ML Family Workshop is back for its
  2021 edition, which we will be held online on Thursday August 26th, in
  conjunction with ICFP 2021. We invite you to subscribe to, and attend
  the workshop, in addition to the main ICFP conference.

  We are thrilled to announce that Don Syme will give this year's
  keynote: "Narratives and Lessons from The Early History of F#". Please
  join us!

  The program features 14 exciting submissions, including 4 short talks.
  The workshop will be held online in the 6pm-3am time band (Seoul
  Time).  Talks will be pre-recorded and uploaded online for those who
  cannot attend.

  • Program:
    <https://icfp21.sigplan.org/home/mlfamilyworkshop-2021#program>
  • Keynote:
    <https://icfp21.sigplan.org/details/mlfamilyworkshop-2021-papers/15/Keynote-Narratives-and-Lessons-from-The-Early-History-of-F>-
  • ICFP home: <http://icfp21.sigplan.org/home>


Program committee
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Danel Ahman (University of Ljubljana)
  • Robert Atkey (University of Strathclyde)
  • Frédéric Bour (Tarides)
  • Ezgi Çiçek (Facebook London)
  • Youyou Cong (Tokyo Institute of Technology)
  • Richard A. Eisenberg (Tweag I/O)
  • Martin Elsman (University of Copenhagen, Denmark)
  • Ohad Kammar (University of Edinburgh)
  • Naoki Kobayashi (University of Tokyo, Japan)
  • Benoît Montagu (Inria)
  • Jonathan Protzenko (Microsoft Research) (Chair)
  • Kristina Sojakova (INRIA Paris)
  • Don Syme (Microsoft)
  • Matías Toro (University of Chile)
  • Katsuhiro Ueno (Tohoku University)


Coq-of-ocaml to translate OCaml to Coq
══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/coq-of-ocaml-to-translate-ocaml-to-coq/8288/1>


Guillaume Claret announced
──────────────────────────

  I am pleased to present the [coq-of-ocaml] project, to translate a
  subset of OCaml to the [Coq] proof assistant. The aim is to do formal
  verification on OCaml programs. The idea is to generate a Coq
  translation as close as possible to the original code in terms of
  intent but using the Coq syntax. As a short example, if we take the
  following OCaml code and run `coq-of-ocaml':
  ┌────
  │ type 'a tree =
  │ | Leaf of 'a
  │ | Node of 'a tree * 'a tree
  │ 
  │ let rec sum tree =
  │   match tree with
  │   | Leaf n -> n
  │   | Node (tree1, tree2) -> sum tree1 + sum tree2
  └────
  we get the following Coq file:
  ┌────
  │ Require Import CoqOfOCaml.CoqOfOCaml.
  │ Require Import CoqOfOCaml.Settings.
  │ 
  │ Inductive tree (a : Set) : Set :=
  │ | Leaf : a -> tree a
  │ | Node : tree a -> tree a -> tree a.
  │ 
  │ Arguments Leaf {_}.
  │ Arguments Node {_}.
  │ 
  │ Fixpoint sum (tree : tree int) : int :=
  │   match tree with
  │   | Leaf n => n
  │   | Node tree1 tree2 => Z.add (sum tree1) (sum tree2)
  │   end.
  └────

  We support the following OCaml features:
  • the core of OCaml (functions, let bindings, pattern-matching,…)
  • type definitions (records, inductive types, synonyms, mutual types)
  • monadic programs
  • modules as namespaces
  • modules as polymorphic records (signatures, functors, first-class
    modules)
  • multiple-file projects (thanks to Merlin)
  • both `.ml' and `.mli' files
  • existential types (we use impredicative sets option in Coq)

  We also have some support for the GADTs, the polymorphic variants, and
  the extensible types.  We are in particular working on having an
  axiom-free translation of the GADTs to Coq. We do not support:
  • side-effects outside of a monad (references, exceptions, …);
  • object-oriented programming;
  • various combinations of OCaml features for which `coq-of-ocaml'
    should generate a warning.

  Our main example and use case is the [coq-tezos-of-ocaml]
  project. This contains a translation of most of the [economic
  protocol] of the [Tezos] blockchain (around 30.000 lines of OCaml
  translated to 40.000 lines of Coq). For example, we verify the
  comparison functions defined in
  [src/proto_alpha/lib_protocol/script_comparable.ml] with
  [src/Proto_alpha/Proofs/Script_comparable.v].

  We are looking for the application to other projects too.

  We think the best way to use `coq-of-ocaml' is to continue developing
  in OCaml and run `coq-of-ocaml' to keep a synchronized translation in
  Coq. Having a working Coq translation (as compiling in Coq) forces us
  to avoid some OCaml constructs. We believe these constructs would
  probably be hard to verify anyway. Then, on the Coq side, we can
  verify some important or easy to catch properties. If there is a
  regression in the OCaml code, re-running `coq-of-ocaml' should make
  the proofs break.


[coq-of-ocaml] <https://clarus.github.io/coq-of-ocaml/>

[Coq] <https://coq.inria.fr/>

[coq-tezos-of-ocaml]
<https://nomadic-labs.gitlab.io/coq-tezos-of-ocaml/>

[economic protocol]
<https://gitlab.com/tezos/tezos/-/tree/master/src/proto_alpha/lib_protocol>

[Tezos] <https://tezos.com/>

[src/proto_alpha/lib_protocol/script_comparable.ml]
<https://gitlab.com/tezos/tezos/-/blob/master/src/proto_alpha/lib_protocol/script_comparable.ml>

[src/Proto_alpha/Proofs/Script_comparable.v]
<https://nomadic-labs.gitlab.io/coq-tezos-of-ocaml/docs/proofs/script_comparable>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-08-10 16:47 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-08-10 16:47 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of August 03 to 10,
2021.

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

Lwt 5.4.2
OCaml Workshop 2021: Call for Volunteers
opam 2.1.0!
containers 3.5
Short contract job for OCaml/C++ programmer
http-multipart-formdata v3.0.1 released
wtr (Well Typed Router) v2.0.0 released
New playlist just dropped
Other OCaml News
Old CWN


Lwt 5.4.2
═════════

  Archive: <https://discuss.ocaml.org/t/ann-lwt-5-4-2/8248/1>


Raphaël Proust announced
────────────────────────

  We are glad to announce the release of version 5.4.2 of Lwt: a
  bugfix-only release.

  <https://github.com/ocsigen/lwt/releases/tag/5.4.2>

  You can update to this version in `opam' :

  ┌────
  │ opam update
  │ opam upgrade lwt
  └────

  Thanks to the contributors for finding and fixing the bugs, leading to
  this release. Check out the release notes (link above) for a full
  list.


OCaml Workshop 2021: Call for Volunteers
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-workshop-2021-call-for-volunteers/8253/1>


Frédéric Bour announced
───────────────────────

  The OCaml Workshop will be held virtually, just like last year. We are
  looking for volunteers to fill the role of session host.


[Session Hosts]
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  On August 27, the session hosts will assist session chairs in
  streaming the pre-recorded videos as well as helping and moderating
  the Q&A sessions. They will also be responsible for security and be
  ready to react to potential threats and wrongdoers.

  This year there will be only one broadcast for each session, but the
  workshop day will be quite long. There will be six sessions, lasting
  one hour and a half, as well as a one hour keynote.


[Session Hosts]
<https://icfp20.sigplan.org/home/ocaml-2020#session-hosts>

[Duties]
┄┄┄┄┄┄┄┄

  • Moderating the text chats
  • Controlling microphones in the video-conferencing
  • Watching for the time
  • Performing sound checks
  • Welcoming and otherwise guiding participants


[Duties] <https://icfp20.sigplan.org/home/ocaml-2020#duties>


opam 2.1.0!
═══════════

  Archive: <https://discuss.ocaml.org/t/ann-opam-2-1-0/8255/1>


R. Boujbel announced
────────────────────

  We are happy to announce two opam releases: the freshly new [2.1.0] &
  the LTS support [2.0.9].


[2.1.0] <https://github.com/ocaml/opam/releases/tag/2.1.0>

[2.0.9] <https://github.com/ocaml/opam/releases/tag/2.0.9>

What's new in opam 2.1.0?
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Integration of system dependencies (formerly the `opam-depext`
    plugin), increasing their reliability as it integrates the solving
    step
  • Creation of lock files for reproducible installations (formerly the
    `opam-lock` plugin)
  • Switch invariants, replacing the _"base packages"_ in opam 2.0 and
    allowing for easier compiler upgrades
  • Improved options configuration (see the new `option` and expanded
    `var` sub-commands)
  • CLI versioning, allowing cleaner deprecations for opam now and also
    improvements to semantics in future without breaking
    backwards-compatibility
  • opam root readability by newer and older versions, even if the
    format changed
  • Performance improvements to opam-update, conflict messages, and many
    other areas

  You'll find these features presentation in the [blog post] ; and for a
  full complete you can take a look [pre-releases changelogs].


[blog post] <https://opam.ocaml.org/blog/opam-2-1-0>

[pre-releases changelogs] <https://github.com/ocaml/opam/releases>


What's in 2.0.9
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  This 2.0.9 version contains back-ported fixes, you can find more
  information in this [blog post], especially for fish users & sandbox
  updates.

  *Tremendous thanks to all involved people, all those who've tested,
   re-tested, tested again, given feedback, commented on issues, tested,
   tested, tested again…!*

  /The opam team/ 🐪


[blog post] <https://opam.ocaml.org/blog/opam-2-0-9>


containers 3.5
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-containers-3-5/8257/1>


Simon Cruanes announced
───────────────────────

  I'm glad to announce that version 3.5 of [containers] has just been
  released. There's a bugfix for bitvectors, and a tasteful assortment
  of new functions (see changelog). I want to thank all the
  contributors, among whom first time contributor @favonia.

  The release and changelog can be found [here]


[containers] <https://github.com/c-cube/ocaml-containers>

[here] <https://github.com/c-cube/ocaml-containers/releases/tag/v3.5>


Short contract job for OCaml/C++ programmer
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/short-contract-job-for-ocaml-c-programmer/8260/1>


Ashish Agarwal announced
────────────────────────

  We have a small project (possibly only days of work) for an
  experienced OCaml and C++ programmer. If you are available for a short
  engagement as a contractor, please DM me. Thank you.


http-multipart-formdata v3.0.1 released
═══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-http-multipart-formdata-v3-0-1-released/8261/1>


Bikal Lem announced
───────────────────

  I am pleased to announce v3.0.1 of `http-multipart-formdata'. This
  release follows a major overhaul of the parser as well as the design
  of the library. Here is the summary of changes:

  1. Flatten module `Part_header' to `part_header'
  2. Implement reader/pull based parser to retrieve multipart parts,
     i.e. implement a `streaming' design. This is very useful if the
     HTTP file upload is large.
  3. Implement push-based incremental input model, i.e. the library is
     now a non-blocking multipart parser
  4. Remove dependency on IO based libs such as `lwt, async' since it is
     no longer needed due to point 3 above.

  Github repo: [http-multipart-formdata]

  API doc : [API manual]


[http-multipart-formdata]
<https://github.com/lemaetech/http-multipart-formdata>

[API manual]
<https://lemaetech.co.uk/http-multipart-formdata/http-multipart-formdata/Http_multipart_formdata/index.html>


wtr (Well Typed Router) v2.0.0 released
═══════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-wtr-well-typed-router-v2-0-0-released/8262/1>


Bikal Lem announced
───────────────────

  I am pleased to announce v2.0.0 release of `wtr (Well Typed
  Router)'. `wtr' is a trie-based router for OCaml HTTP web
  applications.

  v2.0.0 release adds support for specifying and matching HTTP methods
  in a router. So now we can do the following;
  ┌────
  │ Wtr.(
  │     create
  │       [ {%wtr| get,post,head,delete  ; /home/about/  |} about_page
  │       ; {%wtr| head                  ; /home/:int/   |} prod_page
  │       ]
  └────
  Note: we can specify single or multiple HTTP methods supported by a
  route.

  The release also features a pretty-printer - `Wtr.pp' - for a `Wtr.t'
  type. This has proven to be very useful when diagnosing/understanding
  routing issues. Sample output below,
  ┌────
  │ POST
  │   /home
  │     /about
  │       /
  │     /:float
  │       /
  │ HEAD
  │   /home
  │     /about
  │       /
  │     /:int
  │       /
  └────

  The manual has also been improved in this release.

  • [wtr API]
  • [CoHTTP demo]
  • [CLI demo]
  • [Changes v2.0.0]


[wtr API] <https://lemaetech.co.uk/wtr/wtr/Wtr/index.html>

[CoHTTP demo]
<https://github.com/lemaetech/wtr/blob/main/examples/cohttp.ml>

[CLI demo] <https://github.com/lemaetech/wtr/blob/main/examples/demo.ml>

[Changes v2.0.0]
<https://github.com/lemaetech/wtr/blob/main/CHANGES.md#v200-2021-08-02>


New playlist just dropped
═════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/new-playlist-just-dropped/8272/1>


Rahul announced
───────────────

  Haven't watched them all yet, but these look like they'd be a great
  resource for anyone wanting to learn OCaml:
  <https://www.youtube.com/watch?v=MUcka_SvhLw&list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU>


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [opam 2.1.0 is released!]
  • [opam 2.0.9 release]


[OCaml Planet] <http://ocaml.org/community/planet/>

[opam 2.1.0 is released!]
<https://www.ocamlpro.com/2021/08/05/opam-2-1-0-is-released/>

[opam 2.0.9 release]
<https://www.ocamlpro.com/2021/08/05/opam-2-0-9-release/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-07-27  8:54 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-07-27  8:54 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of July 20 to 27,
2021.

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

pyre-ast: full-fidelity Python parser in OCaml
OCaml+Opam Images for Docker for Windows
Borns a stream talking about OCaml/Reason & ReScript language
An Update on the State of the PPX Ecosystem and `ppxlib''s Transition
How to send email from Dream
Old CWN


pyre-ast: full-fidelity Python parser in OCaml
══════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-pyre-ast-full-fidelity-python-parser-in-ocaml/8177/1>


Jia Chen announced
──────────────────

  I am happy to announce the initial opam release of [`pyre-ast'], a
  Python parsing library.

  The library features its full-fidelity to the official Python
  spec. Apart from a few technical edge cases, as long as a given file
  can be parsed/rejected by the CPython interpreter, `pyre-ast' will be
  able to parse/reject it as well. Furthermore, abstract syntax trees
  obtained from `pyre-ast' is guaranteed to 100% match the results
  obtained by Python's own `ast.parse' API, down to every AST node and
  every line/column number.

  Another notable feature of this library is that it represents the
  Python syntax using the *tagless-final style*. This style typically
  offers more flexibility and extensibility for the downstream consumers
  of the syntax, and allow them to build up their analysis without
  explicitly constructing a syntax tree. That said, for developers who
  are less familiar with the tagless-final approach, we also offer
  alternative interfaces that operates on traditional syntax tree
  represented as algebraic data types.

  Documentation of the library can be found [here].

  The reason why we can can claim full-conformance with CPython is
  really simple: the library is, under the hood, merely an OCaml wrapper
  around the parsing logic in CPython source code.  The project was
  initially motivated to replace the custom `menhir'-based parser
  currently used in the Pyre type checker (hence the name), but I
  figured that it would be useful to release this as a standalone `opam'
  package to the community so other static Python analyzers or other
  DSLs with Python-based syntax can leverage it as well.

  The library has yet to be put into production for Pyre (I'm working on
  it though) so please do expect bugs/jankiness at times. Feedback and
  bug reports are very welcomed.

  Happy parsing!


[`pyre-ast'] <https://github.com/grievejia/pyre-ast>

[here] <https://grievejia.github.io/pyre-ast/doc/pyre-ast/>


OCaml+Opam Images for Docker for Windows
════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-opam-images-for-docker-for-windows/8179/1>


Antonin Décimo announced
────────────────────────

  I'm glad to announce the availability of OCaml and opam [native
  Windows Container][windows-containers] images for Docker for
  Windows. This is the result of my hard work at Tarides, with precious
  help from @dra27, @talex5, @avsm, and the rest of the team.

  They can be found under the [ocaml/opam][hub] repository in the Docker
  Hub. Try them with [Docker for Windows][docker-for-windows]! Be sure
  to [switch Docker to Native Windows Containers][enable-native].

  ┌────
  │ docker run -it ocaml/opam:windows-mingw
  │ docker run -it ocaml/opam:windows-msvc
  └────

  We provide images for the mingw-w64 (from OCaml 4.02 to 4.12) and the
  MSVC (from OCaml 4.06 to 4.12) ports. They are based on each release
  of Windows 10 amd64 currently supported by [Microsoft on the Docker
  Hub][mcr]. The images use opam 2.0, and we plan to update to opam 2.1
  when it's released. The images also ship a [Cygwin][cygwin]
  installation, [Git for Windows][git-for-windows], and the [winget
  package manager][winget].

  We use @fdopen's [OCaml for Windows][ocaml-for-windows] distribution
  and opam-repository fork. As it is getting deprecated at the end of
  August 2021, we'll transition to opam 2.1 and the standard
  opam-repository when that happens.

  In order to get the correct environment for any `RUN' command
  involving OCaml or opam, prefix the command with

  • `ocaml-env exec --64 --' if based on mingw-w64; or
  • `ocaml-env exec --64 --ms=vs2019 --' if based on MSVC.

  The images are built at <https://base-images.ocamllabs.io/>, using an
  [OCurrent][ocurrent] pipeline that [builds Docker
  images][docker-base-images]. You can rebuild them yourself using the
  [OCluster][ocluster] set of tools that I have ported to Windows.

  We provide a comprehensive set of tags (replace _port_ with either
  _mingw_ or _msvc_):
  • `windows-port': the latest version of OCaml for each Windows
    version;
  • `windows-port-winver': the latest version of OCaml for Windows 10
    _winver_;
  • `windows-port-ocaml-mlver': OCaml version _mlver_ for each Windows
    version;
  • `windows-port-winver-ocaml-mlver': OCaml version _mlver_ for Window
    10 _winver_.

  When the Windows version is not specified in the tag, the image is a
  multiarch image that will work on every supported version of Windows
  10. Docker automatically selects the appropriate one based on the host
  version.

  We will be using these images in the upcoming `ocaml-ci' and
  `opam-repo-ci' for Windows.

  Further work on these include the transition to opam 2.1, and we'll
  provide the Cygwin port of OCaml when it's fixed upstream and
  available in the Cygwin package repository.

  Happy hacking!


Borns a stream talking about OCaml/Reason & ReScript language
═════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-borns-a-stream-talking-about-ocaml-reason-rescript-language/8185/1>


David Sancho announced
──────────────────────

  I'm very excited to announce starting a new show in Twitch to bring
  OCaml, Reason and ReScript community best brains to casually
  talk. It's called emelleTV

  It's made by [@fakenickels] and myself [@davesnx], and we will try to
  do our best!

  Our first guest is [@___zth___]

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/e/e9f08607687aeb843968a430e4e9082541cf87c2_2_1380x690.jpeg>

  We go live on [http://twitch.tv/emelletv] next Wednesday.  Subscribe
  to not miss it!

  Thanks for reading, hope to see you there!


[@fakenickels] <https://twitter.com/fakenickels>

[@davesnx] <https://twitter.com/davesnx>

[@___zth___] <https://twitter.com/___zth___>

[http://twitch.tv/emelletv] <http://twitch.tv/emelletv>


An Update on the State of the PPX Ecosystem and `ppxlib''s Transition
═════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/an-update-on-the-state-of-the-ppx-ecosystem-and-ppxlib-s-transition/8200/1>


Sonja Heinze announced
──────────────────────

  I hope you're all having a nice summer (or a nice whichever season
  you're in, of course)!  We've set up a new [wiki page on the ppxlib
  repository] containing a status overview of the current `ppxlib'
  transition, which aims at keeping the PPX ecosystem always
  up-to-date. We'll keep that wiki page up-to-date, as well.

  @jeremiedimino and @NathanReb have already explained our three-part
  plan for this transition in different posts here on discuss. Nothing
  has changed in that plan, but it has been a while since we [last
  posted about the overall transition] and even longer since we [last
  posted about the `Astlib' transition in detail]. So if you want, you
  can refresh your memory about that transition and get updated about
  its current state (in more detail than the new wiki page) by reading
  this post.


[wiki page on the ppxlib repository]
<https://github.com/ocaml-ppx/ppxlib/wiki/The-State-of-the-PPX-Transition>

[last posted about the overall transition]
<https://discuss.ocaml.org/t/ppxlib-0-22-an-update-on-the-state-of-ppx/7296>

[last posted about the `Astlib' transition in detail]
<https://discuss.ocaml.org/t/ppx-omp-2-0-0-and-next-steps/6231>

Which Issues `ppxlib' was Facing
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  With `ocaml-migrate-parsetree' (`OMP'), the PPX ecosystem became
  cross-compiler-compatible.  With `ppxlib', the latest compiler
  features were supported more easily and broadly within the PPX
  ecosystem, while `ppxlib' also brought along other improvements such
  as the one in performance and the clear composition semantics when
  using several PPXs. With that, both `OMP' and `ppxlib' have taken away
  several maintenance burdens from the PPX maintainers and have created
  a more homogeneous and up-to-date PPX ecosystem. However, we were
  facing the following issues:
  1. To keep the PPX ecosystem cross-compiler compatible
     1. `ppxlib' was handling parts of the unstable `compiler-libs' API
        to abstracting them away;
     2. the `OMP~/~ppxlib' maintainers needed to keep the AST migration
        information up-to-date by coordination with the compiler devs.
  2. To guarantee new feature support, `ppxlib' needed to bump the
     `ppxlib' AST to the newest version.
  3. Bumping the AST implies a breaking change. That was an issue for a
     homogeneous and up-to-date PPX ecosystem.
  4. Not all PPXs migrated from `OMP' to `ppxlib'. That was also an
     issue for a homogeneous and up-to-date PPX ecosystem.

  Some time ago, there was the very ambitious plan of tackling Issues 1,
  2, and 3 all at once by writing a stable AST abstraction and
  upstreaming it to the compiler. That plan has been put on ice for
  now. Instead we're currently on track with a more down-to-earth plan,
  outlined below.


Tackling the Issues in Three Parts
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The plan we're currently following contains three simultaneous
  parts. It approaches three of the four issues I've pointed out
  above. However, it leaves the need to bump the AST (Issue 2)
  untouched.


Part One: `Astlib' as an Interface between `ppxlib' and the Compiler
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  The first part works towards continuous cross-compiler compatibility
  (Issue 1 above) while making the situation of still having PPXs based
  on `OMP' (Issue 4 above) even more of a problem. It consists of
  implementing an interface module called `Astlib' between `ppxlib' and
  the compiler, then upstreaming it to the compiler. As long as `Astlib'
  is stable and up-to-date, the rest of `ppxlib' won't be affected by
  any compiler changes—neither by new AST versions nor by compiler
  library changes.

  The first step of this part of the plan was moving the `OMP' driver
  and other `OMP' features from `OMP' to `ppxlib'. That was done in
  August 2020, and it introduced `OMP2'. Since the PPX driver has to be
  unique, this was the start of having the PPX ecosystem split into the
  two incompatible worlds of `OMP1' PPXs on one hand and `ppxlib' PPXs
  on the other hand.

  By now, we have written [`Astlib' as an internal `ppxlib' library] and
  have reduced `ppxlib''s compiler library usage as much as possible to
  keep `Astlib' minimal. As you can see, it contains a minimal compiler
  library sub-API in addition to the former `OMP' modules of our
  supported ASTs and the migration information between them. We will
  upstream `Astlib' to the compiler asking for it to be kept stable and
  up-to-date, while also keeping our local copy for old compiler
  support.


[`Astlib' as an internal `ppxlib' library]
<https://github.com/ocaml-ppx/ppxlib/tree/master/astlib>


Part Two: Sending Patch PRs when Bumping the AST
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  So, thanks to Part One of the plan, `ppxlib' will always be compatible
  with the development compiler _OCaml trunk_ and the newest compiler
  version. However, to also support the newest compiler features, we
  need to bump the internal `ppxlib' AST to the newest version. That
  modifies some of the AST nodes and so it breaks any PPX that rewrites
  one of those nodes (Issue 3 above). Usually just a handful of PPXs are
  affected, but we still want them to be up-to-date.

  Our current plan doesn't provide a solution for that problem, but it
  does make handling the problem more efficient and, once again, it
  takes away the burden from the PPX maintainers.  Since the AST bump to
  `4.10', whenever we bump the AST, we send patch PRs to the PPXs we
  break. Not much has changed since February, when @NathanReb last
  [explained our workflow of sending patch PRs] in detail.  To some it
  up: we create a workspace with all `ppxlib' reverse dependencies on
  opam fulfilling a certain standard, which we call the
  _ppx-universe_. We then fix the PPXs that break all at once and open
  the PRs.

  Lately, the _ppx-universe_ has also proven very useful to make
  well-founded decisions regarding our API by having an easy look at our
  reverse dependencies. You can find a [_ppx-universe_ snapshot],
  currently from March, on our repo.

  In our experience, once the _ppx-universe_ is created and "builds up
  to the expected breakages," writing a couple of patches takes very
  little time, so we plan to make the tooling that creates and interacts
  with the workspace more sophisticated.


[explained our workflow of sending patch PRs]
<https://discuss.ocaml.org/t/ppxlib-0-22-an-update-on-the-state-of-ppx/7296>

[_ppx-universe_ snapshot] <https://github.com/ocaml-ppx/ppx_universe>


Part Three: Porting PPXs to Put an End to the "Split-World Situation"
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  As explained above, Part One split the PPXs into the two incompatible
  worlds of `OMP1' PPXs on one hand and `ppxlib' PPXs on the other
  hand. That made the fact that some PPXs were still based on `OMP'
  (Issue 4 above) even more of a problem. For some PPX maintainers, the
  reason to avoid porting their PPXs to `ppxlib' was that `ppxlib'
  depended on `base' and `stdio', so we decided to tackle this situation
  by three means:

  • Dropping the `base' and the `stdio' dependencies, which was done in
    August last year. Now, all dependencies are the very basic `ocaml',
    `dune', `ocaml-compiler-libs', `stdlib-shims', `sexplib0' and
    `ppx_derivers'.
  • Porting and reviewing some of the most important PPXs ourselves. So
    far we've ported `js_of_ocaml', `bisect_ppx', and `tyxml' with the
    help of the respective maintainers, and we've also reviewed several
    ports.
  • Spreading the word about the need to port PPXs and asking for help.

  About a year ago, we made a non-exhaustive [list of PPXs that needed
  to be ported].  Since then, this community has proven to be awesome
  and there has been an amazing porting effort by a lot of people. So by
  now, all packages on that list have been ported with the exception of
  one(*). So hopefully the "split world" situation can soon be
  considered past.  :tada:

  By the way, thanks to all involved in porting PPXs to `ppxlib'! It has
  been a great joint effort so far. :heart: And if anyone still has or
  comes across a project somewhere that needs porting and wants to port
  it, that's awesome!

  You can find the full list of opam packages that are still stuck in
  the `OMP1' world by [filtering for them in opam's health check
  pipeline].  However, notice that that's a generated list, so it also
  contains libraries that intrinsically form part of the `OMP1'
  ecosystem (such as `ppx_tools_versioned'), PPXs that have already been
  ported but haven't relesed their port on opam yet (such as
  `graphql_ppx'), deprecated PPXs that aren't marked as deprecated yet
  (such as `mirage-dns'), and several PPXs that only transitively depend
  on `OMP1'.

  (*) `ppx_import' has a PR for a port to `ppxlib', but it's not quite
  ready to be merged just yet.


[list of PPXs that needed to be ported]
<https://github.com/ocaml-ppx/ppxlib/issues?q=is%3Aissue+label%3Aport-to-ppxlib+>

[filtering for them in opam's health check pipeline]
<http://check.ocamllabs.io:8080/?comp=4.12&available=4.12&show-latest-only=true&sort-by-revdeps=true&maintainers=&logsearch=ocaml-migrate-parsetree%5C.1%5C.8%5C.0&logsearch_comp=4.12>


How to send email from Dream
════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/how-to-send-email-from-dream/8201/1>


Joe Thomas announced
────────────────────

  I’ve written a short [blog post ] about what I learned building simple
  email features for a web server written in the Dream framework. The
  accompanying source code is available here:

  <https://github.com/jsthomas/dream-email-example>

  I’m interested in adding more examples and tutorials to the OCaml
  ecosystem and would be happy to get your feedback, positive or
  negative, on this write-up (here or via email/github/discord).


[blog post ] <https://jsthomas.github.io/ocaml-email.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
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-07-20 12:58 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-07-20 12:58 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of July 13 to 20,
2021.

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

Writing a REST API with Dream
OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
soupault: a static website generator based on HTML rewriting
OCaml 4.13.0, second alpha release
OCamlFormat 0.19.0
OCaml Café: Wed, Aug 4 @ 7pm (U.S. Central)
Old CWN


Writing a REST API with Dream
═════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/writing-a-rest-api-with-dream/8150/1>


Joe Thomas announced
────────────────────

  I've written a short [blog post] about the positive experience I had
  using Dream to build a REST API. The accompanying source code is
  available here:

  <https://github.com/jsthomas/sensors>

  I'm interested in adding more examples and tutorials to the OCaml
  ecosystem and would be happy to get your feedback on this writeup
  (here or via email/github).


[blog post] <https://jsthomas.github.io/ocaml-dream-api.html>


OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and pretty-printing library
══════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-otoml-0-9-0-a-compliant-and-flexible-toml-parsing-manipulation-and-pretty-printing-library/8152/1>


Daniil Baturin announced
────────────────────────

  I don't really like to base a release announcement on bashing another
  project, but this whole project is motivated by my dissatisfaction
  with [To.ml]—the only TOML library for OCaml, so here we go. OTOML is
  a TOML library that you (hopefully) can use without writing long rants
  afterwards. ;)

  In short:

  • [TOML 1.0-compliant] (To.ml is not).
  • Good error reporting.
  • Makes it easy to look up nested values.
  • Bignum and calendar libraries are pluggable via functors.
  • Flexible pretty-printer with indentation.

  OPAM: <https://opam.ocaml.org/packages/otoml/> GitHub:
  <https://github.com/dmbaturin/otoml>

  Now let's get to details.

  TOML is supposed to be human-friendly so that people can use it as a
  configuration file format. For that, both developer and end-user
  experience must be great. To.ml provides neither. I've been using
  To.ml in my projects for a long time, and


[To.ml] <https://opam.ocaml.org/packages/toml/>

[TOML 1.0-compliant] <https://toml.io/en/v1.0.0>

Standard compliance
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  TOML is neither minimal nor obvious really, it's much larger than the
  commonly used subset and the spec is not consistent and not easy to
  read, but To.ml fails at rather well-known things, like dotted keys,
  arrays of tables and heterogeneous arrays.

  OTOML passes all tests in the [test suite], except the tests related
  to bignum support. Those tests fail because the default implementation
  maps integers and floats to the native 31/63-bit OCaml types. More on
  that later.


[test suite] <https://github.com/BurntSushi/toml-test>


Error reporting
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Let's look at error reporting. To.ml's response to any parse error is
  a generic error with just line and column numbers.

  ┌────
  │ utop # Toml.Parser.from_string "foo = [" ;;
  │ - : Toml.Parser.result =
  │ `Error
  │   ("Error in <string> at line 1 at column 7 (position 7)",
  │    {Toml.Parser.source = "<string>"; line = 1; column = 7; position = 7})
  └────

  Menhir offers excellent tools for error reporting, so I took time to
  make descriptive messages for many error conditions (there _are_
  generic "syntax error" messages still, but that's better than nothing
  at all).

  ┌────
  │ utop # Otoml.Parser.from_string_result "foo = [" ;;
  │ - : (Otoml.t, string) result =
  │ Error
  │  "Syntax error on line 1, character 8: Malformed array (missing closing square bracket?)\n"
  │ 
  │ utop # Otoml.Parser.from_string_result "foo = {bar " ;;
  │ - : (Otoml.t, string) result =
  │ Error
  │  "Syntax error on line 1, character 12: Key is followed by end of file or a malformed TOML construct.\n"
  └────


Looking up nested values
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Nested sections are common in configs and should be easy to work
  with. This is how you do it in OTOML:

  ┌────
  │ utop # let t = Otoml.Parser.from_string "[this.is.a.deeply.nested.table]
  │ answer=42";;
  │ val t : Otoml.t =
  │   Otoml.TomlTable
  │    [("this",
  │      Otoml.TomlTable...
  │ 
  │ utop # Otoml.find t Otoml.get_integer ["this"; "is"; "a"; "deeply"; "nested"; "table"; "answer"] ;;
  │ - : int = 42
  └────

  For comparison, this is how it was done in To.ml:

  ┌────
  │ utop # let toml_data = Toml.Parser.(from_string "
  │ [this.is.a.deeply.nested.table]
  │ answer=42" |> unsafe);;
  │ val toml_data : Types.table = <abstr>
  │ 
  │ utop # Toml.Lenses.(get toml_data (
  │   key "this" |-- table
  │   |-- key "is" |-- table
  │   |-- key "a" |-- table
  │   |-- key "deeply" |-- table
  │   |-- key "nested" |-- table
  │   |-- key "table" |-- table
  │   |-- key "answer"|-- int ));;
  │ - : int option = Some 42
  └────


Extra dependencies
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The TOML spec includes first-class RFC3339 dates, for better or
  worse. The irony is that most uses of TOML (and, indeed, most
  configuration files in the world) don't need that, so it's arguably a
  feature bloat—but if we set out to support TOML as it's defined, that
  question is academic.

  The practical implication is that if the standard library of a
  language doesn't include a datetime type, a TOML library has to decide
  how to represent those values. To.ml makes ISO8601 a hard dependency,
  so if you don't use dates, you end up with a useless dependency. And
  if you prefer another library (or need functionality no present in
  ISO8601), you end up with two libraries: one you chose to use, and one
  more forced on you.

  Same goes for the arbitrary precision arithmetic. Most configs won't
  need it, but the standard demands it, so something needs to be done.

  Luckily, in the OCaml land we have functors, so it's easy to make all
  these dependencies pluggable. So I made it a functor that takes three
  modules.

  ┌────
  │ module Make (I : TomlInteger) (F : TomlFloat) (D : TomlDate) :
  │   TomlImplementation with type toml_integer = I.t and type toml_float = F.t and type toml_date = D.t
  └────

  This is how to use Zarith for big integers and keep the rest
  unchanged:

  ┌────
  │ (* No signature ascription:
  │    `module BigInteger : Otoml.Base.TomlInteger` would make the type t abstract,
  │    which is inconvenient.
  │  *)
  │ module BigInteger = struct
  │   type t = Z.t
  │   let of_string = Z.of_string
  │   let to_string = Z.to_string
  │   let of_boolean b = if b then Z.one else Z.zero
  │   let to_boolean n = (n <> Z.zero)
  │ end
  │ 
  │ module MyToml = Otoml.Base.Make (BigInteger) (Otoml.Base.OCamlFloat) (Otoml.Base.StringDate)
  └────


Printing
╌╌╌╌╌╌╌╌

  To.ml's printer can print TOML at you, that's for certain. No
  indentation, nothing to help you navigate nested values.

  ┌────
  │ utop # let toml_data = Toml.Parser.(from_string "[foo.bar]\nbaz=false\n [foo.quux]\n xyzzy = [1,2]" |> unsafe) |>
  │ Toml.Printer.string_of_table |> print_endline;;
  │ [foo.bar]
  │ baz = false
  │ [foo.quux]
  │ xyzzy = [1, 2]
  └────

  We can do better:

  ┌────
  │ utop # let t = Otoml.Parser.from_string "[foo.bar]\nbaz=false\n [foo.quux]\n xyzzy = [1,2]" |>
  │ Otoml.Printer.to_channel ~indent_width:4 ~collapse_tables:false stdout;;
  │ 
  │ [foo]
  │ 
  │ [foo.bar]
  │     baz = false
  │ 
  │ [foo.quux]
  │     xyzzy = [1, 2]
  │ val t : unit = ()
  │ 
  │ utop # let t = Otoml.Parser.from_string "[foo.bar]\nbaz=false\n [foo.quux]\n xyzzy = [1,2]" |>
  │ Otoml.Printer.to_channel ~indent_width:4 ~collapse_tables:false ~indent_subtables:true stdout;;
  │ 
  │ [foo]
  │ 
  │     [foo.bar]
  │ 	baz = false
  │ 
  │     [foo.quux]
  │ 	xyzzy = [1, 2]
  │ val t : unit = ()
  └────


Maintenance practices
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Last but not least, good maintenance practices are also important, not
  just good code. To.ml is at 7.0.0 now. It has a [CHANGES.md] file, but
  I'm still to see the maintainers document what the breaking change is,
  who's affected, and what they should do to make their code compatible.

  For example, in 6.0.0 the breaking change was a rename from
  `TomlLenses' to `Toml.Lenses'. In an earlier release, I remember the
  opposite rename. Given the standard compatibility problems going
  unfixed for years, that's like rearranging furniture when the roof is
  leaking.

  I promise not to do that.


[CHANGES.md]
<https://github.com/ocaml-toml/To.ml/blob/master/CHANGES.md>


Conclusion
╌╌╌╌╌╌╌╌╌╌

  I hope this library will help make TOML a viable configuration file
  format for OCaml programs.

  It's just the first version of course, so there's still room for
  improvement. For example, the lexer is especially ugly: due to TOML
  being highly context-sensitive, it involves massive amounts of lexer
  hacks for context tracking.  Maybe ocamllex is a wrong tool for the
  job abd it should be replaced with something else (since I'm using
  Menhir's incremental API anyway, it's not tied to any lexer API).

  The printer is also less tested than the parser, so there may be
  unhandled edge cases. It also has some cosmetic issues like newlines
  between parent and child tables.

  Any feedback and patches are welcome!


soupault: a static website generator based on HTML rewriting
════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-soupault-a-static-website-generator-based-on-html-rewriting/4126/15>


Daniil Baturin announced
────────────────────────

  [soupault 3.0.0] is now available.

  It now uses the new [OTOML] library for loading the configs, which has
  some positive side effects, e.g. keys in the output of `soupault
  --show-effective-config' (that shows your config plus default values
  you didn't set explicitly) now come in the same order as in your
  config file.

  It also provides TOML and YAML parsing functions to Lua plugins and
  has colored log headers (can be disabled with NO_COLOR environment
  variables).


[soupault 3.0.0] <https://soupault.app/blog/soupault-3.0.0-release/>

[OTOML] <https://opam.ocaml.org/packages/otoml/>


OCaml 4.13.0, second alpha release
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-4-13-0-second-alpha-release/8164/1>


octachron announced
───────────────────

  The release of OCaml 4.13.0 is approaching. We have released a second
  alpha version to help fellow hackers join us early in our bug hunting
  and opam ecosystem fixing fun (see below for the installation
  instructions). You can see the progress on this front at
  <https://github.com/ocaml/opam-repository/issues/18791> .

  Beyond the usual bug fixes (see the full list below), this second
  alpha integrates a new feature for native code: poll points. Those
  poll points currently fixes some issues with signals in non-allocating
  loops in native code. More importantly, they are prerequisite for the
  multicore runtime.

  Another change is the removal of the removal of interbranch
  propagation of type information.  The feature, already postponed from
  4.12, has been removed to focus for now on better error message in the
  `-principal' mode.

  If you find any bugs, please report them here:

  <https://github.com/ocaml/ocaml/issues>

  The first beta release may follow soon since the opam ecosystem is in
  quite good shape; and we are on track for a full release in September.

  Happy hacking, Florian Angeletti for the OCaml team.


Installation instructions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The base compiler can be installed as an opam switch with the
  following commands
  ┌────
  │ opam update
  │ opam switch create 4.13.0~alpha2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────

  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:

  ┌────
  │ opam update
  │ opam switch create <switch_name> --packages=ocaml-variants.4.13.0~alpha2+options,<option_list>
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  where <option_list> is a comma separated list of ocaml-option-*
  packages. For instance, for a flambda and no-flat-float-array switch:
  ┌────
  │ opam switch create 4.13.0~alpha2+flambda+nffa
  │ --packages=ocaml-variants.4.13.0~alpha2+options,ocaml-option-flambda,ocaml-option-no-flat-float-array
  │ --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  All available options can be listed with "opam search ocaml-option".

  If you want to test this version, it is advised to install the alpha
  opam repository

  <https://github.com/kit-ty-kate/opam-alpha-repository>

  with
  ┌────
  │ opam repo add alpha git://github.com/kit-ty-kate/opam-alpha-repository.git
  └────
  This alpha repository contains various fixes in the process of being
  upstreamed.

  The source code for the alpha is also available at these addresses:

  • <https://github.com/ocaml/ocaml/archive/4.13.0-alpha2.tar.gz>
  • <https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.0~alpha2.tar.gz>


Changes since the first alpha release
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

New feature
┄┄┄┄┄┄┄┄┄┄┄

  • [10039]: Safepoints Add poll points to native generated code. These
    are effectively zero-sized allocations and fix some signal and
    remembered set issues. Also multicore prerequisite.  (Sadiq Jaffer,
    Stephen Dolan, Damien Doligez, Xavier Leroy, Anmol Sahoo, Mark
    Shinwell, review by Damien Doligez, Xavier Leroy, and Mark Shinwell)


[10039] <https://github.com/ocaml/ocaml/issues/10039>


New bug fixes
┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [10449]: Fix major GC work accounting (the GC was running too
    fast). (Damien Doligez, report by Stephen Dolan, review by Nicolás
    Ojeda Bär and Sadiq Jaffer)

  • [10454]: Check row_more in nondep_type_rec.  (Leo White, review by
    Thomas Refis)

  • [10468]: Correctly pretty print local type substitution, e.g. type t
    := …, with -dsource (Matt Else, review by Florian Angeletti)

  • [10461], [10498]: `caml_send*' helper functions take derived
    pointers as arguments.  Those must be declared with type Addr
    instead of Val. Moreover, poll point insertion must be disabled for
    `caml_send*', otherwise the derived pointer is live across a poll
    point. (Vincent Laviron and Xavier Leroy, review by Xavier Leroy and
    Sadiq Jaffer)

  • [10478]: Fix segfault under Windows due to a mistaken initialization
    of thread ID when a thread starts. (David Allsopp, Nicolás Ojeda
    Bär, review by Xavier Leroy)

  • [9525], [10402]: ocamldoc only create paragraphq at the toplevel of
    documentation comments (Florian Angeletti, report by Hendrik Tews,
    review by Gabriel Scherer)

  • [10206]: Split labels and polymorphic variants tutorials Splits the
    labels and polymorphic variants tutorial into two. Moves the GADTs
    tutorial from the Language Extensions chapter to the tutorials.
    (John Whitington, review by Florian Angeletti and Xavier Leroy)


[10449] <https://github.com/ocaml/ocaml/issues/10449>

[10454] <https://github.com/ocaml/ocaml/issues/10454>

[10468] <https://github.com/ocaml/ocaml/issues/10468>

[10461] <https://github.com/ocaml/ocaml/issues/10461>

[10498] <https://github.com/ocaml/ocaml/issues/10498>

[10478] <https://github.com/ocaml/ocaml/issues/10478>

[9525] <https://github.com/ocaml/ocaml/issues/9525>

[10402] <https://github.com/ocaml/ocaml/issues/10402>

[10206] <https://github.com/ocaml/ocaml/issues/10206>


Removed feature
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

  • [ *breaking change* ] [9811]: remove propagation from previous
    branches Type information inferred from previous branches was
    propagated in non-principal mode. Revert this for better
    compatibility with -principal mode. For the time being, infringing
    code should result in a principality warning. (Jacques Garrigue,
    review by Thomas Refis and Gabriel Scherer)

  The up-to-date list of changes for OCaml 4.13 is available at
  <https://github.com/ocaml/ocaml/blob/4.13/Changes> .


[9811] <https://github.com/ocaml/ocaml/issues/9811>


OCamlFormat 0.19.0
══════════════════

  Archive: <https://discuss.ocaml.org/t/ann-ocamlformat-0-19-0/8167/1>


Guillaume Petiot announced
──────────────────────────

  We are happy to announce the release of [OCamlFormat 0.19.0].

  OCamlformat is an auto-formatter for OCaml code, writing the parse
  tree and comments in a consistent style, so that you do not have to
  worry about formatting it by hand, and to speed up code review by
  focusing on the important parts.

  OCamlFormat is beta software. We expect the program to change
  considerably before we reach version 1.0.0. In particular, upgrading
  the `ocamlformat` package will cause your program to get
  reformatted. Sometimes it is relatively pain-free, but sometimes it
  will make a diff in almost every file. We are working towards having a
  tool that pleases most usecases in the OCaml community, please bear
  with us!

  To make sure your project uses the last version of ocamlformat, please
  set

  ┌────
  │ version=0.19.0
  └────

  in your `.ocamlformat' file.

  Main changes in `ocamlformat.0.19.0' are:
  • OCaml 4.13 features are supported
  • `ppxlib' dependency has been dropped
  • A new `line-endings={lf,crlf}' option has been added for windows
    compatibility

  Here is the [full list of changes].

  We encourage you to try ocamlformat, that can be installed from opam
  directly ( `opam install ocamlformat' ), but please remember that it
  is still beta software. We have a [FAQ for new users ] that should
  help you decide if ocamlformat is the right choice for you.


[OCamlFormat 0.19.0] <https://github.com/ocaml-ppx/ocamlformat>

[full list of changes]
<https://github.com/ocaml-ppx/ocamlformat/releases/tag/0.19.0>

[FAQ for new users ]
<https://github.com/ocaml-ppx/ocamlformat#faq-for-new-users>


Nicolás Ojeda Bär then added
────────────────────────────

        A new `line-endings={lf,crlf}' option has been added for
        windows compatibility

  Just to expand a bit on this feature: previously, `ocamlformat' would
  use the system EOL convention (ie LF on Unix-like OSs and CRLF on
  Windows). This meant that if you applied `ocamlformat' on systems with
  different EOL conventions, you would get a diff on every line on every
  file purely due to the changed newlines. Furthermore, this meant
  `ocamlformat' was hard to use if your project used LF on Windows (a
  common usage).

  With the new option, `ocamlformat' enforces a given EOL
  convention. The system EOL convention is no longer used for any
  purpose and the EOL convention used is the one specified in
  `ocamlformat''s config (LF by default).


OCaml Café: Wed, Aug 4 @ 7pm (U.S. Central)
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-cafe-wed-aug-4-7pm-u-s-central/8169/1>


Michael Bacarella announced
───────────────────────────

  Please join us at the next OCaml Cafe, a friendly, low stakes
  opportunity to ask questions about the OCaml language and ecosystem,
  work through programming problems that you’re stuck on, and get
  feedback on your code. Especially geared toward new and intermediate
  users, experienced OCaml developers will be available to answer your
  questions.  Bring your code and we’ll be happy to review it, assist
  with debugging, and provide recommendations for improvement.

  This month, OCaml Café will consist of two parts. First, Rudi Grinberg
  of [OCaml Labs] will present an informal introduction to [Dune], the
  OCaml build system. Learn about Dune from one the people developing
  it. Following Rudi’s presentation, we will open the discussion to all
  things OCaml-related.

  Full [Zoom meeting details here].
  • Add to your [Google Calendar]
  • Add to your [iCal]


[OCaml Labs] <https://ocamllabs.io/>

[Dune] <https://dune.build/>

[Zoom meeting details here]
<https://hfpug.org/event/ocaml-cafe-introduction-to-dune-and-open-forum/>

[Google Calendar]
<https://www.google.com/calendar/event?action=TEMPLATE&text=OCaml+Caf%C3%A9%3A+Introduction+to+Dune+and+Open+Forum&dates=20210804T190000/20210804T210000&details=OCaml+Caf%C3%A9+offers+a+friendly%2C+low+stakes+opportunity+to+ask+questions+about+the+OCaml+language+and+ecosystem%2C+work+through+programming+problems+that+you%E2%80%99re+stuck+on%2C+and+get+feedback+on+your+code.+Especially+geared+toward+new+and+intermediate+users%2C+experienced+OCaml+developers+will+be+available+to+answer+your+questions.%C2%A0+Bring+your+code+and+we%26%238217%3Bll+be+happy+to+review+it%2C+assist+with+debugging%2C+and+provide+recommendations+for+improvement.+%0AThis+month%2C+OCaml+Caf%C3%A9+will+consist+of+two+parts.%C2%A0+First%2C+Rudi+Grinberg+of+OCaml+Labs+will+present+an+informal+introduction+to+Dune%2C+the+OCaml+build+system.%C2%A0+Learn+about+Dune+from+one+the+people+developing+it.%C2%A0+Following+Rudi%26%238217%3Bs+presentation%2C+we+will+open+the+discussion+to+all+things+OCaml-related.+%0AWhether+you%E2%80%99re+still+trying+to+make+sense+of+currying+or+can+spot+non-tail-recursive+code+from+across+the+room%2C+we+hope+that+you%E2%80%99ll+join+us+with+your+questions+about+OCaml%2C+or+just+to+hang+out+with+the+OCaml+community.+%0A%0AClaude+Ru+%28View+Full+Event+Description+Here%3A+https%3A%2F%2Fhfpug.org%2Fevent%2Focaml-cafe-introduction-to-dune-and-open-forum%2F%29&location=Zoom&trp=false&sprop=website:https://hfpug.org&ctz=America%2FChicago>

[iCal]
<https://hfpug.org/event/ocaml-cafe-introduction-to-dune-and-open-forum/?ical=1>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-07-06 12:33 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-07-06 12:33 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 29 to July
06, 2021.

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

LibreRef - LablGtk-based Digital Reference Tool Application
u2f - universal second factor
Reproducible OPAM packages / MirageOS
Dune 2.9.0
Hardcaml MIPS CPU Learning Project and Blog
dune-release 1.5.0
anders 0.7.1
Old CWN


LibreRef - LablGtk-based Digital Reference Tool Application
═══════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-libreref-lablgtk-based-digital-reference-tool-application/8077/1>


Kiran Gopinathan announced
──────────────────────────

  I'm not sure if this is that close to the typical uses of OCaml, but
  posting this here just in case anyone was interested in another
  end-user facing application using LablGtk.

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/b/b72b4bd7838e41dbaed2254350799c5e75245a3d_2_250x250.png>

        LibreRef is a free as in freedom digital referencing tool
        for artists.

  It's written in OCaml using LablGtk and Cairo to implement the GUI.

  You can find the source code at: [gitlab] ([github mirror])

  A picture is worth a thousand words, so before I continue, here are a
  few examples of it in action:

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/1/126997c61b83b700feac41e380b42c560bdf2340.gif>

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/4/49b11ef943e491ba220332d257bc6a15b506ed6b.gif>

  Overall, getting LablGtk to work was fairly straightforward, although
  the documentation was a bit lacking (although the same might be said
  of Gtk itself).

  I was able to piece together the correct uses of most of the API calls
  by relying on either the examples from the repository or by
  translating snippets of code from online back into LablGtk.

  As for deploying it as an application, I found the AppImage &
  LinuxDeploy toolchain to work well with the resulting binary
  (admittedly I've only tested it with two devices so far), and it meant
  that I could publish the program without having to ask people to setup
  the full OCaml & Opam toolchain, which would probably be a large ask.

  As for the implementation, I think it was fairly elegant (if I say so
  myself :slight_smile:), although I may have gone overboard with
  functors (see this higher-order functor in the GUI interface:
  <https://gitlab.com/gopiandcode/libre-ref/-/blob/master/gui.mli#L175>)
  and some aspects of the separation of concerns weren't so well
  established.


[gitlab] <https://gitlab.com/gopiandcode/libre-ref>

[github mirror] <https://github.com/Gopiandcode/LibreRef>


u2f - universal second factor
═════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-u2f-universal-second-factor/8078/1>


Hannes Mehnert announced
────────────────────────

  it is our pleasure to announce the just released opam package u2f,
  which is a server side implementation of the FIDO standard for
  two-factor authentication using a special device (yubikey etc.). The
  device does challenge-response authentication with the server using
  public key cryptography.

  The implementation is stateless and does not use a specific IO
  library, but only achieves the logic for constructing a registration
  request, verifying a response thereof, and authorization requests with
  responses thereof. Please have a look at
  <https://github.com/roburio/u2f> if you're interested. It is licensed
  under the permissive 2-clause BSD license.

  We use this library in an example server (in the `bin' directory) that
  uses dream. The live server is online at <https://u2f-demo.robur.coop>
  – please let us know if you run into any trouble, or open an issue on
  the GitHub repository.

  One question though: we're unable to generate the documentation from
  the mli – already asked on discord with no result. Anyone with a
  better understanding of odoc etc. can take a look why `dune build
  @doc' outputs a nearly empty file? Thanks a lot :)

  The development was sponsored by skolem.tech.


Reproducible OPAM packages / MirageOS
═════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/reproducible-opam-packages-mirageos/8079/1>


Hannes Mehnert announced
────────────────────────

  we are pleased to announce reproducible binary images for MirageOS
  unikernels (see the blog post at
  <https://hannes.robur.coop/Posts/Deploy>). The binaries are located at
  <https://builds.robur.coop> (all components are open source and linked
  from the page).

  Additionally, the required tools to achieve reproducible builds are
  released as binary packages for various operating systems as well on
  the same site. They are used by the infrastructure to run daily builds
  (always with the HEAD of opam-repository to not loose any updates /
  new releases). The custom overlay
  <https://git.robur.io/robur/unikernel-repo> is used that adds some
  development packages.

  Happy to hear your thoughts and feedback here. (Earlier post
  <https://discuss.ocaml.org/t/reproducible-builds-with-ocaml-opam-and-mirageos/4877>)

  This work was funded by the [NGI Pointer] project "Funding The Next
  Generation Ecosystem of Internet Architects".


[NGI Pointer] <https://pointer.ngi.eu>


Dune 2.9.0
══════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-2-9-0/8087/1>


Emilio Jesús Gallego Arias announced
────────────────────────────────────

  Dear all, on behalf of the Dune team I'm pleased to announce the
  release of Dune 2.9.0. This is the last release on the Dune 2.x series
  and could be considered a maintenance release as it mostly consists on
  bug fixes and miscellaneous tweaks and features for sites,
  instrumentation, and mdx support.

  Please find the full list of changes below:
  • Add `(enabled_if ...)' to `(mdx ...)'
    (<https://github.com/ocaml/dune/pull/4434>, @emillon)

  • Add support for instrumentation dependencies
    (<https://github.com/ocaml/dune/pull/4210>, fixes
    <https://github.com/ocaml/dune/issues/3983>, @nojb)

  • Add the possibility to use `locks' with the cram tests stanza
    (<https://github.com/ocaml/dune/pull/4480>, @voodoos)

  • Allow to set up merlin in a variant of the default context
    (<https://github.com/ocaml/dune/pull/4145>, @TheLortex, @voodoos)

  • Add `(package ...)' to `(mdx ...)'
    (<https://github.com/ocaml/dune/pull/4691>, fixes
    <https://github.com/ocaml/dune/issues/3756>, @emillon)

  • Handle renaming of `coq.kernel' library to `coq-core.kernel' in Coq
    8.14 (<https://github.com/ocaml/dune/pull/4713>, @proux01)

  • Fix generation of merlin configuration when using `(include_subdirs
    unqualified)' on Windows (<https://github.com/ocaml/dune/pull/4745>,
    @nojb)

  • Fix bug for the install of Coq native files when using
    `(include_subdirs qualified)'
    (<https://github.com/ocaml/dune/pull/4753>, @ejgallego)

  • Allow users to specify install target directories for `doc' and
    `etc' sections. We add new options `--docdir' and `--etcdir' to both
    Dune's configure and `dune install'
    command. (<https://github.com/ocaml/dune/pull/4744>, fixes
    <https://github.com/ocaml/dune/issues/4723>, @ejgallego, thanks to
    @JasonGross for reporting this issue)

  • Fix issue where Dune would ignore `(env ... (coq (flags ...)))'
    declarations appearing in `dune' files
    (<https://github.com/ocaml/dune/pull/4749>, fixes
    <https://github.com/ocaml/dune/issues/4566>, @ejgallego @rgrinberg)

  • Disable some warnings on Coq 8.14 and `(lang coq (>= 0.3))' due to
    the rework of the Coq "native" compilation system
    (<https://github.com/ocaml/dune/pull/4760>, @ejgallego)

  • Fix a bug where instrumentation flags would be added even if the
    instrumentatation was disabled (@nojb,
    <https://github.com/ocaml/dune/pull/4770>)

  • Fix <https://github.com/ocaml/dune/issues/4682>: option `-p' takes
    now precedence on environement variable `DUNE_PROFILE'
    (<https://github.com/ocaml/dune/pull/4730>,
    <https://github.com/ocaml/dune/pull/4774>, @bobot, reported by
    @dra27 <https://github.com/ocaml/dune/issues/4632>)

  • Fix installation with opam of package with dune sites. The
    `.install' file is now produced by a local `dune install' during the
    build phase (<https://github.com/ocaml/dune/pull/4730>,
    <https://github.com/ocaml/dune/pull/4645>, @bobot, reported by
    @kit-ty-kate <https://github.com/ocaml/dune/issues/4198>)

  • Fix multiple issues in the sites feature
    (<https://github.com/ocaml/dune/pull/4730>,
    <https://github.com/ocaml/dune/pull/4645> @bobot, reported by
    @Lelio-Brun <https://github.com/ocaml/dune/issues/4219>, by @Kakadu
    <https://github.com/ocaml/dune/issues/4325>, by @toots
    <https://github.com/ocaml/dune/issues/4415>)


Hardcaml MIPS CPU Learning Project and Blog
═══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/hardcaml-mips-cpu-learning-project-and-blog/8088/1>


"Alexander (Sasha) Skvortsov announced
──────────────────────────────────────

  Tl;dr: I’m [writing a blog] about making a MIPS CPU in Hardcaml.

  Hi! My name is Sasha, and I’m a student at Penn State majoring in CS
  and Math. Last semester, I took a computer engineering class where we
  built a pipelined MIPS CPU in Verilog as a semester-long project. I
  enjoyed the class, but a lot of frustration came from Verilog itself.

  A few months ago, I came across the [Signals and Threads Programmable
  Hardware episode]. I really liked the idea of [Hardcaml]: a library to
  write and test hardware designs in OCaml. Representing circuits as
  functions felt like a good abstraction, and I’ve been wanting to learn
  OCaml for a while.

  So this summer, a friend and I are rewriting the Verilog MIPS CPU we
  made last semester into Hardcaml.  We’re still working on the project,
  but have made some good progress and wanted to share it in case anyone
  finds it interesting / useful. If anyone wants to take a look, it’s
  [up on GitHub].

  We’ve written some blog posts about our project:

  1. [Some more background on what we’re doing and why]
  2. [An ELI5 overview of how hardware, and pipelined CPUs in
     particular, work]
  3. [Another high-level overview of Verilog, hardware design, FPGAs,
     and why I think OCaml might be a great fit for hardware design]
  4. [How to set up a Hardcaml project, including testing and Verilog
     generation]
  5. [How to split Hardcaml circuits into multiple modules]

  There’s also a few more that we’ve written code for, but are still
  drafting blog posts about:

  • How to work with memory in Hardcaml
  • How to design stateful, sequential circuits in Hardcaml
  • A safer design pattern for Hardcaml circuits

  I’m new to both OCaml and blogging, and this has definitely been a fun
  experience so far! Would love to hear any feedback / comments.


[writing a blog] <https://ceramichacker.com/>

[Signals and Threads Programmable Hardware episode]
<https://signalsandthreads.com/programmable-hardware/>

[Hardcaml] <https://github.com/janestreet/hardcaml>

[up on GitHub] <https://github.com/askvortsov1/hardcaml-mips>

[Some more background on what we’re doing and why]
<https://ceramichacker.com/blog/1-1x-hardcaml-mips-intro-what-and-why>

[An ELI5 overview of how hardware, and pipelined CPUs in particular,
work]
<https://ceramichacker.com/blog/2-2x-a-bit-on-computers-hardware-and-cpus>

[Another high-level overview of Verilog, hardware design, FPGAs, and why
I think OCaml might be a great fit for hardware design]
<https://ceramichacker.com/blog/4-3x-verilog-fpgas-and-why-ocaml>

[How to set up a Hardcaml project, including testing and Verilog
generation]
<https://ceramichacker.com/blog/5-4x-ocaml-setup-hardcaml-basics-and-project-plan>

[How to split Hardcaml circuits into multiple modules]
<https://ceramichacker.com/blog/11-5x-multi-module-circuits-in-hardcaml>


dune-release 1.5.0
══════════════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-release-1-5-0/8095/1>


Nathan Rebours announced
────────────────────────

  On behalf of the dune-release team I'm pleased to announce that we're
  releasing dune-release.1.5.0.

  It has been quite a while since the last release so there are numerous
  changes and improvements in this one, along with a lot of bug fixes.

  The two main new features in 1.5.0 are:
  • A draft release mode that creates a draft Github release and a draft
    PR to opam-repository. It comes with an `undraft' command that will
    undraft both and update the opam file's `url.src' field
    accordingly. We believe this feature will prove helpful to
    maintainers of tools such as `dune' which releases are often watched
    by distribution maintainers. Draft releases allow you to wait until
    you have opam-repository's CI approval to actually create a GH
    release that will notify anyone watching the repository. This
    feature is still a bit experimental, we have ideas on how to improve
    it but we wanted to get a first version out to collect feedback on
    how it is used and what you folks expect from it.
  • A `check' command that you can run ahead of a release to know if
    dune-release has all the information it needs in the repository,
    along with running the lint, build and test checks it normally runs
    after building the tarball. We're aware that it can be frustrating
    to see dune-release fail right in the middle of the release
    process. We're trying to improve this situation and this is a first
    step in that direction.

  You can see the full changelog [here]

  You'll note we also deprecated a few features such as delegates (as we
  announced in [this post]), opam 1.x and the `--user' option and
  corresponding config file field.  This release is likely to be the
  last 1.x release of `dune-release' except for important bug fixes as
  we'll start working on 2.0 soon.

  Our main goals for 2.0 are to make the experience for github users as
  seemless as possible. We want the tool to do the right thing for those
  users without them having to configure anything. Delegates got in the
  way there and that's why we're removing them.  We do care about our
  non github users and we've worked on making it as configurable as
  possible so that you can integrate it in your release workflow. The
  situation should already have improved quite a bit with this release
  as we fixed several bugs for non github hosted repositories. We want
  to make sure that these users will be happy with dune-release 2.0 as
  well.  Hopefully in the future dune-release will support other release
  workflows such as handling gitlab hosted repositories but we want to
  make sure our main user base is happy with the tool before adding
  this.

  We'll communicate a bit more on our plans for 2.0 in the next few
  months. Our hope is that it will hit opam before the end of this year.

  We hope that you'll like this new version and wish you all successful
  and happy releases!


[here] <https://github.com/ocamllabs/dune-release/releases/tag/1.5.0>

[this post]
<https://discuss.ocaml.org/t/replacing-dune-release-delegates/4767>


anders 0.7.1
════════════

  Archive: <https://discuss.ocaml.org/t/ann-anders-0-7-1/8098/1>


Namdak Tonpa announced
──────────────────────

  The HTS language proposed by Voevodsky exposes two different presheaf
  models of type theory: the inner one is homotopy type system presheaf
  that models HoTT and the outer one is traditional Martin-Löf type
  system presheaf that models set theory with UIP. The motivation behind
  this doubling is to have an ability to express semisemplicial
  types. Theoretical work on merging meta-theoretical and homotopical
  languages was continued in [2LTT] [Anenkov, Capriotti, Kraus,
  Sattler].

  While we are on our road to HTS with Lean-like tactic language,
  currently we are at the stage of regular cubical (HoTT) type checker
  with CHM-style primitives, or more general CCHM type checker. You may
  try it at Github: [groupoid/anders].

  ┌────
  │ $ opam install anders
  │ $ anders
  │ Anders theorem prover [PTS][MLTT][CCHM-4][HTS].
  │ 
  │    invoke = anders | anders list
  │      list = [] | command list
  │   command = check filename     | lex filename
  │           | parse filename     | help
  │           | cubicaltt filename | girard
  │           | trace
  └────

  Anders is idiomatic and educational. We carefully draw the favourite
  Lean-compatible syntax to fit 130 LOC in Menhir, the MLTT core (based
  on Mini-TT) is 500 LOC and pretypes presheaf is another 500 LOC.


[2LTT] <https://arxiv.org/pdf/1705.03307.pdf>

[groupoid/anders] <https://github.com/groupoid/anders>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-06-29 12:24 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-06-29 12:24 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 22 to 29,
2021.

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

wasicaml - a code emitter for OCaml targeting WebAssembly
opam 2.1.0~rc2
Set up OCaml 2.0.0-beta2
Any OCaml bindings to Apache Arrow?
Compiler engineer for OCaml and WebAssembly, Germany
v3.0.0 release of reparse, reparse-lwt, reparse-lwt-unix
Progress 0.2.0
http-multipart-formdata v2.0.0
Old CWN


wasicaml - a code emitter for OCaml targeting WebAssembly
═════════════════════════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-06/msg00017.html>


Gerd Stolpmann announced
────────────────────────

  I'd like to announce a new project to develop a code generator that
  emits WebAssembly:

  <https://github.com/remixlabs/wasicaml>

  With the support of RemixLabs I could already create a very first
  version that takes the OCaml bytecode as input and translates it to
  WebAssembly.  While this approach probably doesn't lead to the fastest
  code, it is easy to accomplish, and it demonstrates the challenge (and
  already shows how to solve many of the part problems along the road).

  To be precisely, the target of the translator is wasm32-unknown-wasi,
  i.e.  the WASI ABI. This ABI is still in early development, but
  provides already the syscalls (or better, host calls) to access files,
  to get the current time, and to read the environment. This is almost
  enough to run a compiler - I only had to add system() so that ocamlc
  can start external preprocessors.  Also, due to the fact that the
  current wasm implementations still lack exception handling, I had to
  assume the presence of a host emulation of exceptions (which is easy
  to provide if the host environment is Javascript, but not necessarily
  for other environments).

  The translator takes the OCaml bytecode as input, i.e. you first
  create an excecutable

  ┌────
  │ $ ocamlc -o myexec ...
  └────

  and then make wasm out of it:

  ┌────
  │ $ wasicaml -o myexec.wasm myexec
  └────

  If you omit the .wasm suffix, wasicaml will put a preamble in front of
  the wasm code that starts the execution:

  ┌────
  │ $ wasicaml -o myexec_wasm myexec
  │ $ ./myexec_wasm
  └────

  Because of this trick, many problems of cross-compiling can be
  avoided.

  You may ask what the benefits of yet another "Web" language are. We
  already have two emitters targeting Javascript - isn't that enough?
  Well, two answers here.

  First, WASI is a proper LLVM target. Because of this, you can link
  code from other languages with your executable (e.g. C or Rust). So
  you are not limited to OCaml but can use any language that also
  targets the WASI ABI. E.g. you can do

  ┌────
  │ $ wasicaml -o myexec.wasm myexec -ccopt -lfoo
  └────

  to also link in libfoo.a (which must also be compiled to wasm). So it
  is multi-lingual from the beginning.

  Second, WebAssembly can be used outside the web, too. WASI targets
  more the command-line, and server plugins, and generally any
  OS-independent environments. For example, imagine you have an Electron
  app with a great UI, but for some special functionality you need to
  include some OCaml code, too. You don't want to give up the
  OS-independence, and WASI gives you now a natural option to add the
  OCaml code. And you still have access to the filesystem without
  hassle. - Another example is edge computing, i.e. when the cloud is
  extended by computers outside the data center, and the code should be
  in a form so that it can be run on as many platforms as possible. -
  All in all, WASI plays well when you need to combine OS-independence
  with a classic way of organizing the code as command or as server
  function, and you also need predictable performance.

  The challenge of translating OCaml to wasm is mainly the garbage
  collector.  Wasm doesn't permit many of the tricks ocamlopt is using
  to know in which memory (or register) locations OCaml values are
  stored. In wasm, there are no registers but the closest vehicle are
  local variables. Now, it is not possible to scan these variables from
  the GC function, making it practically impossible to put OCaml values
  there while a function is called that might trigger a GC. There is
  also no really cheap way of obtaining a stack descriptor.

  Wasicaml inherits the stack from the bytecode interpreter and uses it
  as its own shadow stack for OCaml values. As wasicaml bases on the
  bytecode representation of the code, the bytecode instructions already
  ensure that values always live in this stack when the GC might
  run. Wasicaml additionally tries to identify values that don't need
  this special treatment (like ints and bools) and that are preferably
  stored in local variables, giving the wasm executor freedom to put
  these into registers or other high-speed locations. (Unfortunately,
  most of the type information is already erased in the bytecode, and
  this is definitely one of the deficiencies of the bytecode approach.)

  In order to maximize the performance, it is probably best to avoid the
  stack whenever possible. The current approach of transforming the
  bytecode hasn't brought to an end yet with respect to such
  optimizations. For example, there could be more analyses that figure
  out when GC runs are actually possible and when it is safe to use
  local variables.

  Another problem of the bytecode basis is that all function calls are
  indirect, preventing the wasm executor from inlining functions.

  As a project, I'd like to see wasicaml progressing in two directions.
  First, make the current approach as good as possible - although basing
  it on the bytecode representation has its downsides, it is easy to
  understand and it is possible to figure out what the necessary
  ingredients for fast code are. Second, get an idea where a possible
  real wasm backend would fit into the OCaml compiler (maybe it is c–
  but maybe this doesn't give us much and you start better with lambda).

  Anyway, welcome to the new world of WebAssembly!

  Gerd

  PS. If you are interested in WebAssembly and like to work with me on
  another Wasm port for some time, there is a position:
  <https://www.mixtional.de/recruiting/2021-01/index.html>

  PPS. Wasicaml is a project of Figly, Inc., commonly known as
  RemixLabs, developing a reactive low-code and code collaboration
  platform.  <https://remixlabs.com/>


opam 2.1.0~rc2
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-opam-2-1-0-rc2/8042/1>


David Allsopp announced
───────────────────────

  The opam team has great pleasure in announcing opam 2.1.0~rc2!

  The focus since beta4 has been preparing for a world with more than
  one released version of opam (i.e.  2.0.x and 2.1.x). The release
  candidate extends CLI versioning further and, under the hood, includes
  a big change to the opam root format which allows new versions of opam
  to indicate that the root may still be read by older versions of the
  opam libraries. A plugin compiled against the 2.0.9 opam libraries
  will therefore be able to read information about an opam 2.1 root
  (plugins and tools compiled against 2.0.8 are unable to load opam
  2.1.0 roots).

  Please do take this release candidate for a spin! It is available in
  the Docker images at ocaml/opam on [Docker Hub] as the opam-2.1
  command (or you can `sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam' in
  your `Dockerfile' to switch to it permanently). The release candidate
  can also be tested via our installation script (see the [wiki] for
  more information).

  Thank you to anyone who noticed the unannounced first release
  candidate and tried it out. Between tagging and what would have been
  announcing it, we discovered an issue with upgrading local switches
  from earlier alpha/beta releases, and so fixed that for this second
  release candidate.

  Assuming no showstoppers, we plan to release opam 2.1.0 next week. The
  improvements made in 2.1.0 will allow for a much faster release cycle,
  and we look forward to posting about the 2.2.0 plans soon!


[Docker Hub] <https://hub.docker.com/r/ocaml/opam/tags>

[wiki]
<https://github.com/ocaml/opam/wiki/How-to-test-an-opam-feature#from-a-tagged-release-including-pre-releases>


Set up OCaml 2.0.0-beta2
════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta2/8046/1>


Sora Morimoto announced
───────────────────────

  This release includes changes to address a corner case primarily
  related to multicore OCaml.

  <https://github.com/ocaml/setup-ocaml/releases/tag/v2.0.0-beta2>


Any OCaml bindings to Apache Arrow?
═══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/any-ocaml-bindings-to-apache-arrow/8047/2>


UnixJunkie asked and Laurent Mazare announced
─────────────────────────────────────────────

        Looks interesting:

        <https://arrow.apache.org/>

        <https://arrow.apache.org/overview/>

  I've put together some simple [ocaml-arrow] library. It works
  reasonably well and is quite battle tested but definitely needs a bit
  of cleanup as the bits under src/ are deprecated in favor of the ones
  under c_api/. There is also a ppx to automatically convert ocaml
  records to/from arrow. Some examples using this can be seen in the
  [tests directory].

  If there is some interest, I can certainly push up on cleaning this
  and make an actual opam package.


[ocaml-arrow] <https://github.com/LaurentMazare/ocaml-arrow>

[tests directory]
<https://github.com/LaurentMazare/ocaml-arrow/blob/master/c_api/tests/ppx.ml>


Compiler engineer for OCaml and WebAssembly, Germany
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/compiler-engineer-for-ocaml-and-webassembly-germany/8053/1>


Gerd Stolpmann announced
────────────────────────

  We are developing a compiler for a no-code platform that translates
  our DSL to bytecode and/or WebAssembly. The language is largely of
  functional type but is also able to manage state with a spreadsheet
  model, allowing reactive programming without having to resort to
  libraries. The language is statically typed using a Hindley-Milner
  type checker. The compiler is primarily written in OCaml. Other
  languages of our platform are Go, C, Elm, and Javascript.

  We are looking for a compiler engineer with skills in code generation
  for WebAssembly:

  • Translation of an intermediate representation to WebAssembly
  • Writing runtimes and SDKs targeting WebAssembly
  • Code optimization

  See the full ad here:
  <https://www.mixtional.de/recruiting/2021-01/index.html>


v3.0.0 release of reparse, reparse-lwt, reparse-lwt-unix
════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-v3-0-0-release-of-reparse-reparse-lwt-reparse-lwt-unix/8058/1>


Bikal Lem announced
───────────────────

  I am happy to announce v3.0.0 of `reparse' - an OCaml library for
  constructing various types of parsers in OCaml.

  The release follows a complete overhaul of the internal working of the
  library to achieve the following goals:

  1. Allow construction of efficient, zero-copy parsers. See [String
     parser for example]. The library provides a [Make functor]
     parametrised over a `Promise' and a `Input' type allowing you
     control over both parser memory allocation and copying.

  2. Support usage of async libraries - lwt and async. Following the
     first point the library can now be used together with `lwt' and/or
     `async'. A lwt parse - for example - can now be used seamlessly
     with your other lwt code. The integration is seamless.

  3. Provide `Make_buffered' functor to produce parsers where the input
     type natively doesn't allow random read, for example sockets, lwt
     streams and channels. There is now two new supporting packages
     `reparse-lwt' which provides parsing from `char Lwt_stream.t'
     input type and `reparse-lwt-unix' which provides parsing from
     `Lwt_unix.file_descr' and ~Lwt_unix.input_channel' respectively.

  4. Provide `Make_unbuffered' functor to produce parsers where the
     input type natively supports random read, for example strings,
     bigstrings, bytes.

  5. Introduce function `unsafe_any_char' to allow efficient
     (zero-copy?) parsing.

  6. Prune dependencies by removing `base'.

  P.S. The documentation is bit behind in this release so please bear
  with me while work through the issues in the coming days.

  [Reparse repo]


[String parser for example]
<https://github.com/lemaetech/reparse/blob/master/lib/reparse.mli#L1237>

[Make functor]
<https://github.com/lemaetech/reparse/blob/master/lib/reparse.mli#L1230>

[Reparse repo]
<https://github.com/lemaetech/reparse/blob/master/lib/reparse.ml>


Progress 0.2.0
══════════════

  Archive: <https://discuss.ocaml.org/t/ann-progress-0-2-0/8063/1>


Craig Ferguson announced
────────────────────────

  I'm pleased to announce the 0.2.0 release of [`Progress'], now
  available via Opam.

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/7/727d878b6d17f3c48e6946f4df424bcc59938da3.png>

  `Progress' is an OCaml library for defining and using progress
  bars. It has the following features:

  • allows user-defined progress bar layouts;
  • supports rendering multiple progress bars simultaneously;
  • dynamically responds to changes in terminal size;
  • supports interleaving logging with progress bar rendering.

  This second release contains a much-improved DSL for specifying
  progress bars, alongside improvements and extensions to the rendering
  logic. The bars in the screenshot above are defined as follows:

  ┌────
  │ let bar ~color ~total =
  │   let open Progress.Line in
  │   list
  │     [ spinner ~color:(Progress.Color.ansi ~green) ()
  │     ; brackets (elapsed ())
  │     ; bar ~color total
  │     ; bytes
  │     ; parens (const "eta: " ++ eta total)
  │     ]
  └────

  It also comes with more complete [documentation] and many more
  [examples], including:

  • a Cargo-like progress bar w/ logging of intermediate results:

    <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/4/4b148999f7b6029ac0155b049b6a7cf1fa8b40f1_2_1380x500.png>

  • a Yarn-like stack of spinners:

    <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/6/67ccf011a403a4c082829f69d5a609b4c0c23f6e.png>

  • a showcase of various progress bar styles:

    <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/optimized/2X/d/d4df4a2df07fd161982243251fbee56d52a4afbf_2_1034x538.png>


  The changelog is [here] and the API documentation is [here]. The
  library is not yet feature-complete, but should still be reasonably
  useful :-) Happy hacking!


[`Progress'] <https://github.com/craigfe/progress>

[documentation]
<https://craigfe.github.io/progress/progress/Progress/index.html>

[examples] <https://github.com/CraigFe/progress/tree/main/examples>

[here]
<https://github.com/CraigFe/progress/blob/0.2.0/CHANGES.md#020-2021-06-26>

[here] <https://craigfe.github.io/progress/progress/Progress/index.html>


http-multipart-formdata v2.0.0
══════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-http-multipart-formdata-v2-0-0/8064/1>


Bikal Lem announced
───────────────────

  I am pleased to announce v2.0.0 release of
  `http-multpart-formdata'. This release departs from previous in-memory
  representation of http multipart forms to a streaming, memory
  efficient representation. The new streaming mechanism should help when
  processing larg file uploads in your OCaml web applications.

  1. [httpaf sample web app]
  2. [http-multipart-formdata repo]


[httpaf sample web app]
<https://github.com/lemaetech/http-multipart-formdata/blob/master/examples/multipart_httpaf.ml>

[http-multipart-formdata repo]
<https://github.com/lemaetech/http-multipart-formdata>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-06-22  9:04 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-06-22  9:04 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of June 15 to 22,
2021.

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

First releases of dirsp-exchange: auditable variant of Signal Protocol and ProScript-to-OCaml translator
Job offer: 3 year research engineer in static analysis of OCaml programs at Inria Rennes
IRC channels available on libera.chat
Set up OCaml 2.0.0-beta
First release of Jsonxt - a set of JSON parsers and writers
mula 0.1.0, ML's radishal Universal Levenshtein Automata library
New release of mlcuddidl, the OCaml interface to the CUDD BDD library
first release of orf: OCaml Random Forests
Old CWN


First releases of dirsp-exchange: auditable variant of Signal Protocol and ProScript-to-OCaml translator
════════════════════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-releases-of-dirsp-exchange-auditable-variant-of-signal-protocol-and-proscript-to-ocaml-translator/8008/1>


jbeckford announced
───────────────────

  I'm pleased to announce the first release of [dirsp-exchange],
  available today from the Opam repositories.

  The intent of the *[dirsp]* libraries is to provide software engineers
  with auditable source code that has some level of safety assurance
  (typically proofs) from security researchers.

  The first libraries are:

  • dirsp-exchange-kbb2017 0.1.0 - The KBB2017 protocol for securing a
    two-party conversation. Similar to Signal Protocol v3 and Olm
    Cryptographic Ratchet.
  • dirsp-ps2ocaml 0.1.0 - A ProScript to OCaml translator. ProScript is
    an executable subset of JavaScript that can be formally verified.

  and a couple more supporting libraries.

  `dirsp-exchange-kbb2017' has a build process that generates its own
  OCaml code using `dirsp-ps2ocaml' on formally verified ProScript
  source code.

  The canonical example for `dirsp-exchange-kbb2017' is:

  ┌────
  │ module P       = Dirsp_proscript_mirage.Make()
  │ module ED25519 = P.Crypto.ED25519
  │ module K       = Dirsp_exchange_kbb2017.Make(P)
  │ module U       = K.UTIL
  │ 
  │ (* Alice sends a message to Bob *)
  │ let aliceSessionWithBob = T.newSession (* ... supply some keys you create with ED25519 and U ... *) ;;
  │ let aliceToBobSendOutput = T.send
  │   aliceIdentityKey
  │   aliceSessionWithBob
  │   (P.of_string "Hi Bob!")
  │ 
  │ (* Now you can send the output "aliceToBobSendOutput" from Alice to Bob.
  │    Let's switch to Bob's computer. He gets notified of a new message using a notification library of
  │ your choosing, and then does ...  *)
  │ 
  │ let bobSessionWithAlice = T.newSession (* ... supply some keys ... *);;
  │ let bobFromAliceReceiveOutput = T.recv
  │   bobIdentityKey
  │   bobSignedPreKey
  │   bobSessionWithAlice
  │   theEncryptedMessageBobReceivedFromAlice
  │ assert (bobFromAliceReceiveOutput.output.valid)
  │ Format.printf "Bob just received a new message: %s\n"
  │   (bobFromAliceReceiveOutput.plaintext |> P.to_bytes |> Bytes.to_string)
  └────

  These are early releases, especially `dirsp-ps2ocaml'.

  Online docs are at <https://diskuv.github.io/dirsp-exchange>

  Feedback, contributions and downloads are very welcome!


[dirsp-exchange] <https://github.com/diskuv/dirsp-exchange#readme>


Job offer: 3 year research engineer in static analysis of OCaml programs at Inria Rennes
════════════════════════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-offer-3-year-research-engineer-in-static-analysis-of-ocaml-programs-at-inria-rennes/8012/1>


Benoit Montagu announced
────────────────────────

  as part of a project between Inria and Nomadic Labs, we are offering a
  3 year research engineer position, to work on static analysis for
  OCaml programs.  The position will start in October in the Celtique
  Inria research team, in the vibrant city of Rennes, France.  If you
  are a talented OCaml programmer, if you are interested in static
  analysis, or if you simply want to know more about this project,
  please contact me!

  The detailed job description is here:
  <https://jobs.inria.fr/public/classic/fr/offres/2021-03821>

  Please feel free to transfer this announce to people that you think
  could be interested.


IRC channels available on libera.chat
═════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-06/msg00014.html>


Deep in this thread, Romain Calascibetta announced
──────────────────────────────────────────────────

  Just to let you know that I spent a time to re-implement the IRC
  protocol in OCaml and to deploy a simple MirageOS as a logger to save
  discussions into a Git repository. The bot is currently deployed, the
  explanation is available here:
  <https://github.com/dinosaure/cri/tree/master/unikernel> And used for
  #mirage@irc.libera.chat

  It's a nice example about MirageOS/unikernel and I may deploy one to
  save #ocaml@irc.libera.chat as whitequark already does with her bot.


Set up OCaml 2.0.0-beta
═══════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-set-up-ocaml-2-0-0-beta/8016/1>


Sora Morimoto announced
───────────────────────

  Hopefully, this will be the last release before stable 2.0.0. This
  release allows you to add multiple custom repositories, which enables
  testing with multicore and beta repository.

  ┌────
  │ - name: Use Multicore OCaml
  │   uses: ocaml/setup-ocaml@v2
  │   with:
  │     ocaml-compiler: ocaml-variants.4.12.0+domains+effects
  │     opam-repositories: |
  │       multicore: https://github.com/ocaml-multicore/multicore-opam.git
  │       default: https://github.com/ocaml/opam-repository.git
  └────


First release of Jsonxt - a set of JSON parsers and writers
═══════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-release-of-jsonxt-a-set-of-json-parsers-and-writers/8018/1>


Stephen Bleazard announced
──────────────────────────

  Jsonxt provides a number of JSON parsers and writers for RFC 8259
  compliant JSON as well as non-standard extensions supported by Yojson.
  Features include
  • RFC 8259 compliant when in strict and basic mode
  • Performance focused especially for files and strings
  • Support for standard and extended JSON tree types:
    • Strict follows a strict interpretation of RFC 8259 with all
      numbers represented as floats.
    • Basic extends the strict type to include convenience types while
      maintaining RFC compliance.  This is compatible with Yojson's
      Basic type
    • Extended adds additional non-standard types including tuples and
      variants and is not RFC compliant. This is compatible with
      Yojson's Safe type
  • A number of different parsers including
    • A standard JSON tree parser for various sources including string,
      file and channel
    • A Stream parser that returns a stream of raw JSON tokens.
    • A monad based parser compatible with async
  • Writers including
    • File and string writers
    • A monad based writer that is compatible with async
    • A stream writer that converts a stream of JSON tokens
  • Support for streaming JSON via the [Stream] module
  • Standard interfaces including Yojson compatibility
  • Support for `ppx_deriving_yojson' and `ppx_yojson_conv' via Yojson
    compatibility

  The package is available via opam, with documentation on [github.io].
  The source can be found at [github/jsonxt]


[Stream] <https://ocaml.org/api/Stream.html>

[github.io]
<https://stevebleazard.github.io/ocaml-jsonxt/jsonxt/index.html>

[github/jsonxt] <https://github.com/stevebleazard/ocaml-jsonxt>


mula 0.1.0, ML's radishal Universal Levenshtein Automata library
════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-mula-0-1-0-mls-radishal-universal-levenshtein-automata-library/8021/1>


Ifaz Kabir announced
────────────────────

  I'm happy to announce the release of my library `mula'. The package
  uses Universal Levenshtein Automata (ULA) to not only check if a word
  is within a certain edit distance of another, but to also output what
  the edit distance is! It uses the automata themselves to calculate
  edit distances. A fun use case for this is that we can feed a set of
  words to the automaton and immediately rank the words by their edit
  distance.

  `Mula' supports both the standard Levenshtein edit distance as well as
  the Demarau-Levenshtein distance which counts transpositions of two
  adjacent characters as a single edit. I also support getting live
  error counts, so you can feed part of a string into an automaton, and
  get the minimum number of errors that have occurred so far.

  I currently have matching working using non-deterministic ULA, but I
  have partially started the work toward the deterministic versions. It
  should be possible to pre-compute the DFAs for up to edit distance 3
  and pack it with the library, never needing to be recomputed because
  the Universal Automata are independent of the input strings. But the
  non-deterministic automata support very large edit distances:
  (Sys.int_size - 1)/2, so they have value on their own.

  This library came about from a desire to add a "did you mean" feature
  to a toy compiler, but not wanting to write the kind of dynamic
  programming code that you can find in the OCaml compiler [1] or
  merlin/spelll [2,3].

  You can find the library [here] and the documentation [here].  It's
  not on `opam' yet, but I have submitted a [pull request].

  Happy OCamling!

  References:
  1. Edit distance in the OCaml
     compiler. <https://github.com/ocaml/ocaml/blob/e5e9c5fed56efdd67601e4dbbaebeb134aee361c/utils/misc.ml#L516>.
  2. Edit distance in
     merlin. <https://github.com/ocaml/merlin/blob/444f6e000f6b7dc58dac44d6ac096fc0e09894cc/src/utils/misc.ml#L527>
  3. Edit distance in
     spelll. <https://github.com/c-cube/spelll/blob/3da1182256ff2507a0be812f945a7fe1a19adf9b/src/Spelll.ml#L26>


[here] <https://github.com/ifazk/mula/>

[here] <https://ifazk.github.io/mula/mula/index.html>

[pull request] <https://github.com/ocaml/opam-repository/pull/18895>


Ifaz Kabir then added
─────────────────────

Some details:
╌╌╌╌╌╌╌╌╌╌╌╌╌

  I followed the paper by Touzet [1] as much as possible. If you take a
  look at the code, you'll see a a lot of +1's for 1-indexing. This was
  to keep the implementation as close to the paper as possible! (If you
  do want to check the implementation against the paper, note that the
  paper has a typo in Definition 2). For the Demarau-Levenshtein
  automaton, I adapted Figure 9 from Mitankin's thesis [2]. I'm
  convinced that my adaptation works, but my adaptation of Touzet's
  subsumption relation for Demarau-Levenshtein might be slightly
  sub-optimal. If you have question about the adaptation, feel free to
  ask!

  `mula' does not completely replace c-cube's `spelll' package. In
  particular I don't support any indexs, etc. But there are some
  interesting differences in the automata they use. (`w' stands for the
  base word here)
  1. The `spelll' package creates the Levenshtein Automaton for a single
     string/word (LA_w), `mula' uses Universal Levenshtein Automata
     (ULA).
  2. `Spelll' computes a DFA from a non-deterministic automaton that
     uses eplison transitions. ULA do not have epsilon transitions, but
     for transitions it looks ahead into the base word `w'. Additionally
     the NFA's states/transitions are computable on the fly, so there is
     no need to store the NFA in memory.
  3. `Spelll''s automata transitions using characters. `mula' computes a
     bitvector from an input character to transition from states to
     states. (Computing the bitvector is where the look ahead comes in).
  4. `Spelll''s automata return `true~/~false', and uses a separate
     function to calculate edit distances. `Mula' uses the automaton
     itself to calculate edit distances, the outputs have type `int
     option'. (LA_w can be modified to support this though!)

  References:
  1. On the Levenshtein Automaton and the Size of the Neighborhood of a
     Word. Hélène Touzet
     <https://hal.archives-ouvertes.fr/hal-01360482/file/LATA2016.pdf>
  2. Universal Levenstein Automata: Building and Properties. Petar
     Nikolaev
     Mitankin. <https://store.fmi.uni-sofia.bg/fmi/logic/theses/mitankin-en.pdf>


New release of mlcuddidl, the OCaml interface to the CUDD BDD library
═════════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-new-release-of-mlcuddidl-the-ocaml-interface-to-the-cudd-bdd-library/8028/1>


nberth announced
────────────────

  I'm pleased to write this first release announcement for the
  [mlcuddidl] package.

  These bindings to the CUDD BDD library were initially written by
  Bertrand Jeannet and have been around as an OPAM package for quite
  some time now.  The source code is now hosted on [framagit].

  This release of version 3.0.7 mostly ports the package to OCaml
  versions ≥ 4.10.


[mlcuddidl] <https://opam.ocaml.org/packages/mlcuddidl>

[framagit] <https://framagit.org/nberth/mlcuddidl>


first release of orf: OCaml Random Forests
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-first-release-of-orf-ocaml-random-forests/8034/1>


UnixJunkie announced
────────────────────

  I finished implementing a classifier and regressor using Random
  Forests (seminal paper:
  <https://link.springer.com/article/10.1023/A:1010933404324>):

  <https://github.com/UnixJunkie/orf>

  Some caveats:
  • this is somewhat slow; especially the classifier (and I don’t know
    so much how to accelerate it; probably two orders of magnitude
    slower than sklearn).
  • this is not super generic (int IntMap sparse features only; i.e. a
    sparse vector of integers represents a sample).

  The package is now available in opam (opam install orf).

  Two interfaces are exposed:

  RFC (for classification)
  <https://github.com/UnixJunkie/orf/blob/master/src/RFC.mli>

  RFR (for regression)
  <https://github.com/UnixJunkie/orf/blob/master/src/RFR.mli>

  The test file shows some usage examples:
  <https://github.com/UnixJunkie/orf/blob/master/src/test.ml>

  If you want to help, I tried to flag a few things for the near future:
  <https://github.com/UnixJunkie/orf/issues>

  If you use it and if it is useful to you, I would be happy to know.


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-06-01  9:23 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-06-01  9:23 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 25 to June 01,
2021.

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

Dream — a simple, yet feature-complete Web framework
Ocaml developer at Routine, Paris, Remote OK
Feather 0.2.0
BAP 2.3.0 Release
Building Ahrefs codebase with Melange
Lwt 5.4.1
Other OCaml News
Old CWN


Dream — a simple, yet feature-complete Web framework
════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/dream-a-simple-yet-feature-complete-web-framework/7909/1>


Anton Bachin announced
──────────────────────

  I am pleased to announce [*Dream*], a very easy-to-use Web framework
  with high performance, secure defaults, and thorough documentation!

  <https://aws1.discourse-cdn.com/standard11/uploads/ocaml/original/2X/3/3384d2a4557f6ab17b585711a47e4f6c90a77652.png>

  It is available now from opam, with `opam install dream'.

  Dream offers:

  • [WebSockets] and [GraphQL].
  • A [template syntax], which you can see in the image above.
  • Trivial [HTTPS and HTTP/2 support], allowing simple deployments
    without a proxy.
  • [Sessions] with pluggable [back ends].
  • Easy [secure cookies] and [CSRF-safe forms].

  …and more, yet Dream sticks to a simple programming model:

  • Web apps are just [bare functions] from requests to responses.
  • [Middlewares] are just higher-order wrapper functions.
  • [Routes] tell the [router] which of these functions to call.

  Indeed, for those who like algebra, there is a certain [structure] to
  Dream. However, that's not the point of this post!

  Dream is meant to be very easy to understand. It sticks to base types,
  introducing only a few types of its own, and uses existing languages,
  such as HTML for templates, and URLs for routes. Dream itself is one
  module in one opam package, which lives in a monorepo. The [docs] are
  on one page.

  Dream is loosely coupled. Even though Dream offers many defaults, it
  is unopinionated, and you can quickly configure or replace
  anything. For example, it is easy to [use TyXML] for templates, and
  Dream happily supports such usage with examples.

  Security-sensitive features, such as cookies, are arranged so that
  simple and obvious usage is automatically secure.  Wherever security
  still depends on the Dream app, the docs [highlight] it. Dream has
  selected a modern [cipher] as a default, supports [key rotation], and
  offers suggestions for other purposes, such as password hashing. It
  implements and abstracts away all of the [OWASP] security guidelines
  that are relevant to its level.

  Dream is designed for full internationalization. It has a centralized
  [error handler] that intercepts even lower-level HTTP errors, so that
  you can decorate them with your app's own error template, and leak no
  hardcoded strings. Dream's URL encoders [favor] internationalized
  (UTF-8) URIs, and the router accepts them.

  Finally, Dream is designed for a wide range of applications, including
  with or without a proxy, standalone or embedded in larger binaries,
  and with external static assets or [assets compiled in].


[*Dream*] <https://github.com/aantron/dream>

[WebSockets]
<https://github.com/aantron/dream/tree/master/example/k-websocket#files>

[GraphQL]
<https://github.com/aantron/dream/tree/master/example/w-graphql-subscription#files>

[template syntax]
<https://github.com/aantron/dream/tree/master/example/7-template#files>

[HTTPS and HTTP/2 support]
<https://github.com/aantron/dream/tree/master/example/l-https#files>

[Sessions]
<https://github.com/aantron/dream/tree/master/example/b-session#files>

[back ends] <https://aantron.github.io/dream/#back-ends>

[secure cookies] <https://aantron.github.io/dream/#cookies>

[CSRF-safe forms] <https://aantron.github.io/dream/#forms>

[bare functions] <https://aantron.github.io/dream/#type-handler>

[Middlewares] <https://aantron.github.io/dream/#type-middleware>

[Routes] <https://aantron.github.io/dream/#type-route>

[router] <https://aantron.github.io/dream/#val-router>

[structure] <https://aantron.github.io/dream/#algebra>

[docs] <https://aantron.github.io/dream/>

[use TyXML]
<https://github.com/aantron/dream/tree/master/example/w-tyxml#files>

[highlight]
<https://github.com/aantron/dream/tree/master/example/7-template#security>

[cipher] <https://aantron.github.io/dream/#cryptography>

[key rotation] <https://aantron.github.io/dream/#servers>

[OWASP] <https://cheatsheetseries.owasp.org/>

[error handler]
<https://github.com/aantron/dream/tree/master/example/9-error#files>

[favor] <https://aantron.github.io/dream/#val-to_percent_encoded>

[assets compiled in]
<https://github.com/aantron/dream/tree/master/example/w-one-binary#files>

Documentation
╌╌╌╌╌╌╌╌╌╌╌╌╌

  Dream is very extensively documented. See…

  • [*Examples*], the first several of which make up a tutorial. Each
    example is a complete project.
  • The online [*playground*], which features many of the examples, and
    is itself a [Dream app]!
  • The [*API docs*].

  In particular, see

  • Deployment examples for [Heroku], Digital Ocean [with Docker], and
    Digital Ocean [with systemd], all of which include GitHub Actions
    scripts and instructions.
  • Full-stack examples with [js_of_ocaml], [ReScript], and [Melange].
  • Examples in [Reason syntax].
  • Development [watching] and [live reloading].


[*Examples*]
<https://github.com/aantron/dream/tree/master/example#readme>

[*playground*] <http://dream.as/ocaml>

[Dream app]
<https://github.com/aantron/dream/tree/master/example/z-playground>

[*API docs*] <https://aantron.github.io/dream/>

[Heroku]
<https://github.com/aantron/dream/tree/master/example/z-heroku#files>

[with Docker]
<https://github.com/aantron/dream/tree/master/example/z-docker-esy#files>

[with systemd]
<https://github.com/aantron/dream/tree/master/example/z-systemd#files>

[js_of_ocaml]
<https://github.com/aantron/dream/tree/master/example/w-fullstack-jsoo#files>

[ReScript]
<https://github.com/aantron/dream/tree/master/example/w-fullstack-rescript#files>

[Melange]
<https://github.com/aantron/dream/tree/master/example/r-fullstack-melange#files>

[Reason syntax]
<https://github.com/aantron/dream/tree/master/example#reason>

[watching]
<https://github.com/aantron/dream/tree/master/example/w-fswatch#files>

[live reloading]
<https://github.com/aantron/dream/tree/master/example/w-live-reload#files>


Contributing
╌╌╌╌╌╌╌╌╌╌╌╌

  Dream has already received several very helpful [contributions], and
  more are very welcome! See [`CONTRIBUTING.md']. I must also
  acknowledge all the people working on Dream's [dependecies] and [prior
  art]. In particular, Dream relies heavily on the HTTP and WebSocket
  [servers] primarily by Spiros Eliopoulos (@seliopou) and Antonio Nuno
  Monteiro (@anmonteiro).

  Apart from accepting code, docs, and examples, Dream will happily link
  to:

  • Blogs and articles, as different people learn best from different
    presentations.
  • "Downstream" libraries to use with Dream.

  For example, Thibaut Mattio (@tmattio) is working on
  [dream-livereload], a live-reloading middleware for Dream, similar to
  the [example], which he also contributed! Once dream-livereload is
  slightly more mature, Dream will link to it from its README.

  There is also [dream-serve], a live-reloading static site server based
  on Dream and libuv, which was used to develop the docs.


[contributions] <https://github.com/aantron/dream/graphs/contributors>

[`CONTRIBUTING.md']
<https://github.com/aantron/dream/blob/master/docs/CONTRIBUTING.md>

[dependecies]
<https://github.com/aantron/dream/blob/b79b06dd6add32beba6eee6864ce99413634b7b3/dream.opam#L49-L111>

[prior art] <https://github.com/aantron/dream#acknowledgements>

[servers]
<https://github.com/aantron/dream/tree/b79b06dd6add32beba6eee6864ce99413634b7b3/src/vendor>

[dream-livereload] <https://github.com/tmattio/dream-livereload>

[example]
<https://github.com/aantron/dream/tree/master/example/w-live-reload#files>

[dream-serve] <https://github.com/aantron/dream-serve>


Roadmap
╌╌╌╌╌╌╌

  Dream is currently in an alpha state. It is thought (by me) to be
  internally quite stable. However, there will probably be various API
  tweaks before release 1.0.0.

  My current, rough plan is to release several alphas of Dream over six
  months or so. The releases will address:

  1. Flow control for very large responses, and getting the "advanced"
     part of the I/O API to be as close to zero-copy and non-allocating
     as possible (or reasonable).
  2. Remaining (optional) [security enhancements], such as a [default
     content security policy].
  3. Remaining [session improvements], such as re-keying.
  4. Friction in handling of JSON, database access, etc. This is not
     properly part of or due to Dream, but it should be addressed for a
     better Web development experience.
  5. Multicore and effects support.

  That's all. Let's bring OCaml to the Web! Happy Web programming!


  <https://github.com/aantron/dream>


[security enhancements]
<https://github.com/aantron/dream/issues?q=is%3Aissue+is%3Aopen+label%3Asecurity>

[default content security policy]
<https://github.com/aantron/dream/issues/48>

[session improvements] <https://github.com/aantron/dream/issues/13>


Anton Bachin then added
───────────────────────

  For readers who saw the repo during the earlier ["leak,"] the main
  updates are:

  • A large number of new examples, including [deployment].
  • The [playground], which runs the examples, and itself served as a
    test.
  • An esy-based [quick start] script.

  There have also been very many smaller changes to the code, API, and
  the rest of the docs, but the above changes are the biggest "chunks."
  The rest is too much to detail :)


["leak,"] <https://discuss.ocaml.org/t/7605>

[deployment]
<https://github.com/aantron/dream/tree/master/example#deploying>

[playground] <http://dream.as>

[quick start] <https://github.com/aantron/dream#quick-start>


Ivan Gotovchits asked and Anton Bachin replied
──────────────────────────────────────────────

        I was always wondering how does the source code that uses
        [templates] work with OCaml tooling, in particular with
        merlin, ocp-indent, ocaml-format, tuareg and other editor
        modes?

  It doesn't work well in practice with anything other than syntax
  highlighting. Note that you control the syntax mode with the
  extension. If your template is mostly HTML, you can name it
  `foo.eml.html'.

  The intent is that the templates should contain mostly HTML in a large
  project, and most of them would be in their own `template/'
  subdirectory. OCaml tooling wouldn't be needed for these mostly-HTML
  files. For a still-small, but real example of this, see the
  Playground's [`client.eml.html'].

  The one-file `.ml' projects with templates, where tooling is a
  problem, are mostly good for the very first steps of getting started,
  and examples.

  There is also an issue about this in the repo, [#55 " how to apply
  ocamlformat"].

  Note that, as in the announcement text, you can use Dream with other
  templaters, including [TyXML], which has an [HTML PPX]. In addition,
  if you are using Reason, you can use [TyXML JSX]. Either of these
  options interacts well with tooling, as far as I know.

  I didn't make TyXML the default because it considerably increases the
  Dream learning curve for getting basic tasks done. However, Dream
  still supports the choice of using TyXML with examples and links.


[templates] <https://aantron.github.io/dream/#templates>

[`client.eml.html']
<https://github.com/aantron/dream/blob/fa20aebf36307a07b59c9ea018c25e508415d91a/example/z-playground/client/client.eml.html>

[#55 " how to apply ocamlformat"]
<https://github.com/aantron/dream/issues/55>

[TyXML]
<https://github.com/aantron/dream/tree/master/example/w-tyxml#files>

[HTML PPX]
<https://github.com/aantron/dream/tree/master/example/w-tyxml#html-syntax>

[TyXML JSX]
<https://github.com/aantron/dream/tree/master/example/r-tyxml#files>


Ocaml developer at Routine, Paris, Remote OK
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-ocaml-developer-at-routine-paris-remote-ok/7911/1>


mefyl announced
───────────────

  Routine (<https://routine.co>) is looking for an OCaml developer.

  Routine is a personal productivity assistant. The technological
  revolves heavily around OCaml which represents 90% of the codebase,
  the remaining 10% being the UI in Typescript and Vue.js. We target
  both the browser and desktop through electron, using Js_of_ocaml.

  While the product is "just" a web app, our technological and academic
  background leads us to use designs that, I think, can pique the
  interest of seasoned Ocaml developer. Amongst other things :

  • Type-driven programming based on ppx derivers that produces
    typescript declaration for frontend bindings, JSON schema to expose
    and consume external REST APIs (Google, Notion, …), automatic SQL
    bindings, etc.
  • Angstrom based parsing for the interactive console with highlighting
    and completion.
  • Incremental based state updates to refresh minimal subsets of the
    app.
  • Highly concurrent implementation through Lwt, exception-free design.

  We use state of the art CI/CD and development processes. We plan on
  distributing open sources packages of these utilities (type-driven
  system, Google API bindings, Notion API bindings, …). Future exciting
  subjects could be extending Angstrom with manual rollback to implement
  generic completions or binding Vue in OCaml directly using melange or
  rescript to achieve rock solid typing down to the very frontend code
  (highly prospective teases, don't quote me on this yet :).

  The company is very much a startup, having just completed YC batch W21
  and closed its first round of investment.  Salary is up to market
  standard depending on the profile, plus usual options package, to be
  discussed.

  While we expect great OCaml and general computer science proficiency,
  we're open to most levels of experience.  Thoroughness and a love for
  well rounded, robust and beautiful software design is a must have -
  but that comes bundled with OCaml love, right ?

  Do not hesitate to reach out for any question here, at
  quentin.hocquet@routine.co or refer this to someone who may be
  interested.

  Thanks for your time and happy camel riding !


Feather 0.2.0
═════════════

  Archive: <https://discuss.ocaml.org/t/ann-feather-0-2-0/7916/1>


Charles announced
─────────────────

  I'm happy to announce feather version 0.2.0! Feather is a minimal
  library for bash-like scripting and process execution.  ([github],
  [opam])

  This release fixes some bugs and adds three new functions

  • `val and_ : cmd -> cmd -> cmd' — chain two commands, short
    circuiting if the first fails, akin to bash's `&&' operator.
  • `val or_ : cmd -> cmd -> cmd' — chain two commands, short circuiting
    if the first succeeds, akin to bash's `||' operator.
  • `val sequence : cmd -> cmd -> cmd' — chain two commands regardless
    of exit status.

  We include two new operators `&&.' and `||.' which correspond to
  `and_' and `or_' respectively. They'll be found in the `Feather.Infix'
  module, which has been renamed from `Feather.File_redirection_infix'.

  Many thanks to new contributors @Firobe @juxd and @tmarti2 for making
  this release possible!


[github] <https://github.com/charlesetc/feather>

[opam] <https://opam.ocaml.org/packages/feather/>


BAP 2.3.0 Release
═════════════════

  Archive: <https://discuss.ocaml.org/t/ann-bap-2-3-0-release/7926/1>


Ivan Gotovchits announced
─────────────────────────

  We're proud to release the next stable version of Carnegie Mellon
  University Binary Analysis Platform ([BAP]). The full list of changes
  can be found on the [release page] but the most interesting new
  features are highlighted below.


[BAP] <https://github.com/BinaryAnalysisPlatform/bap>

[release page]
<https://github.com/BinaryAnalysisPlatform/bap/releases/tag/v2.3.0>

The Primus Lisp Frontend
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Now BAP is able to understand not only binary programs but sources
  written in Primus Lisp. In case if you don't know, [Primus Lisp] is
  our DSL for writing analysis and library stubs (e.g., to specify
  semantics of missing library functions). Now, it is possible to reify
  Primus Lisp programs into static representation. For example, we can
  translate the following Lisp program

  ┌────
  │ ;; file demo.lisp
  │ 
  │ (defun example1 (x)
  │   (set R0 1)
  │   (set R1 2)
  │   (set R3 (+ R1 R2 (* R1 R2 3)))
  │   (memory-write R4 (+ R3 R1))
  │   (if (> R0 (* R0 R0))
  │       (exec-addr 0xDEADBEEF)
  │     (set R0 (* R0 R2 R3))))
  └────

  into the BIL (BAP Instruction Language) AST and then pretty print it,
  ┌────
  │ $ bap show --primus-lisp-load=demo --target=armv7+le -obap:bil example1
  │ example1:
  │ "{
  │    R0 := 1
  │    R1 := 2
  │    R3 := R1 + R2 + R1 * R2 * 3
  │    mem := mem with [R4] <- low:8[R3 + R1]
  │    #1 := R0 * R0 < R0
  │    if (#1) {
  │      jmp 0xDEADBEEF
  │    }
  │    else {
  │      R0 := R0 * R2 * R3
  │    }
  │  }"
  └────

  This new feature not only allows us to reify our Lisp stubs into
  static form but also enables the main killer feature. It is now
  possible to specify the semantics of machine instructions in Primus
  Lisp. This feature enables rapid development and experimentation with
  CPU semantics. And this brings us to the next new feature.


[Primus Lisp]
<https://binaryanalysisplatform.github.io/bap/api/master/bap-primus/Bap_primus/Std/Primus/Lisp/index.html>


New Target: RISC-V
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The first application of the Primus Lisp Frontend was writing the
  RISC-V semantics. It took me only one day to write the semantic of the
  [minimal subset] of RISC-V instruction. Well, partially it is because
  RISCV-V is truly RISC, like the `add' instruction just adds,

  ┌────
  │ (defun ADDI (dst rm rn)
  │   (set$ dst (+ rm rn)))
  └────


[minimal subset]
<https://github.com/BinaryAnalysisPlatform/bap/pull/1287>


New Target: ARMv8 (Aarch64)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The next target that we tried was Aarch64, the 64-bit ARM
  architecture. It was a little bit [harder] but still definitely more
  readable than the official ARM semantics.


[harder]
<https://github.com/BinaryAnalysisPlatform/bap/blob/master/plugins/arm/semantics/aarch64.lisp>


Adds namespaces (packages) to Primus Lisp
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Since now we have much more code in Primus Lisp we found ourselves
  struggling with name clashes. The Primus Lisp program model is a set
  of mututally recursive overloaded definitions, so naming things is
  crucial for us. Therefore we implemented namespaces (which are,
  following Common Lisp trandition, named packages). We ended up in a
  very Common Lisp look and fill but without inheriting CL problems,
  like the dependency on the order of inclusion and package
  redefinitions, and so on. Given our model, and that Primus Lisp
  features type inference and Haskell-style type classes for
  overloading, it wasn't that easy to implement :)


Adds the `bap dependencies' command
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  The [command] outputs program dependencies such as libraries and
  symbols. The information is collected recursively with various output
  options, including dependency graph, YAML, JSON, and SEXP.

  Much like `nm~+~ldd' on steroids and cross-platform (works on
  PE/ELF/COFF, and on binaries that are not native to the host). So it
  could be quite useful even if you're not doing program analysis, but
  just want to solve a nasty missing library feature or figure our what
  programs use what libraries, e.g.,
  ┌────
  │ $ bap dependencies `which ping` --recursive --ldconfig -ograph | graph-easy --as boxart
  │                      ┌────────────────┐
  │                      │ libresolv.so.2 │ ──────────────────────────────────┐
  │                      └────────────────┘                                   │
  │                        ▲                                                  │
  │                        │                                                  │
  │                        │                                                  │
  │ ┌──────────────┐     ┌──────────────────────────┐     ┌────────────────┐  │
  │ │ libidn.so.11 │ ◀── │           ping           │ ──▶ │ libnettle.so.6 │  │
  │ └──────────────┘     └──────────────────────────┘     └────────────────┘  │
  │   │                    │                 │              │                 │
  │   │                    │                 │              │                 │
  │   │                    ▼                 │              │                 │
  │   │                  ┌────────────────┐  │              │                 │
  │   │                  │  libcap.so.2   │  │              │                 │
  │   │                  └────────────────┘  │              │                 │
  │   │                    │                 │              │                 │
  │   │                    │                 │              │                 │
  │   │                    ▼                 ▼              │                 │
  │   │                  ┌──────────────────────────┐       │                 │
  │   └────────────────▶ │        libc.so.6         │ ◀─────┘                 │
  │                      └──────────────────────────┘                         │
  │                        │                      ▲                           │
  │                        │                      └───────────────────────────┘
  │                        ▼
  │                      ┌────────────────┐
  │                      │ ld-linux.so.2  │
  │                      └────────────────┘
  └────


[command] <https://github.com/BinaryAnalysisPlatform/bap/pull/1294>


What's Next?
╌╌╌╌╌╌╌╌╌╌╌╌

  We are working on decompilation and integrating with Ghidra, so in
  2.4.0 you should expect that bap will output C code for binaries. But
  it is not all, we're even working into turning BAP into a program
  analysis framework that enables analysis of source code programs. And
  even crazier, we're working on adding compilation capabilities to BAP,
  i.e., an ability to compile/recompile the input sources. So soon BAP
  will outlive its name, or we will need to find a new interpretation
  for the BAP acronym, something like the Best Analysis Platform ;)

  We also plan to make BAP more available for non-seasoned OCaml users
  and want to push bap into mainstream Linux distributions and overall
  lower the entrance barrier.  Of course, with the end goal to lure
  users into installing opam))


Questions and Suggestions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Please, do not hesitate to ask questions and provide your suggestions
  and, ideally, join our [community]. Even if you don't plan to work on
  binary analysis, BAP offers lots of opportunities for writing your toy
  programs for learning the language, or maybe even student projects.


[community] <https://gitter.im/BinaryAnalysisPlatform/bap>


Building Ahrefs codebase with Melange
═════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/building-ahrefs-codebase-with-melange/7941/1>


Javier Chávarri announced
─────────────────────────

  At Ahrefs, we make extensive use of OCaml and ReScript —previously
  [known as BuckleScript]. So we have been following the latest
  developments in the ReScript ecosystem with great interest.

  A few months ago, [António Monteiro] released [Melange], a fork of
  ReScript with an emphasis of keeping compatibility with OCaml
  ecosystem. One of the key features of Melange is that it uses OCaml
  4.12, with all the upsides that that entails (ppxlib, let syntax,
  better errors, …). Besides that, Melange has been modeled recently [as
  just a `compiler-libs' library], so it can be integrated with other
  OCaml code in a single opam switch.

  We decided to give Melange a try recently at Ahrefs, and shared the
  results of this experiment in a blog post:

  <https://tech.ahrefs.com/building-ahrefs-codebase-with-melange-9f881f6d022b>

  We are currently looking into how a deeper integration with Dune would
  look like. If your team or company has tried Melange, or is interested
  on doing so, we would be very interested to hear your use cases and
  share experiences.


[known as BuckleScript]
<https://rescript-lang.org/blog/bucklescript-is-rebranding>

[António Monteiro] <https://discuss.ocaml.org/u/anmonteiro/summary>

[Melange] <https://github.com/melange-re/melange>

[as just a `compiler-libs' library]
<https://github.com/melange-re/melange/pull/107>


Lwt 5.4.1
═════════

  Archive: <https://discuss.ocaml.org/t/ann-lwt-5-4-1/7943/1>


Raphaël Proust announced
────────────────────────

  We are glad to announce the release of version 5.4.1 of Lwt: a
  bugfix-only release.

  <https://github.com/ocsigen/lwt/releases/tag/5.4.1>

  You can update to this version in `opam':

  ┌────
  │ opam update
  │ opam upgrade lwt
  └────

  Thanks to the contributors for finding and fixing the bugs, leading to
  this release. Check out the release notes (link above) for a full
  list.


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

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [Beta release of Frama-C 23.0~rc1 (Vanadium)]
  • [Building Ahrefs codebase with Melange]
  • [Computing an integer using a Grothendieck topos]
  • [ ReScript 9.1]
  • [Tutorial: Format Module of OCaml]
  • [Tarides project SCoP is selected as one of the brightest Data
    Portability projects in Europe!]
  • [Alt-Ergo Users’ Club Annual Meeting (2021)]


[OCaml Planet] <http://ocaml.org/community/planet/>

[Beta release of Frama-C 23.0~rc1 (Vanadium)]
<https://frama-c.com/fc-versions/vanadium.html>

[Building Ahrefs codebase with Melange]
<https://tech.ahrefs.com/building-ahrefs-codebase-with-melange-9f881f6d022b>

[Computing an integer using a Grothendieck topos]
<http://math.andrej.com/2021/05/18/computing-an-integer-using-a-sheaf-topos/>

[ ReScript 9.1] <https://rescript-lang.org/blog/release-9-1>

[Tutorial: Format Module of OCaml]
<https://www.ocamlpro.com/2021/05/06/tutorial-format-module-of-ocaml/>

[Tarides project SCoP is selected as one of the brightest Data
Portability projects in Europe!]
<https://tarides.com/blog/2021-04-30-scop-selected-for-dapsi-initiative>

[Alt-Ergo Users’ Club Annual Meeting (2021)]
<https://www.ocamlpro.com/2021/04/29/alt-ergo-users-club-annual-meeting-2021/>


Old CWN
═══════

  If you happen to miss a CWN, you can [send me a message] and I'll mail
  it to you, or go take a look at [the archive] or the [RSS feed of the
  archives].

  If you also wish to receive it every week by mail, you may subscribe
  [online].

  [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>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <https://alan.petitepomme.net/>


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

^ permalink raw reply	[flat|nested] 112+ messages in thread

* [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
@ 2021-05-25  7:30 Alan Schmitt
  0 siblings, 0 replies; 112+ messages in thread
From: Alan Schmitt @ 2021-05-25  7:30 UTC (permalink / raw)
  To: lwn, cwn, caml-list

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

Hello

Here is the latest OCaml Weekly News, for the week of May 18 to 25,
2021.

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

Applied PL research at Jane Street
IRC channels available on libera.chat
B Trees in Ocaml via Fmlib 0.3.0
GitHub Actions for OCaml: now stable and on the ocaml org
Set up OCaml 2.0.0-alpha
FrontC 4.1.0 (Vingt ans après)
Old CWN


Applied PL research at Jane Street
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/job-applied-pl-research-at-jane-street/7877/1>


Yaron Minsky announced
──────────────────────

  This isn't exactly news, but we're (still) actively looking to hire
  people to do applied PL research, with a particular focus on
  type-level work. Follow this link if you want to see how to apply.

  <https://blog.janestreet.com/applied-PL-research/>

  Please share it around with anyone who you think might be on the
  market!

  *About the job*

  Part of our ambition is to grow OCaml into a language that does an
  ever better job of being convenient and expressive by default, while
  allowing for the kind of precise control you need when building high
  performance systems, where it's needed.

  That's led us to do research on stack-allocation, unboxed types,
  algebraic effects, type-level resource tracking, and more. We think
  it's an exciting direction for the language, and there's a lot of
  challenging and novel work to be done, and the main thing that could
  speed us up is having more of the right people to work on it!

  Jane Street is an excellent laboratory for this kind of work: big
  enough to have serious and demanding use-cases, but small and nimble
  enough to be able to try out new language features, and then back out
  of them or change them in incompatible ways if need be.

  And all the work we do on the compiler is in the open, with the goal
  of getting the final results into a state where they can be
  upstreamed.

  Also, it's a great team! Full of serious experts who have collectively
  contributed a lot to OCaml and PL research over the years, and also a
  really nice set of people to work with. And I think the team has a
  good balance of the practical and theoretical: working hard to do the
  right thing, but also finding practical ideas that can make forward
  progress in the near term.

  *Who are we looking for*

  We're looking for people with a good balance of theoretical and
  engineering backgrounds, since the work is demanding on both fronts.

  We're happy to hire people at a range of experience levels: people who
  have just finished a post-doc or PhD, up to experienced academics and
  people in industry.

  The team has a presence in New York and London, and we're hiring in
  both offices. No remote work, I'm afraid.


IRC channels available on libera.chat
═════════════════════════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2021-05/msg00022.html>


Adrien Nader announced
──────────────────────

  Due to the recent troubles on freenode[1][2], I've connected to
  irc.libera.chat early in order to create and register the same
  channels that I know and take care ofa on freenode (i.e. #ocaml and
  #ocaml-fr).

  I am not stating libera.chat is better than freenode.net although the
  amount of staffers moving makes me think freenode.net will not be
  running fine for a much longer time.

  At the moment I believe it is better to keep both channels running and
  to encourage people to connect on libera.chat too. In the future, I
  might force migration by progressively silencing the channel that
  should be abandoned.

  If you maintain a relay bot, can you please add it on libera.chat too?

  As far as I know, there is no Matrix bridge available currently. It
  seems the discussion/process for bridge additions occurs at [3].

  A good news is that I've gotten the full rights on the channel,
  something which was requiring paperwork on freenode (which I had
  already mentioned but never got around to doing and for which I never
  even remotely got time for).

  [1] <https://lwn.net/Articles/856543/> (this still constantly changes)
  [2]
  <https://en.wikipedia.org/wiki/Freenode#2021_ownership_change_and_conflict>
  [3] <https://github.com/matrix-org/matrix-appservice-irc/issues/208>


B Trees in Ocaml via Fmlib 0.3.0
════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/b-trees-in-ocaml-via-fmlib-0-3-0/7880/1>


Hbr announced
─────────────

  I am pleased to announce the release (0.3.0) of fmlib, a functional
  library with managed effects.

  The main new feature of release 0.3.0 are B trees. B trees can be used
  to implement finite sets and finite maps. Fmlib's B trees have
  functionality similar to the modules `Set' and `Map' of the standard
  library.

  The modules `Set' and `Map' of the standard library are based on AVL
  trees. B trees offer the same functionality but have on modern
  processors a better cache performance and have better data locality.

  The current B tree implementation in `Fmlib' implements B trees by
  using arrays which are guaranteed to fit into a cache line. The design
  of B trees is described [here]. The API can be found [here].

  The library `Fmlib' has four main components:

  • [Standard Datatypes]: This component offers some modules from
    `Stdlib' with additional functionality. E.g. `Fmlib_std.Array'
    offers functions to insert elements into arrays, remove elements
    from an array and binary search in a sorted array. It has the
    modules `Result' and `Option' which can be used to avoid exceptions
    and use exceptions in a more structured way. The modules `Result'
    and `Option' in `Fmlib' offer a complete monadic interface and offer
    the `let*' operator to write well readable monadic code.

  • [Pretty Printing]: Print tree like structures in a nice way and use
    the library completely functional. The library does not assume a
    specific IO method. The pretty printer generates a lazy stream of
    characteres which can be written by all io functions.

  • [Combinator Parsing]: Easily parse textual input by the use of
    combinators. The library supports indentation sensitivity and can
    therefore be used to parse yaml files, haskell, python,
    etc. Furthermore no input method is assumed. The generated parsers
    are sink of tokens (or characters). You can choose any input method
    and push the tokens/characters into the parsers. The generated
    parsers are fully incremental. Parser can be stored at any position
    of the input stream and in case of interactive editing, parsing can
    be resumed from any point of the stream.

  • [Interface to Javascript]: This components contains primitives to
    interface to javascript via `js_of_ocaml'.

  `Fmlib' can be installed via opam:

  ┌────
  │ opam update
  │ opam install fmlib
  │ opam install fmlib_std
  │ opam install fmlib_pretty
  │ opam install fmlib_parse
  │ opam install fmlib_js
  └────

  The source code of the library is located at [github]


[here] <https://fmlib_ocaml.readthedocs.io>

[here] <https://hbr.github.io/fmlib/odoc/fmlib_std>

[Standard Datatypes] <https://hbr.github.io/fmlib/odoc/fmlib_std>

[Pretty Printing] <https://hbr.github.io/fmlib/odoc/fmlib_pretty>

[Combinator Parsing] <https://hbr.github.io/fmlib/odoc/fmlib_parse>

[Interface to Javascript] <https://hbr.github.io/fmlib/odoc/fmlib_js>

[github] <https://github.com/hbr/fmlib>


GitHub Actions for OCaml: now stable and on the ocaml org
═════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/github-actions-for-ocaml-now-stable-and-on-the-ocaml-org/7889/1>


Anil Madhavapeddy announced
───────────────────────────

  I [anno