[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-07-25 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of July 18 to 25,
2023.

Table of Contents
─

Ppxlib dev meetings
Ocamls spotted in the wild
DkML 2.0.0 Preview Release
Next priority for OCaml?
Explorations on Package Management in Dune
OCamlFormat 0.26.0
Tarides Office Hours: Benchmark Tooling
You Can Attend the New OCaml.org Community Meetings
euler, an arithmetic library for native integers
DkML Install API 0.4.0
Liquidsoap 2.2.0 is out! 
kcas and kcas_data 0.6.1: STM and compositional lock-dree data structures
ctypes 0.21.1, now with dune support
Announcing the ocaml-wasm organisation
Feedback Needed: New “Arrays” Tutorial on OCaml.org
Old CWN


Ppxlib dev meetings
═══

  Archive: 


Continuing this thread, Sonja Heinze announced
──

  Here are the meeting notes of the July meeting:
  

  As a heads-up: There won’t be a meeting in August, so the next one
  will be in September. Have a nice summer/winter/other season everyone!
  :)


Ocamls spotted in the wild
══

  Archive:
  


Thorsten Ohl announced
──

  Here’s a paper on algorithms for theoretical particle physics
  referring to ocaml published today:

  [Functional directed acyclical graphs for scattering amplitudes in
  perturbation theory]


[Functional directed acyclical graphs for scattering amplitudes in
perturbation theory]



gasche then added
─

  It looks like this paper builds on previous work implementing a tool
  called Omega in OCaml, which has been around since 2001:

  O’Mega: An Optimizing Matrix Element Generator
  Mauro Moretti, Thorsten Ohl, Jürgen Reuter, 2001
  


DkML 2.0.0 Preview Release
══

  Archive:
  


jbeckford announced
───

  There are several major changes in version 2.0.0 of DkML, a OCaml
  distribution that uses Visual Studio on Windows. Full DkML 2.0.0
  Release Notes are available, and the installer is
  
.

  Consider 2.0.0 a preview release. If you are risk-averse you may want
  to wait for 2.0.1.

  DkML 2.0.0 Release Notes:
  

  *Breaking change*: The global environment (where you can run `dune',
  `utop', `ocamlopt' and a few other critical OCaml executables without
  having to install your own opam switch) has changed significantly.
  [DkML 2.0.0 Release Notes] describes those changes in detail.

  Why do this breaking change?

  1. 2.0.0+ installations are faster because the global executables do
 not have to be compiled.
  2. It gets the DkML distribution very close to having a lite “bytecode
 only” installer that does not need to install (heavy!) Visual
 Studio, MSYS2 and Git. /This upcoming lite installer could be a
 good fit for educational settings, so feedback from educators is
 appreciated./

  Major non-breaking changes:

  • The deprecated `fdopen' repository is no longer used. Previously
DkML installed a smaller and smaller portion of the `fdopen'
repository with each subsequent version. Now DkML 2.x.x relies only
on the central opam repository and the DkML opam repository.
  • Dune upgraded to 3.8.3. Among other things, the installer no longer
installs a C# file watcher proxy for `dune build -w'; instead Dune
uses its own native Windows file watcher.
  • The set of pinned packages during a `dkml init' local switch has
gone down from approximately 4000 to 200. Rather than pinning each
package in the opam universe to a heuristically-determined version,
we pin only packages that we successfully build on Windows.
  • The following packages are accessible by just typing `utop' without
installing a switch:
‣ [`refl'] reflection package
‣ [`graphics'] package
‣ [`base'] package

  Bug fixes:

  • The installer can now restart after a failed installation, without
having to use the uninstaller.
  • Allow setup to succeed on Windows filesystems that do not support
the setting of file attributes
  • FlexDLL object files `flexdll_initer_msvc64.obj' and
`flexdll_msvc64.obj' (or 32-bit variant on 32-bit installs) are
installed alongside `flexlink.exe' so flexlink can be used by itself
without setting `FLEXDIR' environment variable.

  Changed packages:

  • Many packages are upgraded. Here is a sampling of those upgrades:

 Package   From  To 
 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-07-11 Thread Alan Schmitt
Hello

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

Table of Contents
─

opam 2.2.0~alpha release!
Initial Emissions Monitoring of the OCaml.org Infrastructure
Autofonce, a modern runner for GNU Autotests suites
First beta release of OCaml 5.1.0
Dream-html - DSL to build HTML, integrated with Dream
ppx_subliner 0.2.0
happy-eyeballs, dns, http-{lwt,mirage}-client ++ writeup of happy-eyeballs 
issue and fix
Getting started with ReasonReact and Melange
Making OCaml 5 Succeed for Developers and Organisations
Llama, an OCaml library for declaratively building software-defined modular 
synthesizers
dune 3.9.0
Depending on non-OCaml languages from the opam repository
Status of DkML Windows
Old CWN


opam 2.2.0~alpha release!
═

  Archive:
  


R. Boujbel announced


  On behalf of the opam dev team, I’m happy to announce you the [alpha
  release of opam 2.2.0]. :tada:


[alpha release of opam 2.2.0]


What’s new in this alpha ?
╌╌

  • [] Native Windows compatibility, you can now launch opam in your
favorite Windows terminal! For the moment, it needs an preexisting
Cygwin installation, a limitation that will be lifted for the
alpha2.
  • [] Recursive pinning to have opam look for `.opam' files in
subdirectories.
  • [] Tree view of your installed packages dependencies (and reverse
dependencies).
  • [] Recommended development tools variable `{with-dev-setup}' and
option `--with-dev-setup'. It is used the same way as `with-doc' and
`with-test'. E.g. `depends: [ "ocamlformat" {with-dev-setup & =
"0.23.0"} ]'.
  • [] [Software Heritage] fallback for archive retrieval.
  • [] `opam install' with formulas, like for for switch creation.
  • [] Several new options for `pin', `exec', `source', `clean',
`switch', and `admin'.
  • And of course numerous enhancements, fixes and updates.

  You’ll find these features presented in the [blog post], and for a
  more detailed view you can take a look at the [release note] or
  [changelog].

  We encourage you to try out this alpha release, instructions are
  detailed in the [blog post], in particular for [Windows].


[] 

[] 

[] 

[]


[]


[Software Heritage] 

[]


[] 

[blog post] 

[release note] 

[changelog] 

[blog post] 

[Windows]



Initial Emissions Monitoring of the OCaml.org Infrastructure


  Archive:
  



Patrick Ferris announced


  The library used for accessing emission information from electricity
  grids called “[carbon]” should now be available on opam. This is an
  initial release and might change a bit (e.g. it depends on an alpha
  release of cohttp-eio).

  ┌
  │ opam update && opam install carbon
  └

  Here’s a simple example to get the emission numbers for Great Britain.

  ┌
  │ Eio_main.run @@ fun env ->
  │ Mirage_crypto_rng_eio.run (module Mirage_crypto_rng.Fortuna) env @@ fun _ ->
  │ Carbon.Gb.get_intensity env#net
  │ |> Eio.traceln "%a" Carbon.Gb.Intensity.pp
  └

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


[carbon] 


Autofonce, a modern runner for GNU Autotests suites
═══

  Archive:
  



Fabrice Le Fessant announced


  A recent blog article on the subject:

  


First beta release of OCaml 5.1.0
═

  Archive:
  


octachron announced
───

  After two alpha releases, the release of OCaml 5.1.0 is drawing near.

  We 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-07-04 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of June 27 to July
04, 2023.

Table of Contents
─

New release of CAISAR, a platform for characterizing AI safety and robustness
stdlib-random release 1.1.0
dune 3.8.0
plotly release 1.0.0, a wrapper for Plotly open source graphing library
Help us Make the New Learn Area on OCaml.org Awesome
Sedlex 3.2
dune 3.9.0
Other OCaml News
Old CWN


New release of CAISAR, a platform for characterizing AI safety and robustness
═

  Archive:
  



Julien Girard announced
───

  We are happy to announce the release of CAISAR 0.2, to celebrate (with
  one week delay) the 234th birthday of the Serment du jeu de Paume. On
  this day, courageous people took a vow to abolish autocracy and fight
  for their rights.

  This release is the result of more than one year of work. Here are
  some of the most prominent changes that we are happy to share. The
  release is available under our [gitlab], on opam and on Dockerhub. You
  may check our [website] for additional infos.


[gitlab] 

[website] 

New prover support
╌╌

  We added the support of several provers:

  • the alpha-beta-CROWNprover; winner of the 2021 and 2022 edition of
the VNN-COMP
  • the nnenumhttps://github.com/stanleybak/nnenum) prover
  • the AIMOS metamorphic testing prover, for now internally developped
at CEA

  We also added support to the VNNLib standard. In the future, adding a
  VNNLib compliant prover to CAISAR would only require to edit two small
  files, which is a huge step towards integrating more provers. This
  also results in supporting all solvers that support the SMTLIB2
  language (which VNNLib is a subset of). We implemented a custom
  transformation in CAISAR that automatically translates the neural
  network control flow into a SMT formula. This custom transformation
  had been tested for the CVC5 solver.


Manual
╌╌

  The first version of the CAISAR manual is available under the
  documentation section of our website. It includes detailed
  installation instructions, a synopsis of common commands and two
  tutorials on classical benchmarks. The current version of those
  tutorials make use of experimental features that we plan to document
  in a future release. We hope this manual will provide a good entry
  point to CAISAR, and formal verification of machine learning programs
  at large.


Usability
╌

  We added various utilities to make CAISAR slicker to use, such as
  several logging options, verification through a JSON file, and
  reworked help messages.

  We are also looking for fixed-term positions, intern and PhD students
  to work on CAISAR, check our website or the ocaml job board for more
  infos.


stdlib-random release 1.1.0
═══

  Archive:
  


octachron announced
───

  The library `stdlib-random' is a small compatibility library that
  provides compiler-independent implementations of the PRNGs used in the
  history of the standard library `Random':

  • stdlib-random.v3: implement the PRNG used in OCaml 3.07 to 3.11
  • stdlib-random.v4: implement the PRNG used in OCaml 3.12 to 4.14
  • stdlib-random.v5: implement the PRNG currently used in OCaml 5
  • stdlib-random.v5o: implement the PRNG currently used in OCaml 5 in
pure OCaml

  This library is targeted toward programs that need a deterministic and
  stable behavior of the `Random' module across OCaml versions.

  The newly released version 1.1.0 updates all implementations to
  provide the new PRNG state serialization functions
  (`Random.State.to_binary_string' and `Random.State.of_binary_string')
  that will be available in OCaml 5.1.0 .


dune 3.8.0
══

  Archive: 


Etienne Millon announced


  And here’s the changelog for dune 3.8.3, just released, which fixes
  two important bugs on Linux and Windows:


3.8.3 (2023-06-27)
╌╌

  • Fix deadlock on Windows (#8044, @nojb)

  • When using `sendfile' to copy files on Linux, fall back to the
portable version if it fails at runtime for some reason (NFS, etc).
(#8049, fixes #8041, @emillon)


plotly release 1.0.0, a wrapper for Plotly open source graphing library
═══

  Archive:
  



Jun Furuse announced


  I released an OPAM package plotly, a wrapper for [Plotly Open Source
  Graphing Library].

  It 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-06-27 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of June 20 to 27,
2023.

Table of Contents
─

dune 3.8.0
moonpool 0.2
aeroon, wrapper to Aeron
Representing OCaml on Lemmy
awa-ssh release 0.3
Ppxlib dev meetings
User-friendly continuations over OCaml 5 effects?
Raising the minimum tested version of OCaml to 4.05 or 4.11 (from 4.02)
guroobi, wrapper to Gurobi
euler, an arithmetic library for native integers
CFP - JFLA 2024 - Journées Francophones des Langages Applicatifs
OCaml.org Newsletter: May 2023
Other OCaml News
Old CWN


dune 3.8.0
══

  Archive: 


Etienne Millon announced


  3.8.2 is now available, please find the changelog below (with that of
  3.8.1).


3.8.2 (2023-06-16)
╌╌

  • Switch back to threaded console for all systems; fix unresponsive
console on Windows (#7906, @nojb)

  • Respect `-p' / `--only-packages' for `melange.emit' artifacts
(#7849, @anmonteiro)

  • Fix scanning of Coq installed files (@ejgallego, reported by
@palmskog, #7895 , fixes #7893)

  • Fix RPC buffer corruption issues due to multi threading. This issue
was only reproducible with large RPC payloads (#7418)

  • Fix printing errors from excerpts whenever character offsets span
multiple lines (#7950, fixes #7905, @rgrinberg)


3.8.1 (2023-06-05)
╌╌

  • Fix a crash when using a version of Coq < 8.13 due to the native
compiler config variable being missing. We now explicitly default to
`(mode vo)' for these older versions of Coq. (#7847, fixes #7846,
@Alizter)

  • Duplicate installed Coq theories are now allowed with the first
appearing in COQPATH being preferred. This is inline with Coq’s
loadpath semantics. This fixes an issue with install layouts based
on COQPATH such as those found in nixpkgs. (#7790, @Alizter)

  • Revert #7415 and #7450 (Resolve `ppx_runtime_libraries' in the
target context when cross compiling) (#7887, fixes #7875, @emillon)


moonpool 0.2


  Archive: 


Simon Cruanes announced
───

  Moonpool 0.2 just hit the shelves, fleshing out the feature list for
  futures and pools. Alongside a handful of bugfixes and performance
  improvements.[^1] The changelog can be found [here].

  [^1]: notable, using multiple queues with some basic version of
  work-stealing to reduce contention under load. The queues are still
  using `Mutex.t' for now, but with `try_lock' there should be no actual
  syscall, just atomic operations.

  Sneak peek at the next version: plans include support for `Fut.await'
  using effects (only on OCaml 5), and interoperability with other
  libraries using `domain-local-await'.


[here] 


aeroon, wrapper to Aeron


  Archive:
  


Mika Illouz announced
─

  I’d like to announce the availability of [aeroon], an OCaml wrapper to
  the [Aeron] C library. Typically used in financial systems with
  low-latency requirements, Aeron is a multi-transport communication
  toolset, with support for C, C++, Java, and now OCaml.

  Feedback welcome!


[aeroon] 

[Aeron] 


Representing OCaml on Lemmy
═══

  Archive:
  


Andreas Poisel announced


  Some days ago I created a “community” for OCaml on [Tchncs] (a Lemmy
  instance): [c/ocaml].

  I’m looking forward to seeing your links or comments.


[Tchncs] 

[c/ocaml] 


awa-ssh release 0.3
═══

  Archive: 


Hannes Mehnert announced


  I’m pleased to announce the release 0.3.0 of [awa-ssh]. This is a pure
  implementation of the SSH protocol in OCaml. It started out as a
  server implementation by @haesbaert, and was then further developed by
  @hannes (client), Pierre Alain (sshfs), @reynir, @dinosaure

  These days, it is both a server and a client implementation, and is
  used in [ocaml-git] to fetch git repositories from ssh remotes.

  The initial release is a few years back (see
  ), the
  code is even older ;)

  The highlights since the initial release include:
  • support RSA-SHA2 signature algorithms (October 2021)
  • support ED25519 (October 2021)
  • SSH server subsystem in MirageOS (January 2022)
  • ECDSA support of NIST curves (March 2023)
  • client: password authentication (previously, only key authentication
was supported) (March 2023)
  • add Pty/Set_env/Start_shell events (March 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-06-20 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of June 13 to 20,
2023.

Table of Contents
─

Packaging an executable for homebrew install for non-OCaml users
v0.16 release of Jane Street packages
New release of Menhir (20230608)
Dream-html - DSL to build HTML, integrated with Dream
release of minisat 0.5
Which filters would you like to see on the OCaml blog at OCaml.org?
OCaml Platform Newsletter, May 2023
Congratulation to the OCaml team for the 2023 SIGPLAN programming languages 
software award! 
Other OCaml News
Old CWN


Packaging an executable for homebrew install for non-OCaml users


  Archive:
  



James Geddes asked
──

  Would anyone have an example I could look at of a homebrew “formula”
  for an OCaml program? I’m looking to distribute an executable to
  colleagues who are not OCaml users.

  (There seem to be lots of moving parts and I’m not sure which one has
  stopped moving!).

  Many thanks.


Roland Csaszar replied
──

  All official Homebrew formulas are located in this GitHub repo:
  

  The interesting part is `install'.


Examples using `make':
╌╌

  Dune:
  


  Opam:
  



Examples using `dune':
╌╌

  Coq:
  


  Menhir:
  



Examples using Opam and something else:
╌╌╌

  Semgrep (Opam & Python):
  



Reference
╌

  Homebrew’s Formula reference: 


v0.16 release of Jane Street packages
═

  Archive:
  



Diana Kalinichenko announced


  Dear OCaml developers,

  We are pleased to announce the v0.16 release of Jane Street packages!

  This release comes with 34 new packages and a plethora of new
  features, fixes, and enhancements.

  The remainder of this post highlights the main changes since the v0.15
  release.


Release-wide changes


◊ Switch to OCaml 4.14

  We are switching Base and all our packages, except sexplib0, to OCaml
  4.14 and above.

  Previously, Base supported the four latest OCaml versions. The prime
  reason for it was to ensure that a single ppxlib release would work
  across multiple compilers. However, ppxlib now depends solely on
  sexplib0, not Base.

  Meanwhile, we are making a considerable effort to integrate the latest
  OCaml features. We’ve already added features like the `In_channel'
  module from the 4.14 standard library to Base, and we’re working on
  switching to the 5.0 compiler internally.

  As a result, we decided to remove the strict requirement for Base’s
  backward compatibility. Instead, we hope to provide a more
  comprehensive Stdlib replacement and better testing for recent
  compiler versions. We plan to eventually add support for OCaml 5
  primitives in Base, starting with releases v0.17 or v0.18.


◊ 32-bit platform support

  As stated [previously], we are no longer testing on 32-bit platforms.
  That said, we expect that our packages will mostly continue to
  function on 32-bit, and we strive to maintain compatibility. In
  particular, we will keep responding to bug reports and accepting
  32-bit compatibility patches. We’re also hoping that Tarides’ work in
  this area will improve the testing of our packages across many
  platforms, including 32-bit bytecode.


  [previously]
  



◊ Deprecation of `Caml' in favor of `Stdlib'

  We are deprecating our `Caml' alias for the OCaml standard library, in
  favor of using the default module, `Stdlib'. This allows writing code
  that references the standard library regardless of whether Base is
  opened or not.


◊ Local allocations

  We’ve included annotations for local allocations in our public release
  code; however, these annotations are not recognized by the stock OCaml
  compiler. More information on local allocations can be found in our
  blog post at .

  For those interested in experimenting with local allocations, our
  OCaml fork with local 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-06-13 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of June 06 to 13,
2023.

Table of Contents
─

release of minisat 0.5
containers 3.12
Recent tar releases (2.5.0, 2.4.0, …)
mpp.0.3.6, which adds compatibility with OCaml 5, is now in opam
trace 0.1, tracy-client 0.1
A short review of fmlib_browser (web frontend library)
moonpool 0.1
Other OCaml News
Old CWN


release of minisat 0.5
══

  Archive:
  


Simon Cruanes announced
───

  [OCaml-minisat] 0.5 just landed on opam.

  This library has bindings to the classic [minisat] SAT solver. It
  should have decently low overhead (no ctypes, runtime lock released,
  etc.) and be useful for general purpose SAT solving. Minisat is not
  really state of the art anymore, but it’s still pretty damn good for a
  lot of use cases.


[OCaml-minisat] 

[minisat] 


Darius asked and Simon Cruanes replied
──

Just out of interest, what is the state of the art, and
what are these use cases?

  State of the art is, roughly, [Cadical] and [Kissa] (yes, both are
  from Armin Biere). They’re better on hard SAT instances, the ones that
  still take a while to solve.

  These minisat bindings could be updated at least to Glucose (a known
  patch to minisat with better heuristics), maybe I’ll do that at some
  point.

  The use cases: anything where you want to solve a NP-complete problem
  (register allocation for example; sudoku solving; also a lot of
  verification problems can benefit from a SAT encoding somewhere).
  Using an API instead of calling a process is useful because you can
  access more things and perform incremental solving easily: instead of
  solving a single SAT problem, you can solve a series of increasingly
  big problems without starting from scratch each time.


[Cadical] 

[Kissa] 


containers 3.12
═══

  Archive: 


Simon Cruanes announced
───

  I’m happy to announce the release of [containers 3.12].

  Containers is a lightweight and modular extension of the standard
  library. It enriches existing modules and adds a few that are missing.

  In this release, the highlights are:
  • more functions in `Set' and `Array'
  • a new `containers.pp' sublibrary, with Wadler-style pretty printing
combinators
  • improvements to the parser combinators (`CCParse')
  • a whole bucket of bugfixes


[containers 3.12]



Recent tar releases (2.5.0, 2.4.0, …)
═

  Archive:
  


Reynir Björnsson announced
──

  I’m pleased to announce the release of tar.2.5.0 earlier this week.

  This release and the previous release improves PAX support, mirage
  key-value write support and bug fixes:

  • in 2.4.0 the pax global header is properly skipped when reading -
previous releases did not skip the header properly which would
result in a corrupt read. In a future release the global header will
be read and used. More on that later.
  • in 2.5.0 the file name and link name are used from per-file pax
headers, if present.
  • in 2.4.0 the ustar version is correctly encoded while writing. This
did not seem to cause any issues with other implementations.
Unfortunately, this is a breaking change, and may break
reproducibility of archives written with prior versions of
ocaml-tar.
  • earlier releases the past year have been focused on adding write
support to the tar-backed mirage key-value store `tar-mirage'.


Future release
╌╌

  I am working on the next release which will support the global PAX
  header. This introduces additional global state in the reader, and
  will be a breaking change. Additionally, old and (mostly) unused
  modules and functions will be removed. If you use any of the bits
  being removed please feel free to chime in and comment on what you’d
  like to see kept. The work in progress can be viewed at:
  


mpp.0.3.6, which adds compatibility with OCaml 5, is now in opam


  Archive:
  



Philippe Wang announced
───

  mpp.0.3.6, which adds compatibility with OCaml 5, is now in opam!

  *MPP is a preprocessor, and also a metapreprocessor.*

  As a preprocessor, it’s quite simple and maybe even minimalistic.

  As a meta preprocessor, it’s very powerful, since it allows you to
  simply use 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-05-30 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of May 23 to 30,
2023.

Table of Contents
─

ML’23: ACM SIGPLAN ML Family Workshop — Call for presentations
OCaml Workshop 2023 – presentation deadline on June 1st, online attendance 
option
A Roadmap for the OCaml Platform - Seeking Your Feedback
new release: tiny_httpd 0.13
Old CWN


ML’23: ACM SIGPLAN ML Family Workshop — Call for presentations
══

  Archive:
  



Guillaume Munch-Maccagnoni announced


  We are happy to invite submissions to the *ML Family Workshop 2023*:


Higher-order, Typed, Inferred, Strict: ACM SIGPLAN ML Family Workshop
╌

  Co-located with [ICFP]

  *Date*: September 8, 2023 (Friday)

  *Location*: Seattle, WA, USA (day after main ICFP)

  [Call for presentations]

  ML (originally, “Meta Language”) is a family of programming languages
  that includes dialects known as Standard ML, OCaml, and F#, among
  others. The development of these languages has inspired a large amount
  of computer science research, both practical and theoretical.

  The ML Family Workshop is an established informal workshop aiming to
  recognize the entire extended ML family and to provide the forum to
  present and discuss common issues: 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 promote the exchange of ideas and experience. The
  ML family workshop will be held in close coordination with the OCaml
  Users and Developers Workshop.

  We plan the workshop to be an in-person event with remote
  participation (streamed live). Speakers are generally expected to
  present in person (we will work to make remote presentations
  possible).

  We solicit proposals for contributed talks, in PDF format, with a
  short summary at the beginning and the indication of the submission
  category: Research Presentations, Experience Reports, Demos, and
  Informed Positions. The point of the submission should be clear from
  its first two pages (PC members are not obligated to read any
  further.) We particularly encourage talks about works in progress,
  presentations of negative results (things that were expected to but
  did not quite work out) and informed positions.

  See the [full call for presentations] for submission instructions.

  • Deadline for talk proposals: *Thursday, June 1, 2023*
  • Notification of acceptance: *Thursday, July 6, 2023*
  • Workshop: *Friday, September 8, 2023*


[ICFP] 

[Call for presentations]


[full call for presentations]



Program Committee
╌

  • Lars Bergstrom, Google, USA
  • Martin Elsman, University of Copenhagen, Denmark
  • Matthew Fluet, Rochester Institute of Technology, USA
  • Jacques Garrigue, Nagoya University, Japan
  • Oleg Kiselyov, Tohoku University, Japan (Chair)
  • Julia Lawall, Inria Paris, France
  • Andrey Mokhov, Jane Street, UK
  • Benoît Montagu, Inria Rennes, France
  • Guillaume Munch-Maccagnoni, Inria Rennes, France
  • Matija Pretnar, University of Ljubljana, Slovenia
  • Andreas Rossberg, Germany
  • Gabriel Scherer, Inria Saclay, France


OCaml Workshop 2023 – presentation deadline on June 1st, online attendance 
option
═

  Archive:
  



gasche announced


  The OCaml Workshop is happening every year, co-located with the ICFP
  conference (the main academic conference on functional programming).
  This year the meeting will happen in Seattle on *Saturday September
  9th*. It should be hybrid: it will be possible to attend and even give
  talks remotely.

  To get a sense of the OCaml Workshop style, topics and content,
  ocaml.org has a page about previous editions, with the list of talks
  and links to the descriptions and talk recordings when available:
  [OCaml Workshops].

  The deadline for submitting a talk proposal is **June 1st**, coming
  soon. Please consider submitting a proposal to present your OCaml work
  at the workshop!

  • [Call for presentations] (description of the expected format, etc.)
  • [Submission website for talk proposals] – please read the “Call for
presentations” first.

  A major change compared to previous editions of the workshop is that
  **online attendance should be free**. (The cost is decided by 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-05-16 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of May 09 to 16,
2023.

Table of Contents
─

Rendering React in OCaml
Ahrefs is Hiring
tmx: Import 2D game maps with ease
Brr 0.0.5, the WebGPU edition
A bestiary of GADT examples?
Open-source tool to make a static blog in OCaml?
BER MetaOCaml N114, for OCaml 4.14.1
Building iOS apps with OCaml?
A Minimal Prototype of In-Package Search is on staging.ocaml.org
New release of Fix (20230505)
QCheck 0.21
Old CWN


Rendering React in OCaml


  Archive:
  


David Sancho announced
──

  Here is `server-reason-react', the OCaml implementation of React I
  have been working on:
  

  The blog post is targeted for a Frontend/JS dev, but I believe it can
  be interesting from the OCaml site as well.

  `server-reason-react' is an implementation of `react-dom/server' and
  some of React’s internals in OCaml. The purpose is to render HTML
  markup from the server for a Reason React application natively.

  


  It supports hydration (renderToString) and full render
  (renderToStaticMarkup) and most unit tests from ReactDOMServer are
  migrated as well. Basically, to ensure hydration “hacks” work the same
  way as react’s DOM (in JavaScript).

  It’s obviously fast, talking about req/s: x10 against Node and x6
  against Bun on the same codebase. Performance is not the priority,
  though. I did 0 perf work but is cool. If you want to help making it
  very fast, let me know!

  The priority is to implement streaming and later RSC. Can’t wait to
  try OCaml multicore with Server components.

  All of this is thanks to Melange, and I’m grateful to work with
  [@_anmonteiro] and [@javierwchavarri].


[@_anmonteiro] 

[@javierwchavarri] 


Ahrefs is Hiring


  Archive: 


benmonopoli announced
─

  As always here at Ahrefs we’re on the lookout for OCaml devs.

  We are headquartered in Singapore but our team is dotted all over the
  place so we’re open to remote too.

  Check out our posting [here]

  Feel free to reach out for more info.


[here] 


Louis Roché then added
──

  To try to give some context as the job post on the website is pretty
  dry

  Ahrefs is heavily invested in Melange to compile ocaml to javascript.
  With it the company is also putting resources to maintain the projects
  related to reasonml. Some recent posts from @jchavarri and @davesnx:
  • 

  A bunch of commonly used libraries that you probably have heard about
  are maintained by ahrefs or with the help of ahrefs
  • 

  There’s more at 

  When not maintaining we try to contribute. One example is [ocaml-lsp]

  We are also sponsoring projects:
  • 

  Conferences:
  • 

  (also the reasonml conferences in the past)

  And last but not least the OCaml Software Foundation
  


[ocaml-lsp] 


tmx: Import 2D game maps with ease
══

  Archive:
  


fishyfriend announced
─

  `tmx' is an OCaml library for reading data files from the 2D game map
  editor [Tiled].

  The library aims for broad coverage of Tiled’s [TMX file formats]. It
  provides an imperative context for loading TMX data files and a
  collection of immutable types corresponding to TMX data structures.

  `tmx' emulates the semantics of TMX data structures as they exist in
  the Tiled desktop application, including proper application of [custom
  property] inheritance and [object templates]. This allows the
  attributes of game resources in OCaml to match exactly what is
  observed in the editor.

  Check out the [project page] for more.


[Tiled] 

[TMX file formats]


[custom property]


[object templates]


[project page] 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-05-09 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of May 02 to 09,
2023.

Table of Contents
─

Overview of libraries for showing OCaml values
kcas and kcas_data 0.3.0: Software Transactional Memory
OCaml.org Newsletter: March 2023
Creating a tutorial on sequences
You started to learn OCaml less than 12 months ago? Please help us with our 
user survey on the OCaml.org Learning Area
Explorations on Package Management in Dune
Functional web applications running in the browser
Ahrefs is now built with Melange
Other OCaml News
Old CWN


Overview of libraries for showing OCaml values
══

  Archive:
  



Anton Bachin said
─

  In light of the [recent thread] on, among other things, showing OCaml
  values, and because of Dream’s [long-standing need] for this to exist
  in OCaml, I’ve done, as [suggested], a comparison of the available
  libraries. They seem to fall into three categories.

  1. Libraries that walk the runtime representation of values and dump
 it.

 These provide a *`'a -> string'* functions that can immediately
 print any value, and are the easiest to use. They are what I need
 in Dream – something that a normal person can use for debugging
 without any boilerplate. The *accuracy* of these libraries is
 *limited* because the type information preserved in the runtime is
 very bare.

 These are:

 1. reason-native’s [*`Console.log'*].
 2. [*Dum*]
 3. [*Inspect*]

 There is also [Memgraph], but this appears to only output DOT
 graphs, so I didn’t look into it in detail.

 Since I am interested in these for my purposes, I wrote a tester
 that compares their outputs, and uploaded it into a [gist]. See the
 outputs for [`Console.log'], [Dum], [Inspect]. They are all
 variants of each other. Each has its own quirks and bugs, but they
 all look roughly like this:

 ┌
 │ > Console.log "abc"
 │ "abc"
 │ > Console.log 42
 │ 42
 │ > Console.log {a = "abc"; b = 42}
 │ {"abc"; 42}
 └

 Interestingly (but predictably), for extensible variants like
 `exn', these dumpers are able to print the string representation of
 variant constructors even with OCaml’s current runtime.

  2. Libraries, such as `ppx_deriving', that have a PPX generate, or the
 user manually provide, information about types – that is, provide
 helper values that describe types, and then ask the user to provide
 that information to walk values and dump them.

 These are unsuitable for my goals. All of these require the user to
 pass in the type information to the printing function at each call
 site, because in the absence of modular implicits or type classes,
 the compiler cannot automatically associate the type information
 with the values. They provide, roughly, *`('a -> string) -> 'a ->
 string'* functions. The user has to provide the `'a -> string' for
 each `'a' each time they would like to print an `'a'.

 If `'a' is a “container” type, the required function is a
 higher-order function that needs additional function(s) for the
 element types. This is *not ergonomic*, as each call site where one
 would like to show a value needs boilerplate. Even if the `'a ->
 string' is precomposed, it requires the user to remember what it is
 called, pick the right one, and is not resistant to various
 refactorings such as wrapping in `option'. But such libraries are
 accurate, because the type information provided in the boilerplate
 can be precise.

 These are:

 1. [*ppx_deriving*]’s `[@@deriving show]'.
 2. [*refl*], a ppx_deriving-like.
 3. [*lrt*], another ppx_deriving-like.
 4. [*tpf*], again a ppx_deriving-like.
 5. [*typerep*], probably a ppx_deriving-like with ppx_typerep_conv.
 6. [*repr*], which appears to have the user build the type
representation manually from combinators and then also pass it
where need it.
 7. [*data-encoding*], also fully manual.
 8. [*cmon*], fully manual.
 9. [*dyn*] in Dune. Appears to also be fully manual.

 I didn’t try these out in detail because they are all unsuitable as
 `Console.log'-alikes for inspecting OCaml values without excessive
 boilerplate. As can be seen from their documentation, they all
 require boilerplate in the form of functions/witnesses/calling the
 right function, depending on the type, at the place where you’d
 like to show a value. The last four also require the user to
 manually build up the type representation using combinators.

 ┌
 │ M.show_myfpclass FP_normal   (* ppx_deriving: know the function. 
*)
 │ 
 │ Refl.show [%refl: (string * int) list] [] ["a", 1; "b", 2];;
 │ 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-05-02 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of April 25 to May
02, 2023.

Table of Contents
─

Lambda Capabilities
My Thoughts on OCaml vs Haskell/Rust in 2023
Interesting OCaml Articles
Dream-html - DSL to build HTML, integrated with Dream
Trying the 7GUIs with LablGTK3/OCaml
Call for new opam-repository maintainers
Old CWN


Lambda Capabilities
═══

  Archive: 


Thomas Leonard announced


  Several people, after reading the [Eio tutorial], have asked for more
  details about what “capabilities” are (and why they should care). I
  couldn’t find an introduction aimed at functional programmers, so I
  had a go at writing my own:

  

  Please let me know if anything is unclear!


[Eio tutorial]



My Thoughts on OCaml vs Haskell/Rust in 2023


  Archive:
  



Sid Kshatriya announced
───

  Recently, osa1’s [My Thoughts on OCaml] generated quite a [robust]
  conversation on Hacker News. Overall I felt the blog post was a bit
  too critical about OCaml. However, everyone has a right to their
  opinions and I respect whatever has been written.

  Except for a couple of points, that post /didn’t/ resonate with me, so
  I thought I should pen down my good/bad experiences with OCaml and see
  if others have felt the same way as me.

  *I’ve written a longish blog post [here]* as sort my reponse! Please
  check it out!

  Your feedback and comments would be useful!

  If people think this is a worthy blog post, I’d like to post my blog
  on Hacker news also :-). If anybody feels enthusiastic about this
  write up do feel free to put it up on Hackernews yourself too!


[My Thoughts on OCaml]


[robust] 

[here]



Tim McGilchrist later said
──

  Another take on the current state of OCaml from
  . There are many points I
  do and don’t agree with from both, but I think it is important to
  reflect on the language and tooling. These fresh takes on things are
  useful to read. Thanks @sid for taking the time to write your version
  up.

  For me personally I would like a version of modular implicits to land
  and to have a typed effect system to go along with my EIO/Multicore. I
  should writeup a longer version given my background with Haskell and
  OCaml.


Interesting OCaml Articles
══

  Archive:
  


NomadicLabs announced
─

  We published a blog post that might be interesting to OCaml devs. When
  working with large codebases such as Tezos Octez, it is important to
  make the code highly readable. Discover “labelled type parameters” - a
  lesser-known OCaml trick used by Nomadic Labs devs to reach this
  objective:
  



Dream-html - DSL to build HTML, integrated with Dream
═

  Archive:
  



Yawar Amin announced


  Hi, I have been working on a ’simple’ OCaml library to generate HTML,
  with close integration with Dream. I am already using it on a [side
  project] and think it’s nearing production level for general use. I
  wanted to give a preview here in case anyone is interested.

  • Repo: 
  • Doc:


  In terms of approach taken, it is closer to [Webs_html] than to TyXML.
  Things that are statically typechecked:

  • ’Standard’ tags have attributes and children
  • Void elements have no children
  • Some tags can contain only a single text node
  • Attributes with boolean, int, or enumerated string values

  All attributes and text nodes support format strings i.e.
  interpolation. So no need to pull in `Printf.sprintf'. HTML comments
  are also supported. HTML escaping is done for almost all text nodes
  and attribute values, leaving aside the ones that aren’t supported by
  Dream’s escaping i.e. JavaScript and CSS content.

  Oh, one more thing. I also added the core htmx attributes since I’m
  using htmx.

  Check out the test file for a slightly larger idiomatic usage:
  


[side project] 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-04-25 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of April 18 to 25,
2023.

Table of Contents
─

Dream development stream + OCaml office hours
New release of Menhir (20230415)
Functional web applications running in the browser
Timmy 1.0.0, a high level time and calendar library
Wed, Apr 19 @ 7pm U.S. Central: Jonah Beckford on “What distributing OCaml on 
Windows gave me (and you)”
The OCaml Changelog
OUPS meetup may 2023
3-year engineering position in Deducteam, Inria Paris-Saclay, France
RFC for a distributed process/actor model library
cfgen preview release v1.0.0-alpha.0
Other OCaml News
Old CWN


Dream development stream + OCaml office hours
═

  Archive:
  



Anton Bachin announced
──

  Chat with me while I develop [Dream], but also ask any questions at
  all about OCaml!

[**]

  I’ll be streaming Dream development on Twitch at 14:00 CEST (Paris
  time) on most weekdays, and definitely on every Thursday. Each time,
  I’ll stream for at least one hour.

  Tomorrow, on Wednesday, April 19th, at 14:00 CEST, I will be
  continuing to review the [Dream Eio PR] by @talex5 and @Willenbrink,
  adding more detail to and revising the [Dream 1.0 roadmap], and
  generally just be available to talk about anything related to OCaml.
  We can build toy projects, demos, work out concepts, etc. If you’d
  like to contribute to Dream, we can discuss good first issues, review
  your PRs, and collabarote otherwise!

  Outside the stream, I can be reached in #webdev on the [OCaml Discord]
  or #dream on the [Reason Discord]. My nickname on both is *antron*.

  In the future, I’d be happy to consider something more interactive
  than a Twitch stream – something where people can talk back, probably
  some sort of developer or contributor meeting. But it seems that
  Twitch is the right place to get started.


[Dream] 

[**] 

[Dream Eio PR] 

[Dream 1.0 roadmap]


[OCaml Discord] 

[Reason Discord] 


Anton Bachin later said
───

  Thanks to everyone for coming to the stream today! We had a pretty
  good viewership! The next stream is tomorrow, Thursday, April 20th, at
  the same time: 14:00 CEST.

  Today, we got the Eio PR building, and found some problems with it –
  fixing those problems offline and during the next stream will be a
  good way to start reviewing the internal changes in detail! We also
  talked about plans for Dream and discussed some of Dream’s
  dependencies and developer tools.

  I post the next stream time and its topic in the banner image of the
  [stream], so you can easily find out when it’s planned even when the
  stream is offline. Planned streams are also in the [schedule]. For
  weekdays besides Thursday, I’ll decide about streaming a few days in
  advance.

  Suggestions for how to make the stream nicer are welcome :) I try to
  maintain a good look for my windows and use some goofy VSCode
  extensions. If we start doing long, boring builds, we can maybe add
  games for viewers to play or even a cat cam, though I think that is a
  stretch at this point :) So far, I’ve been able to do all the very
  slow stuff offline.

  As the stream becomes more of a regular occurrence, I’ll stop posting
  about it here, but I’ll probably continue to announce it in the
  [Reason] and [OCaml Discords], once I figure out what channels are
  appropriate for that. Probably #dream and #webdev, respectively.


[stream] 

[schedule] 

[Reason] 

[OCaml Discords] 


New release of Menhir (20230415)


  Archive:
  


François Pottier announced
──

  It is my pleasure to announce a new release of Menhir, with a number
  of minor improvements.

  The change log appears below. The main point of notice is that (when
  using the code back-end) the default optimization level has been
  changed from `-O 2' to `-O 1'. So, if you need to keep identical
  generated code and performance, you should now explicitly pass `-O 2'
  to Menhir.

  ┌
  │   opam update
  │   opam install menhir.20230415
  └


2023/04/15
╌╌

  • When using the code back-end, the default optimization level is now
`-O 1' instead of `-O 2'. Some users reported that `-O 2' is too
aggressive and can cause a blow-up in the size of the code.

  • Tweak the code for compatibility with OCaml 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-04-18 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of April 11 to 18,
2023.

Table of Contents
─

You started to learn OCaml less than 12 months ago? Please help us with our 
user survey on the OCaml.org Learning Area
First alpha release of OCaml 5.1.0
Interesting OCaml Articles
Porting a OCaml3-based game to the latest version of OCaml
Old CWN


You started to learn OCaml less than 12 months ago? Please help us with our 
user survey on the OCaml.org Learning Area
══

  Archive:
  



Sabine Schmaltz asked
─

  We’re asking specifically for you, if your experience of learning
  OCaml is still ongoing or so recent that you still remember

  1. what you struggled with (or still feel like you’re struggling),
  2. how the current materials failed you,
  3. what other materials helped you understand.

  if you have previous experience in other languages, we also find it
  highly interesting to learn about resources that you found
  particularly effective/engaging/educational and why you think they are
  particularly great.

  Our goal is to improve the “Learn” area of OCaml.org - and this is a
  pretty broad topic in the sense that we want to provide a framework on
  OCaml.org where content is organised properly in such a way that
  information is easy to find and effective to use for various people
  with different backgrounds and learning styles.

  The survey is here: 

  If you indicate you’re available for interview, our UX designer Claire
  may contact you to schedule a video call with you.

  There will be a summary of the points brought up no later than May 5
  in this thread.


First alpha release of OCaml 5.1.0
══

  Archive:
  


octachron announced
───

  Four months after the release of OCaml 5.0.0, the set of new features
  for the future version 5.1.0 of OCaml has been frozen. I am thus happy
  to announce the first alpha release for OCaml 5.1.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

  

  If you find any bugs, please report them here:

  

  Note that this early alpha version is missing two important fixes for
  the garbage collector and Windows support. Those fixes will be
  available before the beta. The full release is expected to happen in
  July.

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

  


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.1.0~alpha1
  └

  For previous version of opam, the switch creation command line is
  slightly more verbose:

  ┌
  │ opam update
  │ opam switch create 5.1.0~alpha1
  │ 
--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  ocaml-variants.5.1.0~alpha1+options 

  └

  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.1.0~alpha1+flambda+nffa 
ocaml-variants.5.1.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 
  │ --packages=ocaml-variants.5.1.0~alpha1+options,
  │ 
--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:

  • 


Interesting OCaml Articles
══

  Archive:
  


james woodyatt announced


  Our @yallop is one of the authors of this paper about parsing.

  [flap: A Deterministic Parser with Fused Lexing]

 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-04-11 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of April 04 to 11,
2023.

Table of Contents
─

OCAML’23: The OCaml Users and Developers Workshop
Ldp 0.1.0
Dune 3.7.0
cmarkit 0.1.0 – CommonMark parser and renderer for OCaml
ocamlmark – An ocamldoc to CommonMark bi-directional translation
kcas and kcas_data 0.2.4 for lock-free concurrent programming
Low-hanging fruit for a PR contribution to the OCaml runtime code (C code)
Wed, Apr 12 @ 7pm U.S. Central: Jonah Beckford on “What distributing OCaml on 
Windows gave me (and you)”
zbg: Zero Bullshit Git
Old CWN


OCAML’23: The OCaml Users and Developers Workshop
═

  Archive:
  


Oleg announced
──

  The OCaml Users and Developers Workshop: ACM SIGPLAN Workshop
  September 9, 2023 (Saturday) Seattle, WA, USA and also online (two
  days after main ICFP)

  Call for presentations: 
  Talk proposal submission deadline: Thursday June 1st, 2023

  (Please redistribute widely.)

  The OCaml Users and Developers Workshop brings together the OCaml
  community, including users of OCaml in industry, academia, hobbyists
  and the free software community.

  OCaml 2023 will be co-located with ICFP 2023, which will take place in
  Seattle, US. We aim to organize it as a hybrid event, so that people
  can attend and even give talks remotely: talks will be streamed in
  real-time, and virtual participants will be able to chat and ask
  questions in writing.


Scope
╌

  Presentations and discussions will focus on the OCaml programming
  language and its community. We aim to solicit talks on all aspects
  related to improving the use or development of the language and its
  programming environment, including, for example (but not limited to):

  • compiler developments, new backends, runtime and architectures

  • practical type system improvements, such as (but not limited to)
GADTs, first-class modules, generic programming, or dependent types

  • new library or application releases, and their design rationales

  • tools and infrastructure services, and their enhancements

  • prominent industrial or experimental uses of OCaml, or deployments
in unusual situations.


Presentations
╌

  It will be an informal meeting 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 time.

  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 to present more diverse
  work, and gives time for discussion. The program committee will decide
  which presentations should be delivered as posters or talks.


Submission
╌╌

  To submit a presentation, please register a description of the talk
  (about 2 pages long) at

  

  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.


Important dates
╌╌╌

  • Thursday 1st June (any time zone): Abstract submission deadline
  • Thursday 6h July: Author notification
  • Saturday 9th September: OCaml Workshop


ML family workshop and post-proceedings
╌╌╌

  The ML family workshop, held on the previous day, deals with general
  issues of the ML-style programming and type systems, focuses on more
  research-oriented work that is less specific to a language in
  particular (OCaml). There is an overlap between the two workshops, and
  we have occasionally transferred presentations from one to the other
  in the past. The authors who feel their submission fits both workshops
  are encouraged to mention it at submission time and/or contact the
  Program Chairs.


Program Committee
╌

  • Kenichi Asai (Ochanomizu University, Japan)
  • Jonah Beckford (Diskuv Inc, US)
  • Raja Boujbel (OCamlPro, France)
  • Chris Casinghino (Janestreet, US)
  • Nathanaelle Courant (OCamlPro, France)
  • Jacques Garrigue (University of Nagoya, Japan)
  • Kiran Gopinathan (National University of Singapore, Singapore)
  • Oleg Kiselyov (Tohoku University, Japan)
  • Benoit Montagu (INRIA, France)
  • Sudha Parimala (Tarides, India)
  • Matija Pretnar (University of Ljubljana, Slovenia)
  • Jonathan Protzenko (Microsoft Research Redmond, US)
  • Claude Rubinson (University of Arizona, US)
  • Gabriel Scherer (INRIA, France)


Questions 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-04-04 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of March 28 to April
04, 2023.

Table of Contents
─

OCaml-css 0.1.0
Bogue tutorials 0.1.0
Embedded Ocaml Templates 0.8
Available for Hire - Q2+3+4 2023
Format strings and the OCaml compiler error messages
Other OCaml News
Old CWN


OCaml-css 0.1.0
═══

  Archive: 


Zoggy announced
───

  I’m pleased to announce the first release of [OCaml-css], a library to
  parse and print CSS. It can also expand namespaces and perform
  computations on property values.

  Parsing uses [Angstrom] to dynamically choose the parser when
  encountering a property declaration. Not all properties are handled
  yet but the parser can be extended by defining additional properties.
  Some shorthand properties are handled too. Some ~@rule~s are not
  handled by now, they are parsed and returned as strings, with a
  warning in log.

  The `css' package should be available soon in opam.


[OCaml-css] 

[Angstrom] 


Bogue tutorials 0.1.0
═

  Archive:
  


sanette announced
─

  Hi, I’m pleased to announce an ongoing series of tutorials for [Bogue]
  (the Desktop GUI library for OCaml):

  

  So far only three are written:
  • [Hello world]
  • [A simple counter]
  • [Self-modifying layouts]

  More will come when time permits!

  Each tutorial includes code that can either be pasted onto a toplevel,
  or automatically executed (the executables are shipped in the
  `ocaml-tutorials' opam package.

  Feedback appreciated! (hopefully constructive ;) )


[Bogue] 

[Hello world]


[A simple counter]


[Self-modifying layouts]



Embedded Ocaml Templates 0.8


  Archive:
  


Emile Trotignon announced
─

  I am quite happy to announce the release of EML 0.8. EML is a simple
  templating language that lets you generate text with plain OCaml. It
  is analogous to the way you would write PHP pages, but the language
  being Ocaml instead.

  There are two ways of using it, the first one is in a standalone file,
  for instance `resume.eml.tex' :

  ┌
  │ <%# firstname lastname email birthdate phonenumber formations %>
  │ \documentclass[10pt, a4paper, roman, french]{moderncv}
  │ \usepackage{babel}
  │ \firstname{ <%-firstname%> }
  │ \familyname{ <%-lastname%> }
  │ \mobile{<%- phonenumber%>}
  │ \extrainfo{Born <%-birthdate%> }
  │ \email{ <%-email%> }
  │ \begin{document}
  │ \makecvtitle
  │ \section{Formation}
  │  <% List.iteri (fun i (date_start, date_end, diploma, school) ->%>
  │ \cventry{ <%i- i %> <%-date_start%> -- 
<%-date_end%>}{<%-diploma%>}{<%-school%>}{}{}{}
  │  <%) formations ;%>
  │ \end{document}
  └

  There is also support for compiling a whole recursive directory of
  templating files with a single dune rule.

  The other one would be in OCaml code with a PPX :
  ┌
  │ let resume  firstname lastname email birthdate phonenumber formations =
  │   {%eml|
  │ \documentclass[10pt, a4paper, roman, french]{moderncv}
  │ \usepackage{babel}
  │ \firstname{ <%-firstname%> }
  │ \familyname{ <%-lastname%> }
  │ \mobile{<%- phonenumber%>}
  │ \extrainfo{Born <%-birthdate%> }
  │ \email{ <%-email%> }
  │ \begin{document}
  │ \makecvtitle
  │ \section{Formation}
  │  <% List.iteri (fun i (date_start, date_end, diploma, school) ->%>
  │ \cventry{ <%i- i %> <%-date_start%> -- 
<%-date_end%>}{<%-diploma%>}{<%-school%>}{}{}{}
  │  <% ) formations ;%>
  │ \end{document}
  │ |}
  └
  The ppx is also suitable for simple string interpolation.

  A similar templating and homonymous templating engine is present in
  the Dream framework. Dream.EML has a slightly different syntax, mine
  is less geared toward HTML and more suitable for general templating.
  Dream also does not support compiling multiple templates with a single
  dune rule.

  In 0.8, the locations in the PPX are finally correct. This means that
  type errors will show up in their correct place, which is very nice
  (once a small bugfix in merlin is merged (the error message is still
  correct)). I also got rid of a depency on Menhir.

  It is available on opam as the `embedded_ocaml_templates' package, and
  the doc is [here]


[here]



Available for Hire - Q2+3+4 2023

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-03-28 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of March 21 to 28,
2023.

Table of Contents
─

VOCaml: add and remove type annotations in VS Code
new versions of VS Code extensions Alcotest and Expect and Inline tests, now on 
Open VSX too
Docfd: TUI fuzzy document finder 0.2.3
Camomile 2.0.0 is out!
cid 0.1.0 - Content Identifiers in OCaml
Stk 0.1.0 (SDL-based GUI toolkit) and Chamo 4.0
Cyber-hackathon Frama-C + Binsec near Paris
Zanuda – OCaml linter experiment
Old CWN


VOCaml: add and remove type annotations in VS Code
══

  Archive:
  



Lukasz Stafiniak announced
──

  A new version of [VOCaml – 1.1.1] is out ([Marketplace]). Multiline
  types work now, also labeled arguments (and optional without
  defaults), unit value pattern.


[VOCaml – 1.1.1] 

[Marketplace]



new versions of VS Code extensions Alcotest and Expect and Inline tests, now on 
Open VSX too


  Archive:
  



Roland Csaszar announced


  New versions for both extensions that fix a critical bug: until now if
  there had been more than one test runner the tests from all other
  runners had been deleted during test discovery.

  Important feature added to the Expect and Inline extension: on startup
  and `Refresh Tests' now the tests are not run, but only a list of
  tests is generated. This speeds up test discovery significantly (and
  now both extensions work the same).


Alcotest Test Explorer Version 0.6.0


  • [VS Code Marketplace]
  • [Open VSX]
  • [GitHub]


[VS Code Marketplace]


[Open VSX]


[GitHub]


◊ Changelog

  • Make the path to the Dune executable configurable. Can now be either
an absolute path, a path relative to the project root or just
`dune', which is looked up in the local Opam environment or the
`PATH'.
  • Add a message window to ask for a reload if a configuration value
has changed.
  • Update documentation


◊ Bugfixes

  • Do not delete the test groups of all other test runners if there
exists more than one test runner.


Expect and Inline Tests Version 0.5.0
╌

  • [VS Code Marketplace]
  • [Open VSX]
  • [GitHub]


[VS Code Marketplace]


[Open VSX]


[GitHub]


◊ Changelog

  • No need to run all tests at startup or refresh. Use the
`-list-test-names' argument of the inline test runners.
  • New configuration values:
‣ `expectppx.discoverInSources' - Whether to parse source files on
  open and save for tests and update the Test Explorer tree. Should
  be set to `true' if `expectppx.discoverOnStartup' is `false'.
‣ `expectppx.dunePath' - Set an absolute path or a path relative to
  the project root of the Dune executable. Default: `dune' - use the
  one in the local Opam environment or in `PATH'. See [Issue #3].
‣ `expectppx.excludeRunners' - A list of inline test runner names to
  be excluded from test discovery an startup or refresh, e.g.
  because they take too long to finish.
  • Add a message window to ask for a reload if a configuration value
has changed.
  • Disable ANSI color escape sequences in output of test failures.
  • Update the documentation.


  [Issue #3]
  


◊ Bugfixes

  • Fix bug when tests from other test runners are deleted on startup or
refresh having more than one inline test runner. See [Issue #3].


  [Issue #3]
  


◊ Internal Changes

  • Remove ANSI escape sequences from test fixtures.
  • Add yarn target for the Open VSX Registry.


Roland Csaszar later announced
──

  I’ve just released a new version of the Expect testing extension. The
  Expect test result of a failed test now uses VS Code’s diff view. The
  actual result output of the test can be displayed by hovering the
  stanza `let%expect_test'.


Expect and Inline 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-03-21 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of March 14 to 21,
2023.

Table of Contents
─

Js_of_ocaml 5.1
Petrol 1.2.0 release - Postgres Support + User-extensible types
Docfd: TUI fuzzy document finder 0.2.3
OCamlot - Activitypub server written in OCaml
new versions of VS Code extensions Alcotest and Expect and Inline tests, now on 
Open VSX too
Autofonce, a modern runner for GNU Autotests suites
Release of piece_rope 0.9.0
Old CWN


Js_of_ocaml 5.1
═══

  Archive: 


Hhugo announced
───

  I’m pleased to announce the release of js_of_ocaml 5.1. It should soon
  be able available in opam.

  Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes
  it possible to run pure OCaml programs in JavaScript environment like
  browsers and Node.js.

  This release includes many significant changes. Here are some of the
  notable ones:
  • Js_of_ocaml now understands most `es6' features (but `import' and
`export')
  • JavaScript files generated by js_of_ocaml are now UTF-8 encoded.
  • Change the memory representation of OCaml strings to use JS ones.
String still represent sequences of bytes and only contains
codepoints in the range `[0-255]'.
  • Improved support for OCaml 5 effects, performing partial CPS
transformation to significantly improve perfs (see
)
  • Various improvements to make the compiler faster.
  • Separate compilation only link compilation units that are needed,
similar to `ocamlc', and generate much smaller js files

  See the [Changelog] for other changes.


[Changelog]



Petrol 1.2.0 release - Postgres Support + User-extensible types
═══

  Archive:
  



Kiran Gopinathan announced
──

  I’m pleased to announce the latest release of Petrol - [A high level
  typed SQL API for OCaml] (in the process of being published to opam).

  This latest release is exciting as it now adds Postgresql support
  (previously Petrol only supported Sqlite3).

  Petrol makes using SQL from OCaml a breeze:
  ┌
  │ open Petrol
  │ open Petrol.Sqlite3
  │ 
  │ (* define a new schema *)
  │ let schema = StaticSchema.init ()
  │ 
  │ (* declare a table *)
  │ let example_table, Expr.[name; age] =
  │ StaticSchema.declare_table schema ~name:"example"
  │ Schema.[
  │ field "name" ~ty:Type.text;
  │ field "age" ~ty:Type.int
  │ ]
  └
  and here’s how you write queries:
  ┌
  │ (* create a query *)
  │ let insert_person ~name:n ~age:a db =
  │ Query.insert ~table:example_table
  │ ~values:Expr.[
  │ name := s n;
  │ age := i a
  │  ]
  │ |> Request.make_zero
  │ |> Petrol.exec db
  └
  Petrol compiles down to Caqti queries under the hood, and comes with a
  nifty migration system built-in, so you can seamlesly update your
  database tables without disrupting end users:
  ┌
  │ (* declare a table with a migration for a new [age] column in version 1.2.0 
*)
  │ let t, Expr.[id;age;url] =
  │VersionedSchema.declare_table db ~name:"person"
  │  Schema.[
  │field ~constraints:[primary_key ~name:"bookmark_id" ()] "id" 
~ty:Type.int;
  │field "age" ~ty:Type.int;
  │field "url" ~ty:Type.text;
  │  ]
  │  ~migrations:[v_1_2_0, [
  │Caqti_request.Infix.(Caqti_type.unit ->. Caqti_type.unit)
  │  {sql|ALTER TABLE person ADD COLUMN age INTEGER DEFAULT 1000|sql}
  │  ]]
  └

  This and more is explained in the documentation, along with a nifty
  quick-starter guide:
  

  I’ve spent some time tuning the documentation to make it easy to pick
  up!

  You may also want to check out the tests to see it in action:
  

  Previous discussion:
  



[A high level typed SQL API for OCaml]



Docfd: TUI fuzzy document finder 0.2.3
══

  Archive:
  



Darren announced


  I’m happy to share Docfd, an interactive TUI tool finding the text
  file you need quickly.

  • [Repo]
  • [Statically linked binary]

  (Will submit to opam when time frees up a bit.)


[Repo] 

[Statically linked binary]


Screenshots and interface
╌

  Searching 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-03-14 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of March 07 to 14,
2023.

Table of Contents
─

My experience contributing to the LLVM bindings
Which binding should i use for sqlite , for mariadb and for postgresql
Monday, 6th March - Outreachy Intern Presentation (Dec ’22 Round)
First release of ppx_subliner, a ppx deriver and rewriter for Cmldliner 
sub-command
Cross-compiling for Embedded arm32 Target (RP2040 / Cortex-M0+)
VOCaml: add and remove type annotations in VS Code
Sunsetting opam-repository-mingw
Outreachy Summer 2023
VS Code extension Alcotest Test Explorer 0.4.0
Old CWN


My experience contributing to the LLVM bindings
═══

  Archive:
  



alan announced
──

  Over the past few months, I’ve been contributing patches to the LLVM
  bindings. In particular, I ported the bindings to OCaml 5, which
  involved removing naked pointers. I wrote about what I learned [here].


[here] 


Which binding should i use for sqlite , for mariadb and for postgresql
══

  Archive:
  



Alain De Vos asked and Nicolas Ojeda Bar replied


Which binding should i use for sqlite , for mariadb & for
postgresql ?

  At LexiFi we have used 
  for PostgreSQL and  for
  SQLite for a long time and found them solid.


Kim Nguyễn also replied
───

  If you are looking for a unified API, there is [Caqti]. It uses the
  lower level bindings mentioned by @nojb (and also supports MariaDB
  using [mariadb-ocaml]. It feels like the “jdbc for OCaml” but with
  much more!

  It provides three high-level API, either a standard blocking
  interface, or asynchronous with Lwt or asynchronous with Janestreet’s
  Async).


[Caqti] 

[mariadb-ocaml] 


Frédéric Loyer then added
─

  Caqti is nice and can be completed nicely with ppx_rapper which
  transforms a commented SQL string into a typed wrapper.

  See 


Monday, 6th March - Outreachy Intern Presentation (Dec ’22 Round)
═

  Archive:
  



Patrick Ferris announced


  The presentation is now online:
  

  Thank you @Prisca for the talk and everybody for joining live. We took
  this opportunity to reupload everything to the OCaml Outreachy channel
  under the `bactrian' user:
  


Anil Madhavapeddy asked and Prisca replied
──

Your slides look great, with lots of nice OCaml/TopoJSON
code fragments; might you consider making them available
online somewhere? Making yourself a homepage, or using
something like Speakerdeck are both good options.

  @avsm Thank you very much for the kind words. I just did. This is the
  link 

I noticed you published a release of the library to opam –
you should add yourself to the authors list in
`dune-project', so that you are credited in [the
documentation page for TopoJSON ].

  Thank you for pointing that out as well. @patrickferris and I will
  correct it.


[the documentation page for TopoJSON ]



First release of ppx_subliner, a ppx deriver and rewriter for Cmldliner 
sub-command
═══

  Archive:
  



Boning announced


  I am very pleased to announce the first release of [`ppx_subliner']!
  The package is now available through [OPAM].

  I am always a big fan of [`ppx_deriving_cmdliner']. It helps you
  construct `Cmdliner.Term.t' from record types and makes writing cli
  parsing intuitive and painless. But it lacks the ability to generate
  values for sub-command groups and the final `Cmdliner' evaluations.
  Therefore, `ppx_subliner' comes to life.

  `ppx_subliner' can work with `ppx_deriving_cmdliner' to generate
  sub-command groups. You can do so by simply tagging the extension to a
  variant type.

  ┌
  │ type foo = { my_arg : string } [@@deriving cmdliner]

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-03-07 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of February 28 to
March 07, 2023.

Table of Contents
─

Watch.ocaml.org: out of beta, and a call for new videos
Companies using OCaml–staffing/recruitment/training?
Dune 3.7.0’s native support for watch mode on Windows (blog post)
Introduction to Eio (video)
MirageOS retreat in Marrakech May 1st - 7th
Liquidsoap 2.1.4 and rolling release 2.2.x are out!
Users of opam-repo: what sort of change tracking would you like?
VS Code Expect and Inline Tests extension
`ppx_minidebug' automates the printf in printf-style debugging
VS Code testing extension for Alcotest and inline Alcotest PPX 0.1.0 - initial 
release
Old CWN


Watch.ocaml.org: out of beta, and a call for new videos
═══

  Archive:
  



Anil Madhavapeddy announced
───

  The ** video site is now promoted to a
  production quality ocaml.org site, as [discussed] at the start of the
  year (doesn’t that seem like a long time ago?) For those interested,
  this means that the software stack is now part of the
  deploy.ci.ocaml.org pipeline (see [ocaml/infrastructure#23] and the
  [infra@ocaml blogpost].)

  Now that this is done, it’s a good time to put a call out to any other
  interested OCaml meetups, workshops or conferences that also want to
  host OCaml related content. See the [watch/about] page for more
  information about how that works. If you do have a stream of videos
  (historical, or recent, both are good), then we can mirror it there or
  host it directly. As a reminder, anyone on a ActivityPub-compliant
  service (such as Mastodon) can follow channels hosted on the service
  and leave comments.

  Thanks to @mtelvers @patricoferris @cuihtlauac @sabine for loads of
  ocaml.org updates as well to make this possible! That was lots of
  work, but  now links to the site and each
  workshop page should be up-to-date back to 2012.


[discussed]


[ocaml/infrastructure#23]


[infra@ocaml blogpost]


[watch/about] 


Companies using OCaml–staffing/recruitment/training?


  Archive:
  



Yawar Amin asked and Nicolas Ojeda Bar replied
──

I am curious about something. There are many companies
using OCaml, some of them very successful and famous.
Others more obscure. They all obviously have one thing in
common–they need to employ developers to maintain their
OCaml codebase.

  I can tell you a little bit from my experience at LexiFi. (This is
  strictly my personal opinion, and in no way it should be understood as
  an official statement of any kind.)

My question is, how have they been finding developers for
a niche language?

  Most programmers hired at LexiFi already know some (or a lot) of
  OCaml. Often, they have a two-year Master program in CS (called “M2”
  in France) or an Engineering degree under their belt, where they learn
  OCaml, but this is not a requirement. Typically, we advertise the
  position in the usual places, and candidates send in their
  applications. A few remarks:

  • For the last couple of years, hiring was noticeably tight. My
feeling is that this was in large part due to certain
blockchain-backed companies in France siphoning a disproportionally
large number of OCaml programmers off the market. I say “was”
because since the recent bitcoin downturn, we have seen a noticeable
increase in the number of good candidates, and hiring has loosened
up again.
  • We are a small team, so don’t need to hire more than one or two
people at a time. I am not sure what the situation would look like
if we wished to hire tens of programmers at one time.

  Also, our experience may be a bit particular because we are based in
  France, where (I guess) the supply of OCaml programmers is higher than
  average.

I’ve heard that Jane Street has developed a 2-week crash
course and many internal tools, idioms, and best
practices.

  We haven’t had to onboard many programmers who did not know OCaml
  before, so we don’t have a dedicated training program. We try to
  document workflows, but the truth is that a lot of the institutional
  knowledge about the code is not written down anywhere, and new hires
  learn it by talking to people around them. This probably works as long
  as your team is relatively small, but will not scale 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-02-28 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of February 21 to 28,
2023.

Table of Contents
─

Looking for Ideas for the Package Overview Page on OCaml.org
Vote in this topic: OCaml.org package latest version permalink URL
omake-0.10.6
VS Code testing extension for Alcotest and inline Alcotest PPX 0.1.0 - initial 
release
Containers is 10 years old!
Outreachy Summer 2023
Old CWN


Looking for Ideas for the Package Overview Page on OCaml.org


  Archive:
  



Continuing this thread, Sabine Schmaltz summarized
──

  Ok, so that was quite a bit to digest. Here’s a summary:


1- Debate about package quality metrics
╌╌╌

  Having “last published” and publication date in general displayed on
  the page might interfere with the visibility of stable packages that
  do not need improvement.

  Ideas for other metrics:

  • (manual) self-assessment of package author. (Code quality,
performance, maintainability, evolution, version >= 1.0.0 etc.)
  • (manual) Maintenance-related tagging: signal the need for additional
maintainers, signal that a package needs maintenance
  • (automated) Signal broken packages.
  • (automated) Metrics from external sourecs: e.g. GitHub Number of
issues / pull requests / star count
• Contrapoint: supporting all options, including popular open source
  self-hosted optionsis a huge work item, and choosing just a few is
  inherently unfair
  • (automated) Weekly download statistics


2- Debate about displaying or not displaying README / opam description / 
index.mld on package overview:
╌╌╌

  • Since README is publicly displayed on GitHub/GitLab etc, many people
currently use it as a “public landing page” of the package.
• Essentially, these other services encourage writing README in a
  certain way - in order to establish proper context within that
  other service
  • Challenge: Ideally, package authors should not have to repeat the
same info in several places.
  • Aspects to consider wrt README:
• different renderers on different sites (e.g. GitLab, GitHub,
  SourceHut, Pygments, etc.) support different markdown features
• Nowadays more and more READMEs contain images or even videos, as
  well as tons of badges
  • Ideas:
• Show a collapsible README on package overview
• Instead of rendering README on package overview: add a link to the
  README (but where to, to the hosted repository or to ocaml.org’s
  rendition of README?)
  • Index.mld and other .mld files could be displayed instead of README.
Additionally, links for API documentation and tutorials
• Note: if you don’t specify an `opam' `synopsis' and/or
  `description' yourself, `dune-release' derives those from your
  README as described in
  
.
  However, when you want to link somewhere from within the
  `$(DESCRIPTION)' block, that will not work at the same time on
  GitHub as well as in other documentation contexts (e.g.
  locally-built offline documentation vs ocaml.org vs GitHub).


3- Playground functionality
╌╌╌

  • “Tested examples”, i.e. ability to write code sections in the
package docs that will be executed as tests during the documentation
build - helps package users assess whether the documentation is up
to date and makes it easier for package authors to update the docs
when functionality changed
  • Ability to run code examples from packages in the playground
  • “Runnable examples” like  - ability to
write code sections in the docs that will (1) run as tests during
the package documentation build step, and (2) render as an
“inline-playground” within the surrounding documentation page


4- Other Feedback/Ideas
╌╌╌

  • Allow URLs like

`[[https://ocaml.org/p/%7BPACKAGE%7D.%7BVERSION][https://ocaml.org/p/{PACKAGE}.{VERSION]]}'
  • On package version dropdown - Add published date for each version
  • Security advisories / report package vulnerability
  • It would be nice to have badges for your package to display on the
README so that the package repository looks attractive on the
version control website where it is hosted
  • Package overview should show all the `findlib' library names
  • Dependencies, Reverse Dependencies and Conflicts need more space, as
they can be quite narrow and tall


5- Package overview pages inspiration
╌

  • 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-02-21 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of February 14 to 21,
2023.

Table of Contents
─

Looking for Ideas for the Package Overview Page on OCaml.org
prr, a fork of brr for non-browser JavaScript environments
ICFP 2023 Artifact Evaluation Committee: call for nominations
New Owl book: Architecture of Advanced Numerical Analysis Systems
Improvement on the PPX ecosystem documentation
The color associated with OCaml on Github is bad. Let’s make it good
Paul Biggar on Darklang
Major updates to kcas in 0.1.8 and 0.2.0
OUPS meetup march 2023
Dune 3.7.0
Old CWN


Looking for Ideas for the Package Overview Page on OCaml.org


  Archive:
  



Sabine Schmaltz asked
─

  We are looking into improving the “Overview/Description” page of a
  package. Since this is basically the “landing page” of the package, it
  needs to both look great and include the most relevant info. We want
  you to be able to estimate at a glance whether the package is one that
  you might want to use, and to find the most important landmarks (e.g.
  CHANGES.md, LICENSE.md, Documentation, package homepage) of the
  package easily.

  Share your thoughts about it!

  • What would be useful to see appearing on the page overview page?
  • We’re also very interested in your favorite package overview pages
from other languages. Please do share screenshots of package
overview pages that you really like to use in this thread. We are
compiling a moodboard in order to systematically analyze how to best
arrange the content that we have and to be inspired on what looks
great while being usable at the same time.

  Your opinions matter and your feedback is used to improve our work.

  /Editor’s note: there were many replies, please follow the archive
  link above to read them./


prr, a fork of brr for non-browser JavaScript environments
══

  Archive:
  



Haochen Kotoi-Xie announced
───

  I’m please to announce the first release of the [prr] library:
  [prr.0.1.1].

  Prr is a fork and a stripped-down version of the widely used
  JavaScript FFI library [brr], which is originally built by @dbuenzli.

  There are two major differences between brr and prr:

  1. prr uses dune as its build system. This allows easier vendoring
 through dune’s [vendoring support].
  2. prr includes only non-browser specific components of brr, so that
 it could be safely used in JavaScript environments like those of
 Node.js and React Native projects, in addition to targeting web.
 (In fact this is our motivation to fork brr in the first place.)
 • prr’s [README] gives an overview of what is included and what is
   not.

  No need to say that we are basically freeloading @dbuenzli and brr
  contributors’ efforts in building such a wonderful FFI library so
  special thanks to the contributors of brr.

  [We] will be actively maintain compatibility between prr and brr and
  closely follow the developments of brr.

  To install, simple run `opam install prr', list `prr' as a dependency
  of your project, and `open Prr'. Code that previously depends on `brr'
  should work without modification if no access to browser specific APIs
  is used.

  Comments and suggestions are mostly welcomed.


[prr] 

[prr.0.1.1] 

[brr] 

[vendoring support]


[README] 

[We] 


ICFP 2023 Artifact Evaluation Committee: call for nominations
═

  Archive:
  



Quentin Stiévenart announced


  We are looking for motivated people to be members of the ICFP 2023
  Artifact Evaluation Committee (AEC). Students, researchers and people
  from the industry or the free software community are all welcome. The
  artifact evaluation process aims to improve the quality and
  reproducibility of research artifacts for ICFP papers. In case you
  want to nominate someone else (students, colleagues, etc.), please
  send them the nomination form.

  Nomination form: 

  For more information, see the AEC webpage:


  The primary responsibility of committee members is to review the
  artifacts submitted corresponding to the already conditionally
  accepted 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-02-14 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of February 07 to 14,
2023.

Table of Contents
─

Could merlin be compiled with js_of_ocaml and work in the browser
Opine 0.1.0 - Python source code transformations in OCaml
Paul Biggar on Darklang
Seppo.Social v0.1 and Request for Comments
List your open OCaml positions on the OCaml.org job board
Available for Hire - Q1 2023
Timedesc 1.0.0 - modern date time handling
Major updates to kcas in 0.1.8 and 0.2.0
Old CWN


Could merlin be compiled with js_of_ocaml and work in the browser
═

  Archive:
  



Haochen Kotoi-Xie asked
───

  As the title asks: could merlin be compiled with js_of_ocaml and work
  in the browser? Has anyone attempted it?

  Background: we’d like to make a real web only editor for simple ocaml
  projects. The features we are looking to provide with merlin is
  acurate type aware completion and display of module signatures.


Patrick Ferris replied
──

  Yes! See the great work here: 
  with an example . I’ve used it
  with  too.


Patrick Ferris then said


  Thank you, glad you like it! We’ve ended up where we are thanks to
  various bits of hacking from @tmattio, @jonludlam, @voodoos (and I’m
  sure others!) and of course the jsoo contributors. This is how the
  OCaml.org playground works (although I think it lost merlin.js in the
  switch to OCaml 5).

  Another nice feature (thanks to @jonludlam!) that might not be
  immediately apparent is that all of the OCaml evaluation is happening
  in a browser *worker* meaning it never blocks the UI (the adventurous
  can try `while true do () done' ^^), which has nice story if we
  compiled notebook style exercises to the browser or something like
  that.


Later on, Louis Gesbert said


  Not exactly what you are asking for, but [learn-ocaml] does _that
  kind_ of stuff, taking user-supplied ml code, applying some custom
  validations to its AST, then compiling and running it against a
  pre-defined solution. This and its sibling [try-ocaml] have had
  evaluation in a worker for a long time too — you can’t really ask
  students to reload the page after an accidental infinite recursion.

  They lack the merlin integration though :slight_smile:


[learn-ocaml] 

[try-ocaml] 


Opine 0.1.0 - Python source code transformations in OCaml
═

  Archive:
  



Arul announced
──

  [pyre-ast] is an OCaml library that provides python AST representation
  in OCaml.

  I had a need to do python source code transformations in OCaml. So, I
  made [Opine] to do transformations on the AST and convert it back to
  python. So, in OCaml, you can write python code now, if you ever need
  to.

  P.S. It still doesn’t support the entire python syntax 100%. I haven’t
  added support for things like for-comprehension but it should be
  fairly easy to add it. I plan to add support for the missing ones as I
  need it for my projects.


[pyre-ast] 

[Opine] 


Paul Biggar on Darklang
═══

  Archive: 


Claude Jager-Rubinson announced
───

  You may remember Paul Biggar’s series of blog posts on the process and
  decision to rewrite his Dark programming language in F#, which was
  originally written in OCaml:

  • [https://blog.darklang.com/leaving-ocaml/]
  • [https://blog.darklang.com/why-dark-didnt-choose-rust/]
  • [https://blog.darklang.com/new-backend-fsharp/]

  Paul will be speaking about Dark at next week’s meeting of the Houston
  Functional Programming Users’ Group. Although he’s not planning to
  specifically focus on the OCaml -> F# rewrite; I’m certainly planning
  to ask him about the experience, costs and benefits, etc. :wink: If
  you’re in the Houston area, please join us in person at Improving.
  Everybody else can join us online, via Zoom. Complete details and
  connection info are available on our website at [https://hfpug.org].


[https://blog.darklang.com/leaving-ocaml/]


[https://blog.darklang.com/why-dark-didnt-choose-rust/]


[https://blog.darklang.com/new-backend-fsharp/]


[https://hfpug.org] 


Seppo.Social v0.1 and 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-02-07 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 31 to
February 07, 2023.

Table of Contents
─

Tezt 3.0.0, now JS-compatible and in its own repository
Shuttle 0.9.1 released
Outreachy Summer 2023
Usability improvements in the OCaml compiler codebase
Learning to write PPX extenders: some links
Stramon 0.3.0 - Process behavior monitoring utility based on strace
Old CWN


Tezt 3.0.0, now JS-compatible and in its own repository
═══

  Archive:
  



rbardou announced
─

  It is my pleasure to announce the release of version 3.0.0 of Tezt, a
  test framework for OCaml which is well suited for unit, integration
  and regression tests in particular.

  Tezt now lives in [its own repository] (it used to be part of
  [Octez]). This should make documentation easier to find, bugs easier
  to report and features easier to suggest. It also makes it faster to
  download and install.

  The main highlights of this major release are:
  • JavaScript compatibility: the library has been split into a
Unix-only part (`tezt'), a new JavaScript-only part (`tezt.js'), and
a common part (`tezt.core');
  • output files for regression tests are now located next to their test
by default, in an `expected' subdirectory, which in particular makes
it easier to split tests across a codebase;
  • one can now resume from a previous run to avoid running tests that
had succeeded.

  See the [changelog] for the full list of changes, and the [API
  Documentation] for more details.

  You can install Tezt with opam:
  ┌
  │ opam install tezt
  └


[its own repository] 

[Octez] 

[changelog]


[API Documentation]



Shuttle 0.9.1 released
══

  Archive:
  


Anurag Soni announced
─

  I’d like to announce a new point release (0.9.1) for `shuttle' and its
  companion libraries. They are available to install via opam:

  ┌
  │ opam install shuttle shuttle_ssl shuttle_http
  └

  The code is hosted on [github], and the documentation can be seen
  online on [ocaml’s package registry].

  *Shuttle* is a small library that is a wrapper around file descriptors
  that provides an API for buffered channels using [async].

  *Shuttle_ssl* provides ssl support for `shuttle' and is built on top
   of `async_ssl' (async bindings for OpenSSL).

  *Shuttle_http* is a library that implements to help write HTTP/1.1
   servers and clients.

  Shuttle_http is the library that has seen the most changes in this
  release:

  • Improved streaming response body handling. The library will reliably
schedule a cleanup action that will run if the underlying socket is
closed before the entire response body was consumed.
  • Support for one-shot HTTP/1.1 clients. These don’t support
keep-alives and the underlying socket will be closed after one
request -> response cycle.
  • Support for HTTP/1.1 clients that support keep-alives. Client
connection will be kept open if both client and server indicate that
the connection supports keep-alive. This allows the same connection
to be re-used for multiple request -> response cycles. The
connection object ensures that outgoing requests are serialized to
respect that HTTP/1.1 doesn’t support multiplexing.
  • Support for persistent HTTP clients. Not to be confused with `HTTP
persistent connection'. Persistent in this case refers to durable
clients that will always hand the user an open connection, and
attempts to reconnect if the underlying connection is lost. This
leverages Async’s persistent module to provide an HTTP flavored
persistent connection.


[github] 

[ocaml’s package registry]


[async] 

Uses and examples
╌

  *A hello world http server*

  ┌
  │ open! Core
  │ open Async
  │ open Shuttle_http
  │ 
  │ let hello_world (address : Socket.Address.Inet.t) (request : Request.t) =
  │   Log.Global.info !"%{sexp: Socket.Address.Inet.t} - %s" address 
(Request.path request);
  │   return (Response.create ~body:(Body.string "Hello World") `Ok)
  │ ;;
  └

  *An example of a http handler that responds with a streaming body*

  ┌
  │ open! Core
  │ open Async
  │ open Shuttle_http
  │ 
  │ let my_service (address : Socket.Address.Inet.t) (request : Request.t) =
  │   let%map reader =
  │ (* This an example to show a stream that works with an external 
resource. *)
  │ 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-01-30 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 24 to 31,
2023.

Table of Contents
─

Stramon 0.2.2 - Process behavior monitoring utility based on strace
Diskuv OCaml 1.2.0 (Windows, MSVC)
Simple installation of packages without network
Old CWN


Stramon 0.2.2 - Process behavior monitoring utility based on strace
═══

  Archive:
  



Darren announced


  I’m happy to announce [Stramon] (right now mainly distributed as
  statically built binary [here]).

  Stramon is primarily created to make usage of strace and the analysis
  of strace output easier.

  Stramon invokes strace underneath, analyzes the piped output and
  summarizes the findings into a JSON file when the command finishes.

  An example JSON created by running Firefox via Stramon can be seen
  [here]. (Network access section is trimmed.)


[Stramon] 

[here] 

[here]



Diskuv OCaml 1.2.0 (Windows, MSVC)
══

  Archive:
  


jbeckford announced
───

  There is a new release of the Diskuv OCaml installer available for
  Windows users at
  .
  It contains critical changes that were blocking some Windows users
  from completing the install, and some performance improvements thanks
  in large part to @edwin. The release notes have been reproduced
  immediately below. It will be available using `winget install
  Diskuv.OCaml' in a week or so.

  /Upgrading?/ First uninstall the old Diskuv OCaml version using “Add
  or remove programs” in the Control Panel.

  Callout to *VirtualBox* users: You’ll need a workaround for [a not-yet
  backported FMA fix] by doing the following in a PowerShell terminal
  inside VirtualBox _before_ running the installer:
  ┌
  │ mkdir "$env:ProgramData\DiskuvOCaml\conf\"
  │ Set-Content -Path "$env:ProgramData\DiskuvOCaml\conf\ocamlcompiler.sexp" 
-Value "((feature_flag_imprecise_c99_float_ops))"
  └

  Critical changes:
  • Switch from the official MSYS2 `msys2-base' install, plus a set of
MSYS2 Internet updates, to a standalone [msys2-dkml-base] that has
all the MSYS2 packages needed during installation. That removes the
Internet, GPG keys, proxies, etc. as a source of failures during the
MSYS2 sub-installation.
  • Special handling for Scoop package manager on Windows which
comingles a conflicting bash.exe and git.exe in the same directory.
A prior `scoop install git' should no longer present a problem
during installation.
  • Fixed: No longer need to do `opam pin remove ...' to install
`merlin' and `ocaml-lsp'.

  Performance improvements:
  • Plumb the number of cpus to the compiler jobs. [@edwin]
  • Skip over cross-compiling support when no target ABIs specified.
  • Overall shaved ~15 minutes from installation on a 3-CPU machine (80m
instead of 95m), with additional savings if you have more CPUs.
Timings in 

  Open source help wanted:
  • Byte-code only installation. That will be fast and simple and light,
and is likely the best option for students. The existing installer
already ships with a functioning `ocamlrun' and standard library,
and is “component”-based so pieces can be added or removed. No
Visual Studio, no MSYS2, no spending time compiling code during
installation. However a shim would need to be developed so that
`ocaml', `ocamlc', `utop', etc. work without setting required OCaml
environment variables. Almost all of this new byte-code only
installation can be developed on macOS or Linux. If you would like
to contribute post your github username on


  Component upgrades:
  • Bump utop from `2.9.0' to `2.10.0'.
  • ocurrent ocaml/opam CI Docker image (a source of pins) updated from
2022-02-28 to 2022-11-22; numerous pins updated.

  Bug fixes:
  • `dkml-runtime-common-native' works with spaces in the Windows home
directory
  • Removed incorrect `ptime.0.8.6' pin during `dkml init'; now
`ptime.1.1.0'

  Doc fixes:
  • Create `dune-project' in Beyond Basics documentation alongside
existing `dune init exe' to adhere to Dune 3.x behavior. (Dune 3.6
was added in DKML 1.1.0)

  Deprecations:
  • The `dkml --build-type' build type option will be removed next
release. It was originally created for Linux builds (perf and AFL
variants), and can be resurrected and simplified if and when Linux
support is added.

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-01-24 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 17 to 24,
2023.

Table of Contents
─

The Growth of the OCaml (Binary) Distribution
Ocaml 5.0.0 in Pyre - mostly smooth sailing, Gc.stat regression
Adopting the OCaml Code of Conduct
Esperanto, when OCaml meets Cosmopolitan
Looking for Participants for User Survey on ocaml.org Package Documentation and 
Learn Area
OCaml Software Foundation: January 2023 update
An Emacs mode for Cram tests
Taking a look: some open OCaml Pull Requests
odep initial release
Old CWN


The Growth of the OCaml (Binary) Distribution
═

  Archive:
  



Fabrice Le Fessant announced


  Here is a blog post that I wrote recently, about the increase of the
  size of the OCaml Distribution over the recent years:

  

  Hope it can be interesting to read !


Ocaml 5.0.0 in Pyre - mostly smooth sailing, Gc.stat regression
═══

  Archive:
  



Steven Troxler announced


  Pyre recently [switched our backend build to Ocaml 5.0.0].

  It was a smooth switch for the most part. I know a lot of work went
  into this and we appreciate it!

  We did notice one surprising regression - we had to remove [a call to
  Gc.stat] that we had for telemetry tracking.

  The problem was that when we type-checked our largest Python codebase,
  that call was taking more than 50 seconds (in 4.14, the same call took
  well under 1 second).

  After asking around we’ve learned that:
  • the Gc.stat implementation did change and some regression is
expected
  • we should have been using Gc.quick_stat anyway, which is a change
I’ll make soon

  Nonetheless we thought it might be good to report this in case the
  slowness we experienced comes as a surprise.


[switched our backend build to Ocaml 5.0.0]


[a call to Gc.stat]



Adopting the OCaml Code of Conduct
══

  Archive:
  


Sudha Parimala announced


  Let’s use this thread to track progress of the various projects
  adopting this Code of Conduct. So far, it has been adopted by the
  following projects:

  • [ocaml/ocaml]
  • [ocaml/dune]
  • [ocaml/opam]

  GitHub has a nice icon to indicate it -

  



[ocaml/ocaml] 

[ocaml/dune] 

[ocaml/opam] 


Esperanto, when OCaml meets Cosmopolitan


  Archive:
  



Calascibetta Romain announced
─

  After a long time, Esperanto [was upgraded] with the last version of
  Cosmopolitan which includes `threads.cmxa' now. A PR on `lwt' (to
  support Esperanto) [is pending] but we found [an issue] with `dune'
  when we tried to compile a small program. This paves the way for OCaml
  5 but, in the meantime, most OCaml applications can be compiled with
  this new toolchain (if the C files are not too fancy). A sample
  application is currently available here: [Bob]. You can also see the
  reproducibility of the software [here] ([here] is an article for more
  information).


[was upgraded]


[is pending] 

[an issue] 

[Bob] 

[here]


[here] 


Looking for Participants for User Survey on ocaml.org Package Documentation and 
Learn Area
══

  Archive:
  



Sabine Schmaltz announced
─

  Here’s the promised update on what kind of feedback we got out of the
  user survey. I tried to distill as best as I could, there was so much
  feedback! :)

  We have responses from 20 people in total, and a lot of those have
  volunteered to be interviewed by Claire. So this is excellent! In the
  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-01-17 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 10 to 17,
2023.

Table of Contents
─

Installing Windows OCaml 5.0.0 in opam
Release of Mehari 0.1
Outreachy Summer 2023
Petrol 1.0.0 - A high-level typed SQL API for OCaml designed to go fast!
ocaml-search 0.1.1 - In-memory Search Index for OCaml values
Old CWN


Installing Windows OCaml 5.0.0 in opam
══

  Archive:
  



David Allsopp announced
───

  One of opam 2.2’s headline features is that both “upstream” opam (i.e.
  `opam' built from un-patched sources from [ocaml/opam]) and
  “un-forked” opam-repository (i.e. [ocaml/opam-repository]) finally
  provide native Windows opam switches. We’re aiming to get an alpha
  release of this out in the coming weeks, but I’ve had various requests
  directly for how to use OCaml 5.0 with opam-repository-mingw in the
  meantime, so I’m just sharing this temporary solution, in case it’s of
  use to others.

  I have a demonstration workflow at
   with [setup-ocaml]. It shows
  the commands necessary for local use:
  ┌
  │   - run: opam repo add dra27 
git+https://github.com/dra27/opam-repository#windows-5.0 --all --set-default
  │   - run: opam switch create 5.0 
--packages=ocaml.5.0.0,ocaml-option-mingw
  │   - run: opam exec --switch=5.0 -- ocamlopt -config
  │   - run: opam install --switch=5.0 utop
  └
  and also how to use it directly in a workflow:
  ┌
  │   - name: Set-up OCaml
  │ uses: ocaml/setup-ocaml@v2
  │ with:
  │   ocaml-compiler: ocaml.5.0.0,ocaml-option-mingw
  │   opam-repositories: |
  │ dra27: https://github.com/dra27/opam-repository.git#windows-5.0
  │ default: 
https://github.com/fdopen/opam-repository-mingw.git#opam2
  └

  The `windows-5.0' branch adds just enough to provide the OCaml 5.0.0
  package for mingw-w64 by patching `ocaml-variants.5.0.0+options'
  (rather than providing `ocaml-variants.5.0.0+mingw64'). Unless you
  expressly select `ocaml-variants.5.0.0+options', it’ll actually pick
  up a version patched with [ocaml/ocaml#11846].

  The only change once the alpha release comes out should be the removal
  of the `opam repo add dra27' part.


[ocaml/opam] 

[ocaml/opam-repository] 

[setup-ocaml] 

[ocaml/ocaml#11846] 


Release of Mehari 0.1
═

  Archive:
  


Tim ats announced
─

  @artichaut and I are very pleased to announce the first release of
  Mehari.

  [Mehari] was created with the aim of offering a cross-platform
  framework to create [Gemini] applications.

  Gemini is a lightweight alternative protocol to HTTP and Gopher, which
  runs on top of TLS.

  On the “Geminispace”, there are mainly static content like blogs and
  other applications like games, BBS, etc.

  Mehari API’s is largely inspired by [Dream]: it consists of a single
  module, and is pretty similar, there are handlers, routes,
  middlewares, etc.

  Among the features, there are:

  • Cross-platform: the library provides many IO modules (Lwt, Mirage,
Eio)
  • MIME type inference (using experimental [Conan] support)
  • Rate limit : it is easy to rate limit access to a route or to the
whole server
  • Virtual hosting : hostname verification with SNI or request URL
  • Proxy: Ability to act as a proxy
  • CGI support with environment variables
  • Long-running TCP connection : incremental creation of the response
body

  Examples of use are available on the [GitHub repository].

  Documentation is available [online] with a short tutorial explaining
  the basics.

  Currently, the library is in its infancy, the API is subject to
  change, so we are open to feedback and contribution, especially in
  terms of security.

  Mehari is our first [MirageOS]-compatible library, so the creation of
  unikernels is experimental, and we’d love to get feedback on it.


[Mehari] 

[Gemini] 

[Dream] 

[Conan]


[GitHub repository]


[online] 

[MirageOS] 


Outreachy Summer 2023
═

  Archive: 


Patrick Ferris announced


  Yep, it’s that time of the year again! Outreachy has officially
  started asking for organisations and mentors for the Summer 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-01-10 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 03 to 10,
2023.

Table of Contents
─

OCaml.org: recapping 2022 and queries on the Fediverse
shuttle v0.3.1 released
Blog post: Testing in Seqes
ocplib-simplex v0.5 released
Looking for Participants for User Survey on ocaml.org Package Documentation and 
Learn Area
Release of ocaml-sf/learn-ocaml:0.14.1
The relationship between call/cc, shift/reset, and effect handlers
10 years of OUPS, meetup january 2023
ocaml-lsp-server 1.15.0-4.14 and 1.15.0-5.0
OCamlCC: Bazel-enabled OCaml Toolchain (new alpha release)
Other OCaml News
Old CWN


OCaml.org: recapping 2022 and queries on the Fediverse
══

  Archive:
  



Deep in this thread, Anil Madhavapeddy replied to several questions
───

Energy Usage


were environmental issues taken into account (eg. energy
consumption)?

  I punted on this in my recap as I hadn’t had a chance to catch up with
  @patricoferris about it, but since it’s a very important topic let’s
  start talking about it incrementally now instead of waiting for that!

  In the redesign for the new site, we explicitly removed third-party
  trackers and took advantage of the spare screen space (usually
  reserved for a privacy policy, now no longer needed) and put in a
  [OCaml.org carbon footprint statement] as a placeholder until we
  obtained more specific data.

  Later in 2022, @patricoferris investigated how we could do better in
  terms of power monitoring, and is developing a suite of OCaml tools
  that will hopefully be useful to the wider community as well:
  • [Variorium] collects hardware-level power counter information, for
accurate monitoring
  • [Carbon Intensity] is a tool to integrate with country-level APIs
for where energy is primarily coming from, in the absence of more
specific information from the datacentre provider.
  • [Clarke] combines all this into a convenient Prometheus monitoring,
for centralised analysis.

  These are all still unreleased, and I’ve opened a [tracking issue]
  about the deployment of these into the ocaml.org cluster. If anyone
  would like to help out (particularly around finding more accurate APIs
  for carbon intensity) then feel free to open issues/PRs on those
  various repositories.

  Some services, such as [restoring inbox.ocaml.org] are a little
  blocked on this topic as I’m reluctant to provision more long running
  virtual machines without thinking through more efficient alternatives
  that can consolidate services (e.g. have just one SMTP endpoint
  instead of multiple). My apologies to @xavierleroy and @nojb for the
  delay, as they have both done a bunch of work towards restoring it
  already, and I’ll do my best to catch up this month.


[OCaml.org carbon footprint statement]


[Variorium] 

[Carbon Intensity] 

[Clarke] 

[tracking issue] 

[restoring inbox.ocaml.org]



Privacy
╌╌╌

I’m wondering if private messages on this forum are
actually ‘private’, or are they readable by the admins

  The only digital communications mechanism that we’re using that
  features end-to-end encryption is Matrix. That implies that, as a
  general rule, that most of the alternatives such as Slack, IRC,
  Discord and Mastodon, do allow their respective admins to read your
  messages. Discourse (the software powering this forum) has [explicit
  support for admins to monitor private messages] for online safety
  reasons, although to my knowledge this facility has never needed to be
  used for this deployment.

  If you want a reasonably usable mechanism for private messages, then
  Matrix is the way to go, including for encrypted group channels, and
  all the other services are one security breach away from going public.

  As for the discussion about openness, I’m personally not really a
  believer in being radically transparent when doing open-source work. I
  find it really difficult to focus on a topic when in the public eye,
  and instead prefer to work on it with my immediate collaborators and
  then have an open discussion about it. What I _really_ miss is the
  ability to promote information that _results_ from the private
  discussions into a more open forum – all these recaps and newsletters
  are entirely written from scratch, and the inefficiency means that
  it’s a huge amount of effort to get right. It’s easy to put the time
  in with full papers since there is a reward structure (for academics,
  anyway) in place 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2023-01-03 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of December 27, 2022
to January 03, 2023.

Table of Contents
─

Diskuv OCaml 1.1.0 - Windows MSVC
OCaml.org: recapping 2022 and queries on the Fediverse
Old CWN


Diskuv OCaml 1.1.0 - Windows MSVC
═

  Archive:
  


jbeckford announced
───

  I’m pleased to announce the release 1.1.0 of DKML (Diskuv OCaml) at
  [https://github.com/diskuv/dkml-installer-ocaml/releases/tag/v1.1.0_r2].
  As usual the DKML distribution supports the Visual Studio compiler on
  Windows. After the 90-minute installer finishes you will have a
  working environment where `dune build' and `utop' work immediately.
  The installed OCaml language server works in VS Code using the
  installed `dkml' switch with a single VS Code option change (see /Full
  docs/). Creating a new local opam switch with an `ocaml-system'
  compiler takes about 90 seconds with `dkml init'. /Full docs/ are at
  .

  There are many new features and changes, so please browse the
  following release notes:

  Quick Links:
  Installer


  Uninstaller



  *Upgrading from 1.0.1?*
  1. Uninstall the old version first with the uninstaller above!
  2. After uninstalling the old version, run the following in
 PowerShell:
 ┌
 │if (Test-Path "$env:LOCALAPPDATA\opam\playground") { Remove-Item 
-Path "$env:LOCALAPPDATA\opam\playground" -Force -Recurse }
 └
  3. Exit Visual Studio Code and any `utop' or `ocaml' sessions. Then
 use the installer above.
  4. After installing the new version, run the following in PowerShell
 *in each directory that has a local opam switch* to upgrade to
 OCaml 4.14.0 and all the other package versions that come with DKML
 1.1.0:
 ┌
 │# Sometimes ~dkml init~ can fail, but you are OK as long as you see:
 │# ...  upgrade   ocaml-system   4.12.1 to 4.14.0
 │dkml init
 │ 
 │opam upgrade
 │opam install . --deps-only --with-test
 └

  Cautions:
  • Do not use this distribution if you have a space in your username
(ex. `C:\Users\Jane Smith'). Sorry, but the broader OCaml ecosystem
does not yet consistently support spaces in directories.
  • Your Windows anti-virus may play havoc with the installer. If
possible, temporarily disable your anti-virus (the “realtime
protection”, “exploit protection” and/or “malware protection”
options). Some anti-virus products include a button to temporarily
disable AV protection for two hours; do that. /If you forget and the
installer fails, you will need to disable AV protection, run the
uninstaller, and then rerun the installer!/

  New features:
  • The system OCaml is 4.14.0 (was 4.12.1)
  • The system includes ocamlnat, the experimental native toplevel. It
should be run using `with-dkml ocamlnat' so native code is compiled
with Visual Studio.
  • Add odoc 2.1.0 to user PATH, to align with the [OCaml Platform].
  • Relocatable native binaries are installed rather than compiled into
place. Installations should be quicker, which is a pre-requisite for
`winget install' (pending!) on Windows.
  • Add opam global variable `sys-pkg-manager-cmd-msys2' for future
compatibility with opam 2.2 depext support of MSYS2
  • The `opam dkml init' command is now `dkml init'. The `dkml'
executable is precompiled and shaves ~20 minutes of installation
time.

  New security:
  • (Advanced; experimental) If you are behind a corporate firewall that
uses man-in-the-middle (MITM) TLS proxying, you can install your
corporate CA chain so DKML, in particular MSYS2, does not reject
connections. Only persons with write access to
`$env:ProgramData\DiskuvOCaml\conf\unixutils.sexp' will be able to
define the allowed MITM TLS chain; you may need access from your
corporate Administrator. An example `unixutils.sexp' is:

┌
│   (
│   (trust_anchors ("C:\\conf\\my.pem" "D:\\conf\\my.cer"))
│   )
└

You specify one or more `.pem' or `.cer' CA files, making sure to
use two backslashes to escape your paths. Your Administrator may
have already placed the CA files on your machine; otherwise use the
guide at


to copy them from your web browsers.

  Not so good problems:
  • [Known bug #21] To install the OCaml language server in a new switch
you will need to first do 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-12-27 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of December 20 to 27,
2022.

Table of Contents
─

OCaml 4.14.1 released
Js_of_ocaml 5.0
CFP - JFLA 2023 - Journées Francophones des Langages Applicatifs
OCaml Job
Maintenance bottlenecks in the compiler distribution
Results of the OCaml User Survey 2022
Old CWN


OCaml 4.14.1 released
═

  Archive: 


octachron announced
───

  We have the pleasure of celebrating the birthday of Oronce Finé by
  announcing the release of OCaml version 4.14.1.

  This release is a collection of safe bug fixes, cherry-picked from the
  OCaml 5.0.0 release. If you were using OCaml 4.14.0 and cannot yet
  upgrade to OCaml 5, this release is for you.

  The 4.14 branch is expected to receive more backported fixes during
  the maturation of OCaml 5. Thus don’t hesitate to report any bugs on
  the [OCaml issue tracker].

  See the list of changes below for more details.


[OCaml issue tracker] 

Installation Instructions
╌

  The base compiler can be installed as an opam switch with the
  following commands:

  ┌
  │ opam update
  │ opam switch create 4.14.1
  └

  The source code for the release candidate is also directly available
  on:

  • [GitHub]
  • [Inria archive]


[GitHub] 

[Inria archive]



Changes in OCaml 4.14.1 (20 December 2022)
╌╌

◊ Compiler User-Interface and Warnings:

  • [#11184], [#11670]: Stop calling ranlib on created / installed
libraries (Sébastien Hinderer and Xavier Leroy, review by the same)


  [#11184] 

  [#11670] 


◊ Build System:

  • [#11370], [#11373]: Don’t pass CFLAGS to flexlink during configure.
(David Allsopp, report by William Hu, review by Xavier Leroy and
Sébastien Hinderer)

  • [#11487]: Thwart FMA test optimization during configure (William Hu,
review by David Allsopp and Sébastien Hinderer)


  [#11370] 

  [#11373] 

  [#11487] 


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

  • [#11204]: Fix regression introduced in 4.14.0 that would trigger
Warning 17 when calling virtual methods introduced by constraining
the self type from within the class definition. (Nicolás Ojeda Bär,
review by Leo White)

  • [#11263], [#11267]: caml/{memory,misc}.h: check whether `_MSC_VER'
is defined before using it to ensure that the headers can always be
used in code which turns on -Wundef (or equivalent). (David Allsopp
and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Sébastien
Hinderer)

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

  • [#11392], [#11392]: assertion failure with -rectypes and external
definitions (Gabriel Scherer, review by Florian Angeletti, report by
Dmitrii Kosarev)

  • [#11417]: Fix regression allowing virtual methods in non-virtual
classes. (Leo White, review by Florian Angeletti)

  • [#11468]: Fix regression from [#10186] (OCaml 4.13) detecting IPv6
on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier
Leroy and Sébastien Hinderer)

  • [#11489], [#11496]: More prudent deallocation of alternate signal
stack (Xavier Leroy, report by @rajdakin, review by Florian
Angeletti)

  • [#11516], [#11524]: Fix the `deprecated_mutable' attribute. (Chris
Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

  • [#11194], [#11609]: Fix inconsistent type variable names in “unbound
type var” messages (Ulysse Gérard and Florian Angeletti, review
Florian Angeletti and Gabriel Scherer)

  • [#11622]: Prevent stack overflow when printing a constructor or
record mismatch error involving recursive types. (Florian Angeletti,
review by Gabriel Scherer)

  • [#11732]: Ensure that types from packed modules are always
generalised (Stephen Dolan and Leo White, review by 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-12-20 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of December 13 to 20,
2022.

Table of Contents
─

B·o·B, an universal and secure peer-to-peer file-transfer in OCaml
OCaml 5.0.0 is out!
ThreadSanitizer support for OCaml 5.0.0 – first public release
Parany for OCaml-5
WebAssembly/Wasm and OCaml, by OCamlPro
opam 2.1.4, opam-publish 2.2.0, opam-file-format 2.1.5
Old CWN


B·o·B, an universal and secure peer-to-peer file-transfer in OCaml
══

  Archive:
  



Calascibetta Romain announced
─

  As we said, the announcement of Bob being experimental, we had various
  feedbacks to improve Bob but also bugs on its use (particularly [on
  MacOS]).

  In this, we fixed the problems and decided to offer an Atom feed to
  follow the development of Bob but also the changes made on our relay
  (available to users).

  [The website] has been improved by implementing a “dark” mode to make
  it easier to read. We therefore advise you not only to download the
  latest version of Bob if you are a user, but also to subscribe to [our
  feed] in order to keep up to date with our development.


[on MacOS] 

[The website] 

[our feed] 


OCaml 5.0.0 is out!
═══

  Archive: 


octachron announced
───

  We have the pleasure of celebrating the birthdays of Jane Austen and
  Arthur C. Clarke by announcing the release of OCaml version 5.0.0.

  The highlight of this new major version of OCaml is the long-awaited
  runtime support for [shared memory parallelism] and [effect handlers].

  This multicore support is the culmination of more than 8 years of
  effort, and required a full rewrite of the OCaml runtime environment.
  Consequently, OCaml 5.0.0 is expected to be a more experimental
  version of OCaml than the usual OCaml releases.

  In this release, the native compiler only supports the x86-64 and
  arm64 architectures. In terms of operating systems, Linux, the BSDs,
  macOS and mingw64 on Windows are supported.

  We are planning to restore the support for most previously supported
  architectures and operating systems, and address remaining known
  issues over the course of the next year.

  Don’t let those words of caution hinder your experimentation with
  OCaml 5: OCaml 5 as a language is fully compatible with OCaml 4 down
  to the performance characteristics of your programs. In other words,
  any code that works with OCaml 4 should work the same with OCaml 5.

  The currently known exceptions to this rule are:
  • the removal of many long-deprecated functions and modules
  • changes to the internal runtime API
  • the performance of ephemerons is currently (and temporarily)
strongly degraded.

  Please report any unexpected behaviours on the [OCaml issue tracker]
  ().

  During the maturing period for OCaml 5, the OCaml 4.14 branch will be
  maintained by backporting bug fixes from the OCaml 5 branch at regular
  intervals. The next release on the OCaml 4.14 branch, OCaml 4.14.1,
  should soon follow this release.

  The full list of changes can be found in the changelog below.


[shared memory parallelism]


[effect handlers]


Installation Instructions
╌

  The base compiler can be installed as an opam switch with the
  following commands:
  ┌
  │ opam update
  │ opam switch create 5.0.0
  └

  It might be also interesting to check the new support for parallelism
  by installing the `domainslib' library with
  ┌
  │ opam install domainslib
  └
  The source code for the release candidate is also directly available
  on:

  • [GitHub]
  • [OCaml archives at Inria]


[GitHub] 

[OCaml archives at Inria]


◊ Fine-Tuned Compiler Configuration

  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌
  │ opam update
  │ opam switch create  ocaml-variants.5.0.0+options 
  └
  where `' 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+flambda+nffa ocaml-variants.5.0.0+options 
ocaml-option-flambda ocaml-option-no-flat-float-array
  └

  The command line above is slightly more complicated for opam versions
  before 2.1:

  ┌
  │ opam update
  │ opam switch create  
--packages=ocaml-variants.5.0.0+options,
  └
  In both cases, all available 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-12-13 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of December 06 to 13,
2022.

Table of Contents
─

Status update: Bazel-enabled OCaml toolchain
First release candidate for OCaml 5.0.0
First release candidate for OCaml 4.14.1
Stable Diffusion in OCaml
qcheck-lin and qcheck-stm 0.1.0
Accelerating zk-SNARKs on FPGAs with Hardcaml
ppx_expjs: transparently export OCaml values to JavaScript
First public release of OCaml-Canvas 1.0
Release of Seqes version 0.1
Batteries v3.6.0
Old CWN


Status update: Bazel-enabled OCaml toolchain


  Archive:
  



Gregg Reynolds announced


  [https://github.com/obazl-repository/ocamlcc]

  From the readme:

  • New name: ocamlcc - the OCaml Compiler Collection. Analogous to GCC,
the GNU Compiler Collection. Not only do we have multiple compilers
- ocamlc.byte, ocamlopt.byte, etc., the compilers themselves may
serve to drive a C toolchain, to compile, assemble, and link C code.
  • Platforms and toolchains have been revised to support recursive
(staged) builds.
  • Recursive builds. Well, at least quasi-recursive. There is only one
target for building a compiler, bin:ocamlcc; to build the compiler,
this target needs a compiler, which it gets from a toolchain, which
depends on bin:ocamlc, which needs a compiler, …​ recursively, until
we get to the base case, the precompiled boot/ocamlc compiler. So
the boot compiler (boot/ocamlc) builds the stage 1 compiler which
builds the stage 2 compiler which builds the stage 3 compiler. See
Staged builds.
  • Revised configuration logic. The goal is to eliminate dependency on
autotools (./configure). This is very much a Work-In-Progress; the
code is in //config. For more info see notes/autoconf.
  • Use the link command from the Bazel CC toolchain. OBazl now uses
information from the cc toolchain selected (and configured) by Bazel
to set the command string used by OCaml to run the C linker
(Config.mkexe). For more info see ocaml_cc_config and notes/linking.
[TODO: same thing for the assemble command Config.asm]
  • Revised preprocessing. OBazl eliminates shell scripts and tools,
instead using a template engine written in portable C to generate
code.

  In other words, this version includes some stuff beyond just getting
  the Bazel build to work, in particular concerning configuration and
  preprocessing. Part of the motivation there is to pave the way to
  Windows support by eliminating dependency on Unix-ish stuff.

  Maintainers of the Makefiles may be interested in some of that stuff.
  Using templates for code generation instead of sh, awk, sed, etc. The
  template engine is written in portable C. Personally I find that using
  templates simplifies things considerably.

  Feedback always welcome. The issue tracker is enabled on the github
  repo, and a discourse server is at .


[https://github.com/obazl-repository/ocamlcc]



First release candidate for OCaml 5.0.0
═══

  Archive:
  


octachron announced
───

  The release of OCaml version 5.0.0 is imminent. As a final step before
  the release, we are publishing a release candidate that you can test
  while waiting for the release in the upcoming weeks.

  If you find any bugs, please report them here:

  

  Compared to the second beta release, this release contains one
  toplevel bug fix and a minor type system fix.

  If you are interested by the bug fixes beyond the new multicore
  runtime, the full change log for OCaml 5.0.0 is available at:

  

  A short summary of the two changes since the second beta release is
  also available below.

  This release candidate will be followed shortly by a release candidate
  for OCaml 4.14.1 . This updated minor version for OCaml 4.14 will
  mirror the safe bug fixes from the OCaml 5.0 branch.


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~rc1
  └
  For previous version of opam, the switch creation command line is
  slightly more verbose:
  ┌
  │ opam update
  │ opam switch create 5.0.0~rc1 
--repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └
  It might be also interesting to check the new support for parallelism
  by installing the domainslib library with
  ┌
  │ opam install domainslib
  └
  The source code for the release candidate is available at these
  addresses:

  • 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-11-29 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of November 22 to 29,
2022.

Table of Contents
─

B·o·B, an universal and secure peer-to-peer file-transfer in OCaml
ISO3166 (Country Codes)
Is there any way to get live preview of plots from Owl_plplot?
OCaml Community Code of Conduct
Adopting the OCaml Code of Conduct
OCaml 5.0.0, second beta release
OUPS meetup december 2022
Optimising an interpreter
Old CWN


B·o·B, an universal and secure peer-to-peer file-transfer in OCaml
══

  Archive:
  



Continuing this thread, Yawar Amin asked and Calascibetta Romain replied


  Hello and thank you for your interest in the project!

Does this mean that uncompressed files are sent without
encryption?

  Any documents sent with Bob is encrypted :) . What we don’t want to do
  is infer the MIME type of what the user wants to send - in this we are
  not trying to introspect the content of the document. The trade-off is
  that we can’t infer whether it would make sense to compress the
  document or not. For example, a user might expect Bob to be smart
  enough to recognise the document as a video and, in that case, not
  compress the document. This is not the case, however, if you do not
  want to introspect the MIME type of the document to be sent.

  In other words, the user must be aware of what is trying to be sent
  and use `--no-compression' or not accordingly. Again, the latter
  option does not override the encryption :) .

Would it be possible to use the relay only for
establishing the connection and after that is done for the
relay to connect the two peers directly, removing itself
from the middle?

  One of the improvements we want to make is the ability for Bob to
  actually do “peer-to -peer” - and not go through the relay. However,
  we would like to keep the default of using the relay for simplicity.
  The peer-to-peer case probably requires a network state (open ports,
  accessible peer) that many don’t have for various reasons -
  conversely, we know that it is possible for the user not to have
  access to our relay (but to have access to the peer) and it is in this
  case that we would like to do true peer-to-peer.


ISO3166 (Country Codes)
═══

  Archive:
  


Patrick Ferris announced


  Hello :wave:

  On behalf of the [geocaml] organisation, I’m happy to announce the
  initial release of [ISO3166], a very simple library for working with
  “country codes”.

  ┌
  │ # ISO3166.alpha3_to_country `IRL |> ISO3166.Country.name;;
  │ - : string = "Ireland"
  └

  The `Country' module already contains all of the countries for
  convenience named after the alpha2 country code.

  ┌
  │ # ISO3166.Country.fr |> ISO3166.Country.name;;
  │ - : string = "France"
  │ # ISO3166.Country.fr |> ISO3166.Country.numeric |> 
ISO3166.numeric_to_string;;
  │ - : string = "250"
  └

  This [is the data source], read it with care if you want to use this
  library in your code.

  Happy coding :))


[geocaml] 

[ISO3166] 

[is the data source]



Is there any way to get live preview of plots from Owl_plplot?
══

  Archive:
  



Continuing this thread, sanette announced
─

  Done!

  version 0.6 ([github]) now uses SDL2 (via tsdl)


[github] 


OCaml Community Code of Conduct
═══

  Archive:
  


Sudha Parimala said
───

  Once again, thanks everyone for all the feedback here and over DMs.
  Really appreciate everyone’s involvement in this. Below is our
  response. Feel free to nudge us if we missed somethig!


Scope of the Code of Conduct


  The list of spaces has been modified to better capture the essence of
  the spaces this Code of Conduct applies to (thanks to Xavier & Gabriel
  for the wording)

These rules apply to the projects hosted in the [GitHub
ocaml organization], the [discuss.ocaml.org] forum, the
[caml-l...@inria.fr]() mailing
list, [OCaml IRC](irc://irc.libera.chat:6697/#ocaml),
[OCaml discord], physical events like OCaml Workshop, and
any other OCaml-related space that adopted this Code of
Conduct. A 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-11-15 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of November 08 to 15,
2022.

Table of Contents
─

OCaml Platform Installer alpha release
Building the OCaml Toolchain with Bazel - PoC
OCaml compiler development newsletter, issue 6: March 2022 to September 2022
diskuvbox: small set of cross-platform CLI tools
http_async 0.2.0
Other OCaml News
Old CWN


OCaml Platform Installer alpha release
══

  Archive:
  



Continuing this thread, Paul-Elliot explained
─

  Let me try to explain a little bit more!

  So, there are two distinct process:
  1. Installing `ocaml-platform'. This is done by the installer script
 which, as you found out, also installs opam.
  2. Installing the platform tools: `merlin', `dune', `ocamlformat', …
 This is done by running `ocaml-platform' (more explanation of what
 happens during a run of `ocaml-platform' below).

  For 1., I agree that using a script is not ideal at all. We do want to
  have a system package, ideally as part of a distribution. However, we
  are really at an early stage, and first focused on developing the
  “core” functionality, for feedback before going further. Note that
  `sudo' is only used when needed (for the `install' command), and that
  we encourage users to check what is inside the script: Taken from the
  README:
Don’t hesitate to have a look at what the script does. In
a nutshell, the script will install a static binary into
`/usr/local/bin/ocaml-platform' as well as the `opam'
binary if it isn’t already installed.

  For 2. here is what happens when you run `ocaml-platform' (also
  detailed in the [README]):
  • First, “driving” `opam', `ocaml-platform' infer a version of each
platform tools (`dune' `merlin' etc). It will use the best one
available for your version of OCaml, except for `ocamlformat' where
it will first search for a `.ocamlformat' with a specified version.
  • Then, `ocaml-platform' checks which of the `tools.version' it has in
a local cache (which is initially empty).
  • Using `opam', it builds in a “sandbox switch” the ones to build (the
ones that are not already in the cache)
  • it populates the local cache with the newly built package
  • Using `opam', it installs everything from the local cache (which is
a local opam repo).

  So, to answer your question:
What happens when a new version of dune is released, how
do I get an update using “ocaml-platform-installer”?
  You simply need to run `ocaml-plaform', it will know that there is a
  new version of `dune' by asking `opam' the best version available. (I
  answered incorrectly the first time as I thought you were specifically
  speaking about a new version of `ocaml-platform', my apologies!)

> In fact, currently only the `ocaml-platform' binary is
  being downloaded.

When I look into `installer.sh', at least also `opam' is
downloaded and “installed” (copied to PREFIX, there’s a
lack of manpages etc.).

  Yes, I forgot about opam’s installation… I meant that only
  `ocaml-platform' (and `opam'…) is downloaded _through the install
  script_. Other tools are downloaded through opam.

> We do have security in mind!

Could you elaborate on that?
  I simply meant that, when discussing how the tool would work, we tried
  not to miss security issues. Since most of the communication with the
  outside world is done through opam, we felt it was okay, but I am no
  security expert… and would love specific advices on the matter :)

  @hannes I hope that I answered your questions in a clearer way!

It looks like the `ocaml-platform' tool would be
beneficial even if you already have `opam' and a
development environment, as it seems to offer a convenient
way to share various developer tools between multiple
`opam' switches (and it could perhaps build and install
itself as one of such tools, so it can be conveniently be
kept up to date).

  @edwin that’s a good point! There are still some things to work out:
  since the tool is not switch dependent, having multiple versions of it
  (even in multiple switches) might create problem (for instance, v2
  updates the cache to the v2 version, and v1 cannot use the cache
  anymore. (Similar to opam 1 and 2 with the update of `.opam'!))


[README] 


Building the OCaml Toolchain with Bazel - PoC
═

  Archive:
  



Gregg Reynolds announced


  I’m inordinately pleased to announce that a Proof-of-Concept Bazel
  build of the OCaml compilers and tools (latest trunk 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-10-25 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of October 18 to 25,
2022.

Table of Contents
─

tablecloth-native 0.0.8 released
ocaml-lsp-server 1.14.0
What are pros and cons of Eliom web framework?
dune 3.5.0
Killer use-cases (tools, libraries, domains, etc) for OCaml
Snóke, a good (?) old game
Interesting: Running WebAssembly in OCaml with Wasmer
OCaml Community Code of Conduct
multicodec, multibase, multihash and multihash-digestif
Timmy, a time and calendar library
Opam hacking afternoon for OCaml 5.0.0 on Friday 28
Other OCaml News
Old CWN


tablecloth-native 0.0.8 released


  Archive:
  


Paul Biggar announced
─

  We’ve released version 0.0.8 of [Tablecloth], an ergonomic,
  cross-platform standard library to allow you share code between OCaml
  and Rescript. This version has dozens of new functions, which you can
  see in the [Changelog].

  You can install it:

  • in Rescript: via npm as `tablecloth-rescript'
  • in OCaml: via opam as `tablecloth-native'

  From [the announcement]:

This is the last release of Tablecloth in this format. As
Rescript and OCaml have diverged, Tablecloth’s old purpose
(a library to allow you to share code between ReasonML and
OCaml) no longer makes sense (and in fact we had struggled
to get much value out of sharing code between the two).

What we actually found valuable about Tablecloth was being
able to use the same function names in our multiple
codebases.

As such, we’ve refocused Tablecloth to be a simple shim
over existing standard libraries, allowing developers who
use multiple languages to have a consistent set of
standard library functions, while being idiomatic to
language they’re in (eg pipe-first vs pipe-last,
`camelCase' vs `snake_case'). The next release is planned
to support [OCaml], [Rescript], and [F#].


[Tablecloth] 

[Changelog]


[the announcement]


[OCaml] 

[Rescript] 

[F#] 


ocaml-lsp-server 1.14.0
═══

  Archive:
  


Rudi Grinberg announced
───

  On behalf of the ocamllsp team, I’m pleased to announce version
  1.14.0. This release contains a new code action to help you inline
  definitions thanks to @jfeser. We look forward to your feedback.

  Full change log:


Features


  • Code action for inlining let bindings within a module or expression.
(#847)

  • Tag “unused code” and “deprecated” warnings, allowing clients to
better display them. (#848)

  • Refresh merlin configuration after every dune build in watch mode
(#853)


Fixes
╌

  • Respect `showDocument' capabilities. Do not offer commands or code
actions that rely on this request without client support. (#836)

  • Fix signatureHelp on .mll files: avoid “Document.dune” exceptions


What are pros and cons of Eliom web framework?
══

  Archive:
  



Volodymyr Melnyk asked
──

  I’m interested in pros and cons of Eliom web framework to understand
  if it is well suitable for my idea of corporate blogging/content
  marketing SaaS. What successful SaaS projects made with Eliom do you
  know? Do you know any issues related to Eliom (or why many people
  prefer, for example, Dream)? Also I’m interested if there are any
  popular iOS apps made with Eliom?


Vincent Balat replied
─

  There is a huge app written with Eliom: The Be Sport social network.
  It was written by a team of 2 to 15 developers over the past 7 years
  (including Jerôme Vouillon and myself, who are the creators of
  Ocsigen). You can have a look here:  and
  download the mobile apps on [Google Play store] or [Apple app store].

  Be Sport is 100% written in OCaml with Ocsigen, as multi-tier and
  multi-platform Eliom app. There is only one code base for the server
  part and the Web, Android and iOS clients. The mobile apps are running
  in in webviews, using cordova (or may be soon capacitor). Pages are
  generated on server side (for example for indexing by search engines,
  or if it is the first page you load) or on the client (in client apps,
  or if you change page in the Web app). This is the most distinguishing
  feature of Eliom w.r.t. any other Web framework (in any programming
  language).

  Another advantage of 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-10-11 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of October 04 to 11,
2022.

Table of Contents
─

OUPS meetup september 2022 (french only)
NeoVim setup in Lua for OCaml
Call for Contributions: BOB 2023 [March 17, Deadline Nov 21]
Old CWN


OUPS meetup september 2022 (french only)


  Archive:
  


nrolland asked and zapashcanon replied
──

Bonjour, y-a-t-il des vidéos disponibles des présentations
par hasard ?

  Oui ! Elles seront publiées [ici].


[ici] 


NeoVim setup in Lua for OCaml
═

  Archive:
  


Jazz announced
──

  I would like to share my NeoVim setup in Lua for OCaml.

  [Blog] [Github Repo]

  



[Blog] 

[Github Repo] 


Call for Contributions: BOB 2023 [March 17, Deadline Nov 21]


  Archive:
  



Michael Sperber announced
─

  OCaml-related submissions are extremely welcome at BOB!

  
`=='
  BOB Conference 2023
  “What happens when we use what’s best for a change?”
  
  Berlin, Mar 17
  Call for Contributions
  Deadline: November 21, 2022
  
`=='

  You are actively engaged in advanced software engineering methods,
  solve ambitious problem with software and are open to cutting-edge
  innovation? Attend this conference, meet people that share your goals,
  and get to know the best software tools and technologies available
  today. We strive to offer a day full of new experiences and
  impressions that you can use to immediately improve your daily life as
  a software developer.

  If you share our vision and want to contribute, submit a proposal for
  a talk or tutorial!

  NOTE: The conference fee will be waived for presenters. Travel
  expenses will not be covered (for exceptions see “Speaker Grants”).


Online or Onsite


  We expect we’ll be able to hold BOB 2023 in Berlin. Note that we
  intend to provide a safe environment for all participants. There will
  be space outside to eat and chat. We may ask you to wear a mask
  indoors when not presenting or eating, and may also ask you to take a
  COVID test on-site before the event.

  If an on-site BOB is not possible, we’ll make BOB a successful online
  event, like BOB 2021 and BOB 2022. Should BOB happen online, we will
  likely ask for pre-recorded talks to make room for questions and
  social interactions during the actual conference day. (Of course,
  we’ll provide assistance making those recordings.) Tutorials will
  likely happen as a live-session.


Shepherding
╌╌╌

  The program committee offers shepherding to all speakers. Shepherding
  provides speakers assistance with preparing their sessions.
  Specifically:

  • advice on structure and presentation
  • review of talk slides
  • assistance with recording
  • review of recording, if applicable


Speaker Grants
╌╌

  BOB has Speaker Grants available to support speakers from groups
  under-represented in technology. We specifically seek women speakers,
  speakers of color, and speakers who are not able to attend the
  conference for financial reasons.


Topics
╌╌

  We are looking for talks about best-of-breed software technology,
  e.g.:

  • functional programming
  • persistent data structures and databases
  • event-based modelling and architecture
  • “fancy types” (dependent types, gradual typing, linear types, …)
  • formal methods for correctness and robustness
  • abstractions for concurrency and parallelism
  • metaprogramming
  • probabilistic programming
  • math and programming
  • controlled side effects
  • program synthesis
  • next-generation IDEs
  • effective abstractions for data analytics
  • … everything really that isn’t mainstream, but you think should be
  • … includeing rough ideas worth discussing.

  Presenters should provide the audience with information that is
  practically useful for software developers.


Challenges
╌╌

  Furthermore, we seek contributions on successful approaches for
  solving hard problems, for example:

  • bias in machine-learning systems
  • digital transformation in difficult settings
  • accessibiltity
  • systems with critical reliability requirements
  • ecologically 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-10-04 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of September 27 to
October 04, 2022.

Table of Contents
─

How to dump many floats in binary format so that OCaml can read them in later
Beta of neovim treesitter-reason
data-encoding 0.7
New OCaml meetup group in Toulouse (in French)
opam-mirror: a MirageOS unikernel that provides an opam repository and cache
Aches.1.0.0, Ringo.1.0.0
Multicore with opam–instructions?
Other OCaml News
Old CWN


How to dump many floats in binary format so that OCaml can read them in later
═

  Archive:
  



A long time ago, UnixJunkie asked
─

  I need to write out to disk many floats from a Python script (but that
  could also be from a C program). Later, I would like to read them as
  32bit floats in OCaml. What is the format I should use? I want to use
  32bit floats, because 64bit floats would be two times more data. I
  guess 32 bits precision is way enough for what I am doing.


pukkamustard replied


  Maybe something like CBOR would work for you? It’s a standardized
  binary serialization format that has [a dedicated datatype for 32bit
  floats] and there are implementations for OCaml and Python (and many
  other languages).

  Shameless plug: I am the author of a CBOR implementation for OCaml:
  


[a dedicated datatype for 32bit floats]



UnixJunkie said and Xavier Leroy replide


Nice, so for integers, I should be using:
Stdlib.output_binary_int and input_binary_int.

  No. These functions operate on the low 32 bits of values of type
  `int', meaning that on 32-bit platforms you’ll lose some bits.

  For reliable encoding/decoding of 32 and 64-bit integers, please use
  `Bytes.{get,set}_int{32,64}_{le,be,ne}', which also let you control
  the endianness you want to use.


Carmelo Piccione said
─

  This might be too heavy handed for you but [hdf5] is a decent choice
  for serializing and loading back up large numerical datasets,
  especially if your data is shaped like a typical dataframe.

  It has a proven track record as it is often used by the scientific
  computing community and the finance industry as well. They like the
  fact that it’s high performance, standardized, and supports
  hierarchies and thus multiple datasets within one file. You can also
  memory map to it or use filters and chunking to avoid loading the
  entire file.

  The biggest negative: there is only a complex C library implementation
  of it which is inevitably wrapped to other languages, including ocaml.


[hdf5] 


Beta of neovim treesitter-reason


  Archive:
  


Danielo Rodríguez announced
───

  I’m happy to share that my neovim plugin for adding tree-sitter
  support for reason (which is a fork of the rescript tree-sitter plugin
  for neovim) has now reached an “usable” state. It still needs
  development, and there are things that still only make sense for
  rescript, but it is already helping me in my everyday work. Everybody
  is welcome to contribute if you find it valuable. Not sure if this is
  interesting in an Ocaml forum, but I guess that some people may use
  the reason syntax, and since there is no Reason forum anymore, I will
  be posting it here and in rescript one.

  Here is the project:
  


data-encoding 0.7
═

  Archive: 


Raphaël Proust announced


  Version 0.7 of the Data-encoding library has just been released.

  Data-encoding is a library for describing binary and JSON encodings
  for your various OCaml types and for serialising to and deserialising
  from those descriptions.

  The library is used within the [Tezos project]. It is [hosted on
  Gitlab] under the MIT License. It is distributed on `opam'.


[Tezos project] 

[hosted on Gitlab] 


New OCaml meetup group in Toulouse (in French)
══

  Archive:
  



R. Boujbel announced


  Le premier meetup se tiendra le 11 octobre à 18h à la [Manufacture des
  Tabacs]. Merci de nous informer de votre présence en vous inscrivant
  sur [cette page] contenant les détails de la session.

  Au plaisir de vous y retrouver 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-09-27 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of September 20 to
27, 2022.

Table of Contents
─

Esperanto, when OCaml meets Cosmopolitan
OBazl Toolsuite - tools for building OCaml with Bazel
Orsetto: structured data interchange languages (release 1.1.2)
Interest in a Http_sig library?
Outreachy summer ’22 closing commemoration session on 23rd Sept
findlib-1.9.6
Interesting OCaml Articles
Other OCaml News
Old CWN


Esperanto, when OCaml meets Cosmopolitan


  Archive:
  



Calascibetta Romain announced
─

  I am delighted to present the first *experimental* release of
  Esperanto. This project is a new OCaml _toolchain_ that creates
  binaries compiled with the [Cosmopolitan C library] and linked with
  the [αcτµαlly pδrταblε εxεcµταblε] link script. The binary produced is
  then portable to different platforms:

  
  
  
  
  
  
  

  The main objective of Esperanto is to provide a toolchain capable of
  producing a portable binary from an existing project. This would allow
  to finally be able to distribute software for all these platforms
  without having to:
  1) manage multiple platforms orthogonally, the Cosmopolitan C library
 offers you the POSIX API for all platforms (including Windows)
  2) Produce several versions of the same software for each platform.
 Only the binary is needed to run on all platforms

  Cosmopolitan *does not* however produce a binary with a multi-platform
  assembler. At this stage, our distribution only supports the `x86_64'
  assembler (the most common one) but we are working on the possibility
  to produce a binary with different assemblers.

  I would like to give special thanks to Justine, the author of the
  Cosmopolitan project (to develop [redbean], a small portable HTTP
  server) for her excellent work.


[Cosmopolitan C library] 

[αcτµαlly pδrταblε εxεcµταblε] 

[redbean] 

A _toolchain_
╌

  In OCaml, the “toolchain” principle allows the existence of several
  compilers within an OPAM switch and to choose one of them when it
  comes to cross-compiling a project. This principle, even though it is
  not clearly defined and even though its use remains very limited,
  exists through the `ocamlfind` tool.

  You can find these toolchains in your switch:
  ┌
  │ $ ls $(opam var lib)/findlib.conf.d/
  │ esperanto.conf solo5.conf
  └

  From our experience with Mirage as well as the work done in `dune'
  regarding cross-compilation, the choice to propose a new _toolchain_
  in order to allow cross-compilation of projects with OPAM is both a
  historical choice but also the most relevant one in our opinion [1].


◊ Why we need to cross-compile?

  The term cross-compilation can be misunderstood if we only consider
  the question of the assembler issued by the compiler (does it match
  the host assembler or not). In our case, cross-compilation is a
  broader term that implies the use of external artefacts to the
  compiler that are different from the default and the use of compiler
  options that must be used throughout the production of the final
  binary.

  In other words, even though we are emitting the same assembler, we are
  doing so in a different “context” which requires the definition of a
  new _toolchain_ which includes our artefacts and compiler options.

  One of these artefacts is of course the C library used by the compiler
  which will then be systematically used by the _runtime caml_, the well
  named `libasmrun.a'. This is why, for example, there is a version of
  OCaml with [musl]. So there must be a version of OCaml with
  Cosmopolitan.

  This new _toolchain_ also allows you to include the necessary options
  for compiling C files because, yes, you can compile a C file with
  `ocamlopt'.

  In order to provide a coherent _workflow_ for a project, we need to
  provide not only a `libasmrun.a' compiled with our Cosmopolitan C
  library but also an OCaml compiler capable of invoking the C compiler
  with the right options required by Cosmopolitan.

  Finally, we also need to describe in this _toolchain_ how to link the
  object files together to actually produce a portable binary using the
  APE script.


  [musl] 


◊ A simple example with this new _toolchain_

  Installing Esperanto is very easy with OPAM. It will install the
  cross-compiler and the necessary files so that 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-09-20 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of September 13 to
20, 2022.

Table of Contents
─

Sandmark Nightly Service now reports Instructions Retired along with Time
Outreachy December 2022
Unicode 15.0.0 update for Uucd, Uucp, Uunf and Uuseg
OUPS meetup september 2022 (french only)
strymonas v2: library for highest-performance stream processing
OCaml Community Code of Conduct
Use OCaml to interact with Neovim
What will be required to transpile OCaml to Lua?
OBazl Toolsuite - tools for building OCaml with Bazel
Old CWN


Sandmark Nightly Service now reports Instructions Retired along with Time
═

  Archive:
  



Shakthi Kannan announced


  Sandmark Nightly is a service for the OCaml compiler developers that
  helps benchmark the development branches of the compiler on the large
  set of Sandmark benchmarks on tuned machines and reports the results
  in an interactive UI. Currently, Sandmark nightly reported many
  metrics including running time. But running time is a notoriously
  noisy metric on modern architectures due to the effects of modern OS,
  arch and micro-arch optimisations. There could be swings of 50% in
  either directions when the directory in which the program is run
  changes.

  While we run Sandmark benchmarks on tuned machines, we still see
  impact of noise on the real time measurements. To this end, we
  introduce a new metric into Sandmark nightly that in addition to real
  time, would help interpret the results accounting for the noise. We
  now report “instructions retired” for Sandmark runs. Instructions
  retired report the number of instructions executed by the program
  during its run and hence is shielded from the noise that affects real
  time measurements. Of course, the same number of instructions may be
  discharged at different rates by the processor due to
  instruction-level parallelism and hence, the instructions discharged
  metric should be used in conjunction with real time measurements. For
  example, if a new compiler feature adds 2 instructions to the prolog
  of the function, then the instructions retired metric should inform
  you how many new instructions are actually executed on top of the
  baseline.

  The instructions retired metric is collected from `perf' command. We
  also have other useful metrics from perf such as page faults,
  branches, branch misses, cache misses at various levels of the
  hierarchy, etc. We will add graphs to report these going forward.
  Enjoy the new feature, and as ever, report issues and bugs to
  [Sandmark Issues].

  The web service is available at  and you
  can select the `Perfstat Output' radio button on the left panel as
  shown below.

  


  After selecting the variants and a baseline for comparison, you can
  view the normalised `instructions per cycle' change as illustrated
  below:

  


  You can also request for your development branches to be added to the
  Sandmark Nightly Service at the [sandmark-nightly-config] repository
  for the nightly runs.


[Sandmark Issues] 

[sandmark-nightly-config]


References
╌╌

  1. Run perfstat with Sandmark nightly service. [Sandmark PR #394]
  2. Add webpage with perfstat output from Sandmark. [Sandmark-nightly
 PR #81]
  3. perfstat.ipynb. [Sandmark perfstat Jupyter notebook]


[Sandmark PR #394] 

[Sandmark-nightly PR #81]


[Sandmark perfstat Jupyter notebook]



Outreachy December 2022
═══

  Archive:
  


Patrick Ferris said
───

  Just a reminder the deadline for mentor signup is in 9 days, the same
  day as
  

  :camel:


Unicode 15.0.0 update for Uucd, Uucp, Uunf and Uuseg


  Archive:
  



Daniel Bünzli announced
───

  Unicode 15.0.0 was released on the 13th of september. It adds 4489 new
  characters to the standard.

  Given the increasing contributions from the South Asian subcontinent
  to OCaml we are 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-09-06 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 30 to
September 06, 2022.

Table of Contents
─

Day of the Camel 2022: OCaml in Academia and Industry (online, 9 September 2022)
Advice for combining multiple monads
New OCaml meetup group in Toulouse (in French)
GADTs for tracking dimensions of multidimensional arrays?
ocaml-eris 1.0.0 - Encoding for Robust Immutable Storage (ERIS) (+ Using Zig 
code compiled to WebAssembly from OCaml)
OCamlverse updates
Diskuv OCaml 1.x.x; Windows OCaml installer no longer in preview
Does OCaml infer types between files?
Other OCaml News
Old CWN


Day of the Camel 2022: OCaml in Academia and Industry (online, 9 September 2022)


  Archive:
  



Roberto Blanco announced


  The Day of the Camel 2022 is a one-day hybrid workshop dedicated to
  the OCaml programming language and its industrial users.

  It comprises talks and discussions with members of the OCaml
  development team and companies using the language to solve complex and
  interesting problems.

  We will present a broad picture of the OCaml ecosystem and, more
  widely, of functional programming as a viable and powerful choice for
  building correct and reliable computer systems.

  The event is organized as part of an OCaml summer school at the
  University of Zaragoza, and sponsored by the OCaml Software
  Foundation.

  Participation is free and open to everyone. For more details about the
  schedule, updates and links to the online seminar, see the website:

  

  9 September 2022, all times CEST (UTC+2)

  Morning - Language session

  ━
   09:15-10:00:  Welcome and reception 
 Darío Suárez (CS Department Secretary, University of  
 Zaragoza) 
   10:00-11:00:  Gabriel Scherer (Inria) - The OCaml project and ecosystem 
   
   11:00-11:30:  Break 
   11:30-12:30:  OCaml developers - Round table and Q
  ━

  Afternoon - Industry session

  
   14:30-14:55:  Ulysse Gérard (Tarides)  
  - Building functional systems 
   14:55-15:20:  Nicolás Ojeda Bär (LexiFi)   
  - Modeling language for finance
   15:20-15:45:  Javier Chávarri (Ahrefs) 
  - Petabyte-scale web crawler   
   15:45-16:10:  Grant Passmore (Imandra) 
  - Automated reasoning as a service 
   16:10-16:30:  Break
   16:30-17:30:  Industry speakers - Round table and Q  
  

  We look forward to seeing you there!


Roberto Blanco later added
──

  Quick correction: Paul-Elliot Anglès d’Auriac from Tarides will be
  presenting instead of Ulysse. :slight_smile:


Advice for combining multiple monads


  Archive:
  


Continuing this thread, Raphaël Proust said
───

  In [the Octez project] we have face a similar issue: we use both `Lwt'
  and `Result' pervasively.

  TL;DR:
  • We use dedicated syntax module for each monad (Lwt, result,
Lwt+result) which export binding operators (`let*', `let+',
`return', etc.).
  • We have a Stdlib supplement exposing monadic variants of all the
Stdlib’s traversal functions (like `Lwt_list' but much more
extensive)


[the Octez project] 

Some time ago
╌

  Until not so long ago we used infix operators for bind. And we would
  mix different operators depending on what sub-monad a specific
  expression would be in. So we would have `>>=?' for Lwt+result, `>>?'
  for result-only, and `>>=' for Lwt-only. Plus we had a dedicated
  operator for when you use a result-only expression in an Lwt+result
  context: `>>?='. We don’t need the other specialised binder because
  Lwt-only and Lwt+result mix quite well: `(_, _) result Lwt.t' is just
  a specific case of `_ Lwt.t' 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-08-30 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 23 to 30,
2022.

Table of Contents
─

What’s your development workflow?
Mirage retreat October 3rd - 9th
Experience report: making a JavaScript library from an OCaml library with 
js_of_ocaml
Will I ever understand Format? or How to print a list vertically with 
indentation
GNU Guile 1.0.0 - Bindings to GNU Guile for OCaml
Update on Eio (effects-based direct-style IO for OCaml 5)
OCaml at First Glance
GADTs for typed option getter/setter
shuttle v0.3.1 released
coinductive data types
Old CWN


What’s your development workflow?
═

  Archive:
  


Bozhidar Batsov asked
─

  I’ve started learning OCaml recently and one issue that I struggle
  with is finding a workflow that gives me quick feedback about changes
  I’ve made (I’m looking to reduce compile/run cycles). To give you some
  context - most of the time I’m programming in Lisps and Ruby, where
  it’s relatively easy to modify a running application. With all Lists
  my workflow is:

  • I make some change (e.g. I update some function)
  • I compile the changed bit of code (e.g. a function)
  • I immediately run this with the help of the REPL
  • Based on the results I got I go to the beginning or move on to the
next things that needs doing

  That’s known as [interactive programming] in some circles and I
  totally love it. With Ruby I can’t do the same, but at least with web
  apps there’s some degree of code reloading that allows you modify a
  running app.

  With OCaml, however, I’m not sure how to get the quick feedback, as it
  seems I need to constantly compile and run stuff. I’m trying to work
  like with Lisps - I keep a toplevel open alongside my source code and
  occasionally send some code there, but the toplevel is limited in many
  way (you’re just dumping text there at the global level). `dune utop`
  helps to some extent, but it can’t reload changes. I’ve heard that
  some people were saying they didn’t even use a toplevel, so I’m
  wondering if I’m missing something. I’d be curious to hear any tips
  and tricks from your OCaml workflows.


[interactive programming]



Jack Feser suggested


  Have a look at expectation testing with [ppx_expect]. That’s what I
  use to get this kind of quick feedback (and you can keep the results
  as a test).

  Instead of sending code to a REPL, you write your test in an expect
  block and run `dune runtest'. Anything you print out in the expect
  gets captured, and dune shows you the output as a diff.

  That said, I’ve never had good luck with REPLs, so I might be missing
  something about that workflow.


[ppx_expect] 


Later in the thread, Simon Cruanes said
───

  Any test can be exploratory if they’re expect tests, imho
  :slightly_smiling_face: . The core requirement is to have printers for
  your types (e.g. `ppx_deriving.show'), so you can just create values
  and use
  ┌
  │ Format.printf "my thing is now %a@." pp_thing my_thing;;
  └

  and see the output in dune. There’s a few annoyances (e.g. when it
  crashes you need a bit of elbow grease to get the backtrace) but for
  the most part it’s a nice workflow. I don’t apply it to everything,
  though.


Kiran Gopinathan said
─

  W.r.t to development cycle in OCaml, I find myself working in 3
  distinct ways depending on at which point of a project I am at:

  • *small experiments* - sometimes I need a particular function that
 isn’t provided by the stdlib, or some other bespoke well-defined
 function. In these cases, I write the function directly in the
 source code - using merlin’s typing information etc. to develop as
 usual. Once I’ve done that, just to check the behaviour is as I
 would expect, I copy over the definition to utop - if the function
 depends on any larger state from my project, I write a dummy module
 to mock these parts.
  • *exploring a stateful system* - sometimes, I’m interacting with some
 kind of stateful existing system that can be hard to run in utop
 (for example, it might be a pain to get the library working in
 bytecode) - e.g. gtk. In these cases, I setup a small executable
 module that performs the minimum required to setup the initial
 state, and do my iterative experiments by recompiling after each
 change. Because the module is small, and the OCaml compiler/dune is
 fast, this leads to a quick iterative editing experience.
  • *working on a well-known codebase* - in all other cases, I’m working
 on a codebase that I either know fairly well, or has sufficient
 documentation and typing-discipline to make it easy to understand
 what’s going on. In 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-08-23 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 16 to 23,
2022.

Table of Contents
─

Writing a transpiler from PHP to polyglot PHP+C code
How to speed up this function?
Old CWN


Writing a transpiler from PHP to polyglot PHP+C code


  Archive:
  



Deep in this thread, Olle Härstedt announced


  Made a small prototype here, very standard thing:
  

  Parser and lexer in Menhir, AST that represents the subset PHP lang,
  then I'd have to iterate over it to infer some types, transform to
  polyglot AST and from there to string.

  The one thing to make it more professional would be proper error
  messages for the end user… But you have to carry file and line in the
  AST, right? Maybe I can google around. :thinking:


How to speed up this function?
══

  Archive:
  


Deep in a huge discussion, Yaron Minsky said


  From our perspective at Jane Street, unboxed types is a /very/ high
  priority. A large slice of the team is thinking about it, and Chris
  Casinghino and Richard Eisenberg have joined recently and have it as
  their primary focus, along with Antal.

  In terms of when it makes it upstream, that's less clear. We're
  working hard on getting out some initial versions done, and we plan on
  iterating internally, where it's easier for us to try things out and
  then change them as we go.  Once we have a design that we really
  believe in, we intend to propose it upstream, but how quickly that
  goes (and whether it's successful at all!) depends on whether upstream
  maintainers and the larger community find the improvements compelling.

  In any case, I find this conversation encouraging, since it suggests
  there's some real hunger for improvements in this space.

  I expect ICFP in particular to be a good opportunity for people to
  learn more about the work we're doing both here, and also on type-safe
  stack allocation. (For what it's worth, the latter is already in
  production internally and looks very promising.)

  If you'll be at ICFP:

  • Richard Eisenberg will be giving a [talk on unboxed types] at the ML
workshop
  • Stephen Dolan will be giving a [talk on stack allocation] at the
OCaml Users and Developers Workshop.


[talk on unboxed types]


[talk on stack allocation]



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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-08-16 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 09 to 16,
2022.

Table of Contents
─

Emacs on windows, merlin mode, merlin server remote on linux, tramp, ssh
clangml 4.2.0: OCaml bindings for Clang API (for C and C++ parsing)
opam 2.1.3
Application-specific Improvements to the Ecosystem
Use GitHub CI to build simple binary distribution?
setup-dkml.yml GitHub Actions workflow for distributing binaries
Diskuv OCaml 1.x.x; Windows OCaml installer no longer in preview
Old CWN


Emacs on windows, merlin mode, merlin server remote on linux, tramp, ssh


  Archive:
  



Artem Pianykh said
──

  I managed to set up Emacs + TRAMP + LSP to do remote development (not
  on the first attempt though, as these things were quite fiddly to set
  up).

  Here's what I got:
  1. You need `opam install ocaml-lsp-server' on the remote machine.
  2. Tell TRAMP to use path from the remote shell: `(add-to-list
 'tramp-remote-path 'tramp-own-remote-path)'
  3. Use [Eglot] as an LSP client. Although, `lsp-mode' claims that they
 support remote servers, I couldn't quite make it work with
 `lsp-mode'. This is what I have in my `init.el':
  ┌
  │ (require 'eglot)
  │ (add-hook 'tuareg-mode-hook #'eglot-ensure)
  └


[Eglot] 


clangml 4.2.0: OCaml bindings for Clang API (for C and C++ parsing)
═══

  Archive:
  



Thierry Martinez announced
──

  `clangml.4.7.0' is now in opam, with the bug fixes/features requested
  by @n47 and some others. All LLVM/Clang versions up to 14.0.x are
  supported, as well as OCaml 5.0. The official repo is now on github:
   which should ease
  posting issues and pull requests (and should be more convenient than
  discussions on this thread!).

  Support for the upcoming Clang 15 is planned for the next release that
  should happen soon (the development version already supports Clang
  15).


opam 2.1.3
══

  Archive: 


R. Boujbel announced


  We are pleased to announce minor release of opam [2.1.3].

  This opam release consists of [backported] fixes. You’ll find more
  information in the [blog post].

  To upgrade simply run:

  ┌
  │ bash -c "sh <(curl -fsSL 
https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 
2.1.3"
  └


[2.1.3] 

[backported] 

[blog post] 


Application-specific Improvements to the Ecosystem
══

  Archive:
  



Deep in this thread, Jp R said
──

  Regarding Perl vs OCaml: An (impressive) implementation of all the
  solutions of the Perl Cookbook in the Objective CAML language (used at
  the time) is available here:
  

  Re-writing these examples with "modern" code/libraries could be very
  interesting.


Use GitHub CI to build simple binary distribution?
══

  Archive:
  



Christian Lindig asked
──

  Is there a recommended way (or example) to build a simple binary
  distribution of an OCaml project using the GitHub CI? I am mostly
  interested in building the executables and packaging them in some
  archive format and make that available for download for different
  architectures.


Guillaume Bury replied
──

  I have such a workflow for one of my project, see [this workflow
  file]. It automatically triggers on new releases, builds the project
  with the appropriate compiler (e.g. `flambda'), and uploads the built
  artefact to the release page where it can be downloaded. It currently
  works for both linux and mac (last time I tried it with windows I got
  some errors and I haven't yet had the time to look into that, so i
  don't know if the errors were caused by the workflow, or my project).


[this workflow file]



jbeckford also replied
──

  That was a weird coincidence that I released a GitHub workflow
  

  for this today. 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-08-09 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 02 to 09,
2022.

Table of Contents
─

pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value 
specifications
Interesting OCaml Articles
Logs to a file (a primitive way)
Timedesc 0.8.0 - modern date time handling
OCaml website: Owl book not listed
Application-specific Improvements to the Ecosystem
Other OCaml News
Old CWN


pyml_bindgen: a CLI app to generate Python bindings directly from OCaml value 
specifications


  Archive:
  



Ryan Moore announced


New release
╌╌╌

  Version 0.4.1 is now available from [GitHub] and [Opam].  The [change
  log] has more details.


[GitHub]


[Opam] 

[change log]



New stuff
╌

New attributes
┄┄

  There is a new attribute you can use: `py_arg_name'. It allows you to
  use different argument names on the OCaml side from those that are
  used on the Python side.

  One use case is for Python functions that have an argument name that
  is the same as some reserved OCaml keyword. In this case, you can use
  `py_arg_name' to map it to something else on the OCaml side.

  ┌
  │ val f : t -> method_:string -> unit -> string
  │ [@@py_arg_name method_ method]
  └

  The attribute is followed by two items, the first is the argument name
  on the OCaml side, and the second is the argument name on the Python
  side.

  See the [attributes example] on GitHub for more info.


[attributes example]



Helper scripts
┄┄

  I added a couple of scripts to help in cases where you need to run
  `pyml_bindgen' on a lot of different input files in one go.  I have
  been using them when writing bindings for bigger Python libraries, and
  in cases where there are a lot of cyclic python classes to bind.

  [This] example has more info about using the helper scripts.


[This]



Other stuff
┄┄┄

  • Added an option to split generated modules into `ml' and `mli'
files.
  • Added a dev package for (hopefully) easier installation of
development dependencies.


Interesting OCaml Articles
══

  Archive:
  


Calascibetta Romain announced
─

  Hi, I would like to share my recent article about GADTs and state
  machines: [GADTs and state machine]

  It's another introduction about GADTs and it explains a bit what I did
  for [robur.io]. Eenjoy it and happy hacking!


[GADTs and state machine]


[robur.io] 


Logs to a file (a primitive way)


  Archive:
  


 Marcus Rohrmoser asked
─

  I found
  

  and wonder what a primitive way to log to a file would be.

  I need to keep `stdout' clean and not show any log message under all
  circumstances.


 Marcus Rohrmoser later added
───

  I do a cgi and `stdout' is the response – logging has to go to a
  separate file. Not even `stderr' as I want debug logs not to taint the
  webserver error log in case. And I would like to funnel logging
  through `Logs'.


Yawar Amin suggested and  Marcus Rohrmoser replied


I don't know about `logs' but it should be relatively easy
to keep an open file handle and print log messages there.

   - I like the loglevel
  approach. But maybe I will do without and pass around the channel,
  yes.


Jean Michel suggested
─

  I believe logs support logging to a file via Format. See
  


Shon also suggested
───

  I’ve found logs very ergonomic and easy to work with. I tend to pull
  it in via [Bos], which has a very nice interface to OS
  interactions. Opening the `Bos_setup' module also does default logs
  configuration, and I find all quite painless and pleasant.


[Bos] 


 Marcus Rohrmoser said


  thanks @yawaramin @beajeanm @shonfeder, I 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-08-02 Thread Alan Schmitt
Hello

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

Table of Contents
─

OCaml Software Foundation: summer 2022 update
Old CWN


OCaml Software Foundation: summer 2022 update
═

  Archive:
  



gasche announced


  A quick update on recent works of the [OCaml Software Foundation]. It
  is a non-profit foundation ([earlier thread]) that receives funding
  from [our industrial sponsors] each year, and tries its best to spend
  it to support and strengthen the OCaml ecosystem and community.

  The funding volume we receive each year is around 200K€. (For
  comparison: this is the yearly cost of one experienced full-time
  software engineer in many parts of the world.) We do not fund people
  full-time for long periods. Most actions receive from 3K€ to 20K€.
  The work to prepare and execute actions is mostly done by the (unpaid)
  [Executivee Committee]. It is currently formed by Nicolás Ojeda Bär
  ('nojb'), Damien Doligez, Xavier Leroy, Kim Nguyễn and myself, with
  administrative personel provided by [INRIA].

  Our current sponsors (thanks!) are [ahrefs], [Jane Street], [Tezos],
  [Bloomberg], [Lexifi], [SimCorp], [MERCE] and [Tarides].  (If your
  company would like to join as a sponsor, please [get in touch].
  Unfortunately, we still cannot efficiently process small donations, so
  we are not calling for individual donations.)

  Feel free to use this thread for discussions, questions, suggestions
  and criticism, or to send a message/email for feedback.


[OCaml Software Foundation] 

[earlier thread]


[our industrial sponsors] 

[Executivee Committee] 

[INRIA]


[ahrefs] 

[Jane Street] 

[Tezos] 

[Bloomberg] 

[Lexifi] 

[SimCorp] 

[MERCE] 

[Tarides] 

[get in touch] 

Recent actions
╌╌

  Below are some of the actions that we funded in the last year or so,
  and which have been actively worked on already by the people receiving
  the funding.


Tooling
┄┄┄

  We worked on improving the debugging experience for OCaml by funding
  Fabian ('copy') to work on OCaml symbol demangling in Linux `perf'
  ([thread]), and supporting Yuxiang Wen ('hackwaly')'s work on
  [ocamlearlybird] ([thread]), an OCaml bytecode debugger for vscode.

  We also funded the early development work of [mutaml], a
  mutation-testing prototype by Jan Midtgaard.


[thread]


[ocamlearlybird] 

[thread]


[mutaml] 


Communication
┄

  We decided to fund the time that Alan Schmitt ('brab') spends on the
  [Caml Weekly News] – Alan also started cross-posting them on [reddit]
  on this occasion.

  We funded John Whitington to work on OCaml documentation, on the core
  manual (see in particular [this PR]) or newcomer-oriented content on
  ocaml.org ([Get Up and Running with OCaml] and [A First Hour With
  OCaml]). We also purchased rights to John Whitington's book [OCaml
  from the Very Beginning] to put it [online] ([thread]). This is a good
  introduction to OCaml for people with little to no programming
  experience, and we hope that it will be easier to onboard people if
  they can get a free version online – of course they are encouraged to
  buy a paper copy if they like it and can afford it.

  We supported editing work for an upcoming book from the [Owl] team,
  "Architecture of Numerical Systems", with the requirement that the
  book be Open Access. (The idea followed our attempt to fund a hacking
  retreat for the Owl project in 2019, that was cancelled due to COVID.)

  We are also funding some work to refresh an older book about Caml in
  French, [Le Langage Caml], also available online, which several people
  in the community cite as their favorite OCaml book. Currently we are
  funding Armaël Guéneau to refresh the book's (crufty build system and)
  content to work with current OCaml versions – the book was written in
  1993 for Caml Light – and we are considering funding an English
  translation.


[Caml Weekly News] 

[reddit] 

[this PR] 

[Get Up and Running with 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-07-26 Thread Alan Schmitt
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:
  



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:

  

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

  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:
  



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, 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-07-19 Thread Alan Schmitt
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:
  



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 ]


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

  


  



Video
╌

  


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:
  



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 .

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

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

  

  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.

  

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

  

  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
 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-07-12 Thread Alan Schmitt
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:
  


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:
  



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] 

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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-07-05 Thread Alan Schmitt
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:
  



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:
  


Marcus Rohrmoser announced
──

  just implemented key generation
  


Open Source tooling engineer at Jane Street
═══

  Archive:
  



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:

  


  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]



Dune how to define custom build task


  Archive:
  


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-06-28 Thread Alan Schmitt
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:
  



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-06-21 Thread Alan Schmitt
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:
  



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]


[The OBazl Book] 

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



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


  Archive:
  



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:
  .

  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 (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:
  . 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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-06-14 Thread Alan Schmitt
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: 


Continuing this thread, Raphaël Proust said
───

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

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

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


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

  Archive:
  



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

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

  Not really.

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

  Two other things that come to mind are:

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

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

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

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

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

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


[here] 

[extended the CSS selector syntax]


[700 lines of ml]


[2800 lines of JavaScript]


[extremely unpleasant]



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

  Archive:
  



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

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-06-07 Thread Alan Schmitt
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: 


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:
  


ML Family Workshop 2022: Final Call for Presentations
═

  Archive:
  



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
 (please register your submission
early!)
  • All the details are here:


  • The ML workshop is colocated with ICFP 2022



OCaml Users and Developers Workshop 2022


  Archive:
  


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]



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

  Archive:
  



jbeckford 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-05-31 Thread Alan Schmitt
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: 


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

  License
[MIT]
  Release
[0.0.1]
  Documentation

  Nomadic Labs website

  Tezos ZK-rollups repository



[MIT]


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


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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-05-24 Thread Alan Schmitt
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:
  



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:
  


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
   before the submission deadline.


Dune 3.2.0
══

  Archive: 


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-05-17 Thread Alan Schmitt
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:
  



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:
  


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] 

[gnuplot] 

[documentation] 


Call for Presentations for "Teaching Functional Programming in OCaml" as part 
of the OCaml Workshop 2022


  Archive:
  



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-05-10 Thread Alan Schmitt
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:
  


Deep in this threal, KC Sivaramakrishnan announced
──

  The benchmarks from the "Retrofitting Effect handlers to OCaml" PLDI
  2022 paper () is available here:
  . See
  sections 6.2 and 6.3 in the paper.


He later added
──

  I've moved the microbenchmarks alone to a separate repo:
  . 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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'INRIA.
___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-05-03 Thread Alan Schmitt
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:
  


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] 

[tutorial] 

[ATD input]


[TypeScript output]


[announcement for atdpy]



pp_loc 2.0
══

  Archive: 


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] 

[documentation is available online]


[Pp_loc.Position]



Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0
═

  Archive:
  



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
  


  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
 documentation site. But the
[Beyond Basics] documentation should still be accurate.

  Once those items above are addressed, a 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-04-26 Thread Alan Schmitt
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:
  


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] 

[previous updates] 

[memory model tests for ARMv8 and Power ports]


[effects tutorial] 


OUPS meetup may 2022 (french only)
══

  Archive:
  


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] 

[le site du oups] 

[sont maintenant disponibles] 

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] 


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:
  


Timothy 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-04-18 Thread Alan Schmitt
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: 


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:
  



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]


[docs] 

[examples]



Creating a library for use from JS with js_of_ocaml
═══

  Archive:
  



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:
  


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] 


OCaml summer school in Spain, call for industry speakers


  Archive:
  



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-04-12 Thread Alan Schmitt
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:
  



Alain Frisch announced
──

   [LexiFi] is hiring!

  ✔️ Software Engineer (full-time): 

  ✔️ Software Development Internship: 

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

  Don't hesitate to contact me directly if you want to learn more about
  the positions before applying!


[LexiFi] 


Développeur principal à plein temps d'Alt-Ergo chez OCamlPro


  Archive:
  



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 à:

  cont...@ocamlpro.com

  Pour plus d'informations sur OCamlPro:

  

  Pour plus d'informations sur Alt-Ergo:

  

  Pour plus d'informations sur le Club Alt-Ergo:

  


Using an external JavaScript file in js_of_ocaml


  Archive:
  



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-04-05 Thread Alan Schmitt
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:
  


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] 

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] 


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-03-29 Thread Alan Schmitt
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:
  



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] 

[change log]



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] 

[here]


[here]



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]



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: 


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-03-22 Thread Alan Schmitt
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:
  



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]



Multicore OCaml: February 2022
══

  Archive:
  


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] 

[previous updates] 

[deprecations] 

[multicore monorepo]


[alpha-opam-repository]


[compiler development newsletter]


[ARM64 PR] 

[eio project] 

[robust discussion] 


OCaml 4.14.0, second release candidate
══

  Archive:
  


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
 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-03-15 Thread Alan Schmitt
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:
  


Continuing this thread, Hannes Mehnert announced


  The background article by @rand is now online
  


OCaml TeXmacs plugin


  Archive:
  


Nicolas Ratier announced


  I made a basic OCaml plugin for TeXmacs () I
  would like to keep it simple, but comments and improvements are
  welcome.
  


Release of ocaml-sf/learn-ocaml:0.14.0
══

  Archive:
  



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] 

[the Release Notes ]


[Learn-OCaml bug tracker]


[learn-ocaml.el bug tracker]



Tutorial: Roguelike with effect handlers


  Archive:
  


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:

  


  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
  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-03-08 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of March 01 to 08,
2022.

Table of Contents
─

Ttweetnacl 0.1.0
Dmap : type-safe dependent (heterogeneous) immutable maps
bls12-381.3.0.0
Set up OCaml 2.0.0
Set up OCaml 2.0.1
Load Balancer on FPGA - a Hardcaml Project
Tutorial: Roguelike with effect handlers
Software Engineer Position at beNEXT.io
Sexp_decode: monadic decoders of S-expressions
Robur Reproducible Builds
OCaml compiler development newsletter, issue 5: November 2021 to February 2022
HACL* in OCaml: safe bindings for verified C code using Ctypes
OUPS meetup march 2022 (french only)
VSCode OCaml Platform 1.10.0
Other OCaml News
Old CWN


Ttweetnacl 0.1.0


  Archive: 


Daniel Bünzli announced
───

  It's my pleasure to announce the first release of ttweetnacl.

  Ttweetnacl provides thin bindings to the [TweetNaCl] cryptographic
  library.

  Ttweetnacl has no dependencies. The binding code is distributed under
  the ISC license and the integrated TweetNaCl C code is in the public
  domain.

  The binding has only been lightly used so far. Early adopters should
  pay special attention (or even better, review the binding code :–)

  • Home page: 
  • Docs:  (or `odig doc
ttweetnacl')
  • Install: `opam install ttweetnacl' (once [this] is merged)


[TweetNaCl] 

[this] 


Dmap : type-safe dependent (heterogeneous) immutable maps
═

  Archive:
  



Benoit Montagu announced


  It is my pleasure to announce the release of `Dmap'.

  `Dmap' is an OCaml library that implements dependent (heterogeneous)
  immutable maps. The type of keys is indexed by the type of the
  associated values, so that the maps can contain data whose types may
  depend on the values of keys. It is adapted from the implementation
  code for maps that is used by the [OCaml] standard library.

  For instance:

  ┌
  │ module IntBool = struct
  │   (* The type for the keys of our maps. The index ['a] denotes the type
  │  of the values that will be associated to the keys. In the case of the
  │  [Int] constructor, the map will expect data of type [string]. In the
  │  case of the [Bool] constructor, the map will expect values of type 
[char].
  │   *)
  │   type 'a t = Int : int -> string t | Bool : bool -> char t
  │ 
  │   (* Total order on values of type [_ t]. *)
  │   let compare (type a1 a2) (v1 : a1 t) (v2 : a2 t) : (a1, a2) cmp =
  │ match (v1, v2) with
  │ | Int n1, Int n2 -> if n1 = n2 then Eq else if n1 < n2 then Lt else Gt
  │ | Bool b1, Bool b2 ->
  │ if b1 = b2 then Eq else if (not b1) || b2 then Lt else Gt
  │ | Bool _, Int _ -> Lt
  │ | Int _, Bool _ -> Gt
  │ end
  │ 
  │ (* We create a module of maps whose keys have type [IntBool.t] *)
  │ module IntBoolMap = Dmap.Make(IntBool)
  │ 
  │ (* Definition of a map of type [IntBoolMap.t]. *)
  │ let m = IntBoolMap.(empty |> add (Int 42) "hello" |> add (Bool true) 'A')
  │ 
  │ (* Some queries on the map [m] *)
  │ let () =
  │   assert (IntBoolMap.find_opt (Int 42) m = Some "hello");
  │   assert (IntBoolMap.find_opt (Bool true) m = Some 'A');
  │   assert (IntBoolMap.find_opt (Bool false) m = None)
  └

  This creates a new module `IntBoolMap' , with a new type
  `IntBoolMap.t' of maps from `IntBool.t' to `string' or `char' . As
  specified by the GADT definition of `IntBool.t' , the values
  associated to the keys of the form `Int n' have type `string' , and
  the values associated to the keys of the form `Bool b' have type
  `char' .

  You can install `Dmap' using opam by running `opam install dmap'

  Repository: 


[OCaml] 


Hannes Mehnert asked and Benoit Montagu replied
───

thanks for your release announcement. Did you look into
other similar libraries, and have a perspective how they
are different from dmap? What comes to my mind are [hmap]
and [gmap]. Are there other design goals, or different
performance tradeoffs/guarantees?

  thanks for asking. Here are the differences with [hmap] and [gmap], as
  far as I understand. Please correct me if I misunderstood some parts.

  • [hmap] only supports keys with no contents. In particular, no total
ordering of keys is required. Instead, you can dynamically create
new keys, with the type index that you want. It is fully type-safe
(no `assert false', no `Obj.magic', etc). It does not support (but
maybe it could) a polymorphic `map' function (this requires

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-03-01 Thread Alan Schmitt
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:
  


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] 

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
  .

  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:
  


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-02-22 Thread Alan Schmitt
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:
  


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]


[GitHub for Twist] 


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:
  •  (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:
  



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]


[github repository] 

[API] 

[tutorial] 

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.

  ┌
  │ xxx
  │ xxx
  │ xxx
  │ xxx
  │ 
  │ 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

  ┌
  │ 
  │ 
  │ 
  │ 
  │ pp
  │ 
  │ 
  │ 
  │ x
  └


[Fmlib]



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-02-15 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of February 08 to 15,
2022.

Table of Contents
─

OCaml 4.14.0, second alpha release
Multicore OCaml: January 2022 and post-merge activity
Cmdliner 1.1.0
stdcompat.18: forward compatibility for OCaml 4.14 standard library
Eio 0.1 - effects-based direct-style IO for OCaml 5
OCaml job at genomics company
MirageOS 4.0 Beta Release
VSCode OCaml Platform 1.9.0
ocaml-lsp-server 1.10.0
SiFun1.0.0 released
First release of prbnmcn-dagger
First Release of ppx_pyformat 0.1.1
Caqti 1.7.0
Gg 1.0.0 – Basic types for computer graphics
Old CWN


OCaml 4.14.0, second alpha release
══

  Archive:
  


octachron announced
───

  The release of OCaml 4.14.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
   .

  If you find any bugs, please report them here:

  

  Compared to the last alpha release, we have exceptionally a new
  feature for writing future-compatible early thread exit in 4.14.0 .
  The second notable change is a major fix in the typechecker for
  escaping existential types when using GADTs, that might break existing
  code that relied on the broken types. However, there are currently no
  known instance of package broken by this change in the opam
  repository.  The other fixes are more usual and should be fairly safe.


Changes compared to the first alpha
╌╌╌

  The full list of new features and bug fixes, is available at:

  


New feature
┄┄┄

  • [10951]: Introduce the Thread.Exit exception as an alternative way
to terminate threads prematurely.  This alternative way will become
the standard way in 5.00. (Xavier Leroy, review by Florian
Angeletti)


[10951] 


Major new bug fix
┄

  • [10907], [10959]: Wrong type inferred from existential types
(Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by
Leo White)


[10907] 

[10959] 


New bug fixes
┄

  • *additional fixes* [10596], +[10978]: Add with_open_bin,
 with_open_text and with_open_gen to In_channel and
 Out_channel. Also, add In_channel.input_all. (Nicolás Ojeda Bär,
 review by Daniel Bünzli, Jérémie Dimino, Damien Doligez and Xavier
 Leroy)

  • [10839]: Fix regression of #show when printing class type (Élie
Brami, review by Florian Angeletti)

  • [10836], [10952]: avoid internal typechecker errors when checking
signature inclusion in presence of incompatible types. (Florian
Angeletti, report by Craig Ferguson, review by Gabriel Scherer)


[10596] 

[10978] 

[10839] 

[10836] 

[10952] 


Deprecation fine tuning
┄┄┄

  • *additional fixes* [10675], +[10937]: Emit deprecation warnings when
 old C runtime function names are used.  This will break C stub code
 that uses these old names and treats warnings as errors.  The
 workaround is to use the new names. (Xavier Leroy and David
 Allsopp, review by Sébastien Hinderer and Damien Doligez)


[10675] 

[10937] 


Tools fine tuning
┄

  • [10846]: add the `-shape' command-line option to ocamlobjinfo. When
reading a `cmt' file, shape information will only be shown if that
option is used. (Ulysse Gérard, review by Florian Angeletti)


[10846] 


Installation instructions
╌

  The base compiler can be installed as an opam switch with the
  following commands
  ┌
  │ opam update
  │ opam switch create 4.14.0~alpha2 
--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~alpha2
  └
  If you want to tweak the configuration of the compiler, you can switch
  to the option variant with:
  ┌
  │ opam update
  │ opam switch create  
--packages=ocaml-variants.4.14.0~alpha2+options,
  │ 
--repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └
  or with opam 2.1:
  ┌
  │ opam update
  │ opam switch 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-02-08 Thread Alan Schmitt
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:
  



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

  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:
  


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:
  


  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:
  



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]



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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-02-01 Thread Alan Schmitt
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: 


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] 

[ppx_seq] 


OCaml Labs Joins Tarides


  Archive: 


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/] 


For Diversity and the OCaml Community: Get Involved in Outreachy Summer 2022


  Archive:
  



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
  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-01-25 Thread Alan Schmitt
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:
  



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] 

[PR] 


findlib-1.9.2
═

  Archive:
  


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:

  

  An updated OPAM package will follow soon.


Signals and Threads on Memory Management


  Archive:
  


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


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] 


Yaron Minsky then added

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-01-18 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of January 11 to 18,
2022.

Table of Contents
─

Blog post: Writing a Game Boy emulator in OCaml
Bogue, the OCaml GUI
V3.ocaml.org: getting ready to launch
New release of Windows DKML with system compiler and easy Opam switch creation
Cross-compiling OCaml with GitHub Actions
First announcement of Bechamel
An Update on the State of the PPX Ecosystem and ppxlib's Transition
Become an Outreachy Mentor: support the growth and diversity of the OCaml 
community
Cmon 0.1, a printer that shares
Old CWN


Blog post: Writing a Game Boy emulator in OCaml
═══

  Archive:
  



Lin Oshitani announced
──

  I have written a blog post to share my experience of writing a Game
  Boy emulator in OCaml.

  I will cover things like:
  • Overview of the Game Boy architecture.
  • Using functors to implement testable modules.
  • Using GADTs to encode the Game Boy instruction set.
  • Using test ROMs and `ppx_expect' to implement the emulator in
[_exploratory programming_] style.
  • Finding bottlenecks and improving performance.
  • General thoughts on OCaml.

  Please take a look if you are interested and/or share with anyone who
  might be interested.

  Also, let me know if you have any questions or comments.

  Thanks!

  


[_exploratory programming_]



Bogue, the OCaml GUI


  Archive: 


Deep in this thread, octachron asked


  Looking at the dependencies, I noticed that you also wrote a binding
  to `SDL_ttf'.  I am wondering if it would be enough to provide a
  SDL-based reimplementation of the `Graphics' library (with exactly the
  same interface)? It could be a nice way to have a pedagogical
  graphical API which is just a front-end for a full graphical library.


sanette replied
───

  Yes, I think it would be fairly easy.  Looking at the `Graphics' API,
  the only things that are not included in `SDL~+~SDL_ttf~+~SDL_image'
  are graphics primitives like (filled) ellipses and (filled)
  polygons. One could write bindings to `SDL_gfx' (*) for these, but
  it's more fun to program them directly in `ocaml' ;)

  (*) in fact they already exist, 


V3.ocaml.org: getting ready to launch
═

  Archive:
  


Anil Madhavapeddy announced
───

  In my [previous post this summer] about the upcoming revision of the
  website, I gave an overview of where we were headed and presented a
  roadmap for OCaml's online presence.

  Since August 2021, we've made considerable progress. We're on track to
  launch the website in February 2022 (only a couple of months beyond my
  summer prediction!), and the roadmap after that is becoming clearer
  thanks to all your feedback.

  *You can see it live at , with the package
   search available at [v3.ocaml.org/packages]*

  Let's dive into it!


[previous post this summer]


[v3.ocaml.org/packages] 

Update
╌╌

  Until August 2021, we had been working on the foundations for v3: the
  user flows, sitemap, and the reusable infrastructure for the data used
  in ocaml.org. With all the infrastructure and data ready, our efforts
  since have been focused on completing the frontend.

  One of the clearest priorities we had from community feedback was to
  ensure that the unified package documentation gets to the live site as
  soon as possible. The build process for this is not trivial, as it
  involves combining the outputs of 20,000+ opam packages with the rest
  of the website, while maintaining a reasonable developer experience
  for the main site. We have therefore merged the various frontend and
  backend codebases into a single OCaml-based one.  We've merged the
  NextJS / ReScript / Tailwind codebase to the backend server that
  serves the package documentation.  This has allowed us to consolidate
  our technology stack and simplify our continuous deployment story, but
  also to directly serve the website from a pure OCaml stack (using
  packages from our own community such as Dream and ocaml-tls). We're
  deeply grateful to the ReScript team for the technology that let us
  prototype the new revision of the website so quickly, and to implement
  the templates we're now using.

  Here's an overview of the sitemap and all the pages we've implemented.

  • [Homepage]
• [About]
• [Industrial users]
• 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-01-11 Thread Alan Schmitt
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:
  


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]



Bogue, the OCaml GUI


  Archive: 


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:

  


  


  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] 

[here] 


Cohttp 5.0.0 and 2.5.6
══

  Archive:
  


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]


[2.5.6]


[announced in the previous release]


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] 


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2022-01-04 Thread Alan Schmitt
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:
  



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:
  



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 , )
  │ # 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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-12-28 Thread Alan Schmitt
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:
  


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:

  


Debugger support for OCaml
══

  Archive:
  


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] 

[announcement]


[the demo] 


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]



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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-12-21 Thread Alan Schmitt
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:
  


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:
  

  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.mdo...@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


  • Last October we had a 0.13.0 release, full of new features:


  • For any question related to Learn-OCaml, feel free to create a
discussion topic on  , category
Community, tag /learn-ocaml/.
  • And if need be, opening an issue in
 if of course warmly
welcome as well.


A SOCKS implementation for OCaml


  Archive:
  


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.

  


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] 

[the archive] 

[RSS feed of the archives] 

[online] 

[Alan Schmitt] 

___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-12-14 Thread Alan Schmitt
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:
  


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] 

[poll] 

[opam install kqueue] 

[opam install poll] 

[wepoll] 


SWIPl-OCaml v0.5 - Never write your own unification algorithms again!
═

  Archive:
  



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

  


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

[github mirror] 


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:
   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, 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-12-07 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of November 30 to
December 07, 2021.

Table of Contents
─

New release of Windows DKML with system compiler and easy Opam switch creation
New release: ProVerif 2.04
Liquidshop 2.0 on Jan. 23, 2022!
Announcing our new Outreachy interns
OUPS meetup december 2021
Multicore OCaml: November 2021 with results of code review
New release of Menhir (20211128)
Advent of Code 2021
"What is an Operating System?": Anil Madhavapeddy on Signals and Threads
Other OCaml News
Old CWN


New release of Windows DKML with system compiler and easy Opam switch creation
══

  Archive:
  



jbeckford announced
───

  Version 0.3.0 of [Diskuv OCaml (DKML)] is out. DKML is a distribution
  that, among other things, can do a scripted install of OCaml and a
  Microsoft compiler on Windows. It is in preview right now.

  In an earlier release `with-dkml' was introduced. Placing `with-dkml'
  in front of most OCaml tools will let those tools transparently have
  access to Unix binaries and the Microsoft compiler (examples: 1. `dune
  build' -> `with-dkml dune build'; 2. `opam install' -> `with-dkml opam
  install'; or 3. `with-dkml bash' opens a Unix environment in the
  current Windows directory).

  Now if you upgrade to 0.3.0 you get more:
  • There is a new Opam plugin bundled that will create a Windows local
switch. You can just do `mkdir playground', `cd playground' and
`opam dkml init' to create a new switch configured with Windows code
repositories and the Microsoft compiler. Thanks to @kit-ty-kate for
writing the [opam-build] plugin which helped in understanding how
Opam plugins work, and @dbuenzli for [many OCaml packages] leveraged
in both the plugin and with-dkml.
  • The 4.12.1 OCaml compiler and runtime are installed once to the
"system", which means that if you create an Opam local switch the
OCaml compiler+runtime do not have to be recompiled. The huge waste
of time doing recompilation is now gone. All credit goes to @dra27
who created scripts in Opam that do almost the same thing. *There
will be a generally available Windows OCaml system compiler sometime
next year (that is, you won't need DKML), so consider the DKML
version to be an early and temporary preview of the Windows system
compiler.*

  Links:

  • [Installation instructions for the latest version]. Copy and paste
one block of commands, press OK when prompted, and 2 hours later
your installation will have finished.
  • [Release notes for all versions including **upgrade instructions**]
  • [Send a bug report] and/or [Stay updated on Twitter]

  Known issues:

  • Installing from mainline China frequently errors out. A short term
fix is available at
[https://gitlab.com/diskuv/diskuv-ocaml/-/issues/6#note_726814601]


[Diskuv OCaml (DKML)] 

[opam-build] 

[many OCaml packages] 

[Installation instructions for the latest version]


[Release notes for all versions including **upgrade instructions**]


[Send a bug report]


[Stay updated on Twitter]


[https://gitlab.com/diskuv/diskuv-ocaml/-/issues/6#note_726814601]



New release: ProVerif 2.04
══

  Archive:
  


Bruno Blanchet announced


  Vincent Cheval and I are happy to announce a new release of ProVerif,
  version 2.04.  ProVerif is an automatic security protocol verifier
  that relies on the symbolic model of cryptography.

  ProVerif is available at [http://proverif.inria.fr] It is also
  available via opam (see installation instructions in Section 1.4 of
  the manual  )

  Version 2.04 is mainly a bugfix release but it also contains a change
  that may require minor changes in your input files: nested comments
  are supported, so if you open a comment several times and close it
  once, this is now an error.

  Changes:
  • Improved optimisation transforming mess facts into attacker facts
when the channel is a public term and not only a public name.
  • Allow nested comments in the input file. All comments must be
closed. ProVerif will raise an error otherwise.
  • Allow "let x = t in" construct inside the declarations of reduc and
equation.
  • Fixed bug in subsumption: 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-11-30 Thread Alan Schmitt
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:
  



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] 

[opam 2.1.1] 

[opam-depext 1.2]


[blog post ] 


OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and 
pretty-printing library
══

  Archive:
  



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: 


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:

  • 

  Enjoy,

  François Pottier
  francois.pott...@inria.fr
  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-11-22 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of November 16 to 23,
2021.

Table of Contents
─

Multicore OCaml: October 2021
Robur Reproducible Builds
OCaml compiler development newsletter, issue 4: October 2021
How do you read the lines of a text files…
WebAuthn - Web Authentication
Set up OCaml 2.0.0-beta9
Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
opam build and opam test: the opam plugins that simplifies your dev setup
Twenty Years of OCaml Weekly News
Old CWN


Multicore OCaml: October 2021
═

  Archive:
  


Anil Madhavapeddy announced
───

  Welcome to the October 2021 [Multicore OCaml] monthly report! The
  [previous updates] along with this update have been compiled by me,
  @ctk21, @kayceesrk and @shakthimaan.

  As @octachron announced last month, the core team has [committed to an
  OCaml 5.0 release] next year with multicore and the effects runtime.
  This month has seen tremendous activity in our multicore trees to
  prepare an upstream-friendly version, with a number of changes made to
  make the code ready for `ocaml/ocaml' and reduce the size of the
  diff. Recall that we have been feeding in multicore-related changes
  steadily since way [back in OCaml 4.09], and so we are now down to the
  really big pieces.  Therefore the mainline OCaml trunk code is now
  being continuously being merged into our 5.00 staging branch, and test
  coverage has increased accordingly.

  In the standard library, we continue to work and improve on thread
  safety by default. Since effect handlers are confirmed to go into 5.0
  as well, they now have their own module in the stdlib as well. The
  multicore library ecosystem is also evolving with the changes to
  support OCaml 5.00, and in particular, Domainslib has had significant
  updates and improvements as more usecases build up. The integration of
  the Sandmark performance harness with current-bench is also actively
  being worked upon.

  We would like to acknowledge the following people for their
  contribution:
  • Török Edwin was able to reproduce the bug in `Task.pool' management
[Domainslib#43], and has also provided a PR to fix the same.
  • Sid Kshatriya has created [PR#83] for `Eio' to use the Effect
Handlers module.

  Our focus in November is going to continue to be on relentlessly
  making a 5.0 staging tree, and we are preparing for a series of
  working groups with the core OCaml teams (taking up an entire week) to
  conduct preliminary code review on the full patchset. Stay tuned for
  how that has gone by the start of December!

  As always, the Multicore OCaml updates are listed first, which contain
  the upstream efforts, merges with trunk, updates to test cases, bug
  fixes, and documentation improvements. This is followed by the
  ecosystem updates on Domainslib, `Tezos', and `Eio'. The Sandmark and
  current-bench tasks are finally listed for your reference.

  /Editor’s note: the very long release notes can be found by following
  the archive link above./


[Multicore OCaml] 

[previous updates] 

[committed to an OCaml 5.0 release]


[back in OCaml 4.09]


[Domainslib#43]


[PR#83] 


Robur Reproducible Builds
═

  Archive:
  


Reynir Björnsson announced
──

Robur Reproducible Builds
╌

  Over the past year we in [Robur] have been working towards easing
  deployment of reproducible mirage applications. The work has been
  funded by the Eurepean Union under the [Next Generation Internet (NGI
  Pointer) initiative]. The result is [available as a website].

  The overall goal is to push MirageOS into production in a trustworthy
  way. We worked on reproducible builds for MirageOS - with the
  infrastructure being reproducible itself. A handful of core packages
  are hosted there (described below in this article), next to several
  ready-to-use MirageOS unikernels - ranging from [authoritative DNS
  servers] ([secondary], [let's encrypt DNS solver]), [DNS-and-DHCP
  service (similar to dnsmasq)], [TLS reverse proxy], [Unipi - a web
  server that delivers content from a git repository], [DNS resolver],
  [CalDAV server], and of course your own MirageOS unikernel.

  Reproducible builds are crucial for supply chain security - everyone
  can reproduce the exact same binary (by using the same sources and
  environment), without reproducible builds we would not 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-11-16 Thread Alan Schmitt
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:
  



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

  

  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:
  



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] 

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


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] 


ocaml-wayland (pure OCaml wayland protocol library)
═══

  Archive:
  



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:

  


[version 1.0]



Set up OCaml 2.0.0-beta6


  Archive:
  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-11-09 Thread Alan Schmitt
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:
  



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]



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:
  


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-11-02 Thread Alan Schmitt
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:
  



Anil Madhavapeddy announced
───

  *This note does not concern the main OCaml email list, which continues
  to be available through *

  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]



Talk at Func Prog Sweden


  Archive: 


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.

  

  [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
  



[Wolfram System Modeler] 


First OPAM releases of Scad_ml and [@@deriving scad]


  Archive:
  



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

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-10-26 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of October 19 to 26,
2021.

Table of Contents
─

OCaml MOOC, third edition
Release of ocaml-sf/learn-ocaml:0.13.0
First release of `conan', the detective to recognize your file
Software Engineer Position at OCamlPro (France)
New version of Try OCaml
Well Typed Router (wtr, wtr-ppx) v3.0.0 released
containers 3.6
ocaml-annot for binary annotations
shuttle v0.3.1 released
Generating static and portable executables with OCaml
"Parsing" terms into a well-typed representation: a GADT puzzle
Old CWN


OCaml MOOC, third edition
═

  Archive: 


Alain announced
───

  


Release of ocaml-sf/learn-ocaml:0.13.0
══

  Archive:
  



Continuing this thread, Vincent Laviron announced
─

  The video is up:
  

  The talk is in French with English slides.


First release of `conan', the detective to recognize your file
══

  Archive:
  



Calascibetta Romain announced
─

Conan, an OCaml detective to recognize your file


  I'm glad to announce the first experimental release of [`conan']. This
  tool/library helps us to recognize the [MIME type] of a given
  file. More concretely, `conan' is a reimplementation of the command
  `file':
  ┌
  │ $ file --mime image.png
  │ image/png
  └

  This tool was made to replace our old [ocaml-magic-mime] project which
  recognizes the type of the MIME type of the given file _via_ its
  extension and a static database. However, a security problem remains:
  `ocaml-magic-mime' trusts on the user's input.

  The MIME type of a file is *not* a user's input (like the file
  name). It's a property of the file itself. A more secure way to
  recognize the type of the file is to introspect contents and compare
  it with a given database to possibly recognize the MIME type.

  So, `file' and specially `libmagic' work like that. They have a
  `magic' database which describes some magic numbers about some
  formats. Then, they traverse contents of the given file and compare
  inner values with what its expected from a certain MIME type.


[`conan'] 

[MIME type] 

[ocaml-magic-mime] 


The goal of Conan / `ocaml-magic-mime'
╌╌

  The main problem with this approach is the inherent assumption that we
  manipulate a file from a file-system. However, as we said many times,
  MirageOS does not have, at first, a file-system (but you can add one
  if you want).

  This is why we made `ocaml-magic-mime' to be able to recognize MIME
  type of _something_ (a file, a simple `string', a stream, etc.).

  You are probably wondering why we need to recognize the MIME type?

  In many protocols such as HTTP or emails, we are able to transfer
  files. The usual way is to let the sender tell the MIME type of the
  transfered files. A concrete example is the `Content-Type' field used
  by HTTP. Indeed, it tells the client the MIME type of the given
  document - and by this way, the client is able to open this document
  with the right application.

  This is where `libmagic' comes in and tries to recognize the MIME type
  as the part of the request's processes of the server to transfer an
  image for example.

  We aim to have less and less C codes, so we started to re-implement
  `file' as our tool to recognize files and let our HTTP server inform
  the MIME type to the client. Then, instead of trusting the extension
  of the given file and our database, we started to propose something
  _more secure_.

  Finally, we took the opportunity to re-use the existing database
  (under the 2-clause BSD license) for our project (and provide a simple
  tool `conan.file' which does the same thing than `file'). So the
  challenge was to enable to parse and process this database - and
  create a little DSL in OCaml to describe format of files.


Into MirageOS
╌

  With this DSL, we are able to serialize a given database (as the
  `libmagic' database) as a simple OCaml value which can be linked to a
  larger program such as an unikernel. In this way, we are able to
  create a full unikernel which is able to recognize MIME type of some
  contents.

  The goal is bigger than that because such little piece of software, as
  we said, is used by many protocols. Of 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-10-12 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of October 05 to 12,
2021.

Table of Contents
─

Release of ocaml-sf/learn-ocaml:0.13.0
Release of odoc 2.0.0
The road to OCaml 5.0
Become an Outreachy Mentor: support the growth and diversity of the OCaml 
community
Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
first release of osh: 
first release of pyast
Multiple open positions (postdoc, PhD, intern) on runtime verification at CEA 
LIST, France
Postdoc position in Effect Handler Oriented Programming
OCaml compiler development newsletter, issue 3: June-September 2021
Odig 0.0.7, lookup documentation of installed OCaml packages
OCaml Café: Wed, Oct 13 @ 1pm (U.S. Central)
Multicore OCaml: September 2021, effect handlers will be in OCaml 5.0!
Alcotest 1.5.0
Other OCaml News
Old CWN


Release of ocaml-sf/learn-ocaml:0.13.0
══

  Archive:
  



Erik Martin-Dorel announced
───

  We are very pleased to announce the immediate availability of the
  latest stable release of [Learn-OCaml], version `0.13.0'.

  Many thanks to all users and developers that reported bugs,
  contributed features or patches ✨ and in particular, special thanks
  go to @yurug and @AltGr for their precious advice and help during the
  preparation of this release.

  A (mostly) comprehensive list of the features, fixes, and enhancements
  offered by this release is available in [the Release Notes].

  Beyond this list of changes, note that:

  • We now switch to *semantic versioning*, so that this version is
git-tagged `v0.13.0' and not just `0.13'.
  • The REST API did *not* change (between the previous stable version
0.12 and version 0.13.0).
  • The *"exodir" format* has been slightly extended (but the
[documentation online] of these changes is not yet up-to-date),
keeping a strong focus on backward-compatibility (see e.g. [PR #397]
for related remarks).
  • All the main *binaries of Learn-OCaml* (`learn-ocaml-client',
`learn-ocaml', and the native `learn-ocaml-server') are now
statically built and available in the [*Release page*], for Linux
and macOS.
  • The whole codebase of Learn-OCaml has been ported to *OCaml 4.12*
(including the toplevel environment that is exposed to students).
  • We now *relax the coupling between client/server*, and commit to
*keeping backward-compatibility* for the latest `learn-ocaml-client'
w.r.t. the previous versions (so, `learn-ocaml-client.0.13.0' can
interact with servers `learn-ocaml.{0.12, 0.13.0}' smoothly − see
[PR #426] for context).
  • The `learn-ocaml-client' CLI API did not change, except that a
command *`learn-ocaml-client server-version'* has been added, to
distinguish between the server version and the (possibly more
recent) `learn-ocaml-client --version' (see [PR #429] for details).
  • Docker images are still available on [*Docker Hub*], e.g., to easily
spin a local server from a repository exercises, you can do:
┌
│ sudo docker run --name=server-test -v 
"$PWD/demo-repository:/repository:ro" \
│   -p 8080:8080 ocamlsf/learn-ocaml:0.13.0
└
More details on the Docker setup can be found in [How to deploy a
learn-ocaml instance].
  • (If you migrate from `0.12' to `0.13.0' in your deployments, beware
that the mere bump of OCaml's version may cause some of your graders
to fail.)
  • A [dedicated PR] has also been opened in *opam-repository*.
  • As noted above, several architectural changes have been done about
the `learn-ocaml-client' as this tool plays a
  key "pivot" role, for students that would like to use
  *Tuareg+Merlin+[learn-ocaml-mode]* and interact with a Learn-OCaml
  server backend directly from Emacs (and thus benefit from the
  advantages of both Merlin and Learn-OCaml's exercise grading feature).

  We hope to be able to release 0.14.0 soon, specifically to integrate
  the pending PR [#372] that will solve a [long-running issue] with
  auto-`Sync' and students-code overwriting; and we also plan to extend
  learn-ocaml's backend and REST API soon to further enhance the UX of
  *learn-ocaml.el*, at least to lift [this limitation] (for which we
  have a working proof-of-concept to be refined).

  If need be, feel free to open issues in the [Learn-OCaml bug tracker
  (GH)] or post in this thread to share thoughts or experience-feedback.


[Learn-OCaml] 

[the Release Notes]


[documentation online]


[PR #397] 

[*Release page*] 

[PR #426] 

[PR 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-10-05 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of September 28 to
October 05, 2021.

Table of Contents
─

What's a usage pattern for existential type variables?
Multicore OCaml: September 2021, effect handlers will be in OCaml 5.0!
Développeur-euse oCaml - CDI Geneanet - Paris
OCaml 4.13.1, a small and early regression fix version
Set up OCaml 2.0.0-beta5
Liquidsoap 2.0.0
OCaml code snippets proposed as CC-BY-SA 4.0 candidates
Old CWN


What's a usage pattern for existential type variables?
══

  Archive:
  



hyphenrf asked
──

  Online, (Scala/Java) and Haskell-specific tutorials on existential
  types seem to be dominant. Because I wouldn't get stuck too much on
  notation, I went with Haskell tutorials, and they all seem to imply
  that *existentials that are unconstrained are useless*.

  The usual example for existentials is information (but not trait)
  hiding, in which for example you can have a definition like so (with
  some syntax parallels for those unfamiliar with haskell):
  ┌
  │ {-
  │ ocaml: ~type gadt = Constr : typexpr~
  │ haskell: ~data Gadt where Constr :: typexpr~
  │ -}
  │ 
  │ data Hidden where
  │   Hide :: Show a => a -> Hidden
  │ 
  │ {-
  │ ocaml: iter (fun (Hide x) -> ...) [Hide 1; Hide ...]
  │ -}
  │ 
  │ main :: IO ()
  │ main =
  │   mapM_ (\(Hide x) -> print x) [Hide 1, Hide "a", Hide 4.2]
  └

  The problem with such implication is that I can't find a usage for an
  existential introduced by an OCaml GADT because I don't know how I'd
  express the `Show a => a' constraint.
  ┌
  │ type hidden = Hide : 'a -> hidden
  └
  Would simply completely cloak `'a', and any attempt at interacting
  with it would produce a type scope escaping error.

  That considered, since `Show a => a' is best emulated now with passing
  a first-class module, that was the vector I was walking in with my
  existentials experiments, but I have a feeling there's better, more
  valid, usage of those type variables that isn't reliant on
  constraining.

  So my question is, have you ever come across a pattern where an
  existential type variable is the solution?


octachron replied
─

  Your showable example can be written as:
  ┌
  │ type showable = Show: 'a * ('a -> string) -> showable
  └
  And there is fact many similar way to constraint existential types,
  either using type constructors: if you have an `'a. 'a t', you may
  still be able to write useful functions, or coupling various producers
  or consumers of the existential types.

  The `showable' example is a little artificial here but that are many
  examples where existential types are useful for:
  • representing internal types.
  • hiding some type information at an abstraction barrier.

  I can offer one examples that combines the two to implement a zipper
  through mutually recursive trees.  Starting from a simplified data
  structure
  ┌
  │ type a_tree =
  │   | Leaf of int
  │   | Node_A of b_tree * b_tree
  │ and b_tree =
  │   | Leaf of float
  │   | Node_B of a_tree * a_tree
  └
  Then zipper over a binary tree would be simply:
  ┌
  │ type dir = Left | Right
  │ type zipper = { value: tree; path: (dir * tree) list }
  └
  but here our problem is that we have alternatively `a_tree' and
  `b_tree'. We can use existential types to keep a similar
  representation as the simpler zipper described above. The first step
  is to describe a step in the data structure as
  ┌
  │ type ('a,'b) step =
  │   | A: dir * b_tree -> (b_tree,a_tree) step
  │   | B: dir * a_tree -> (a_tree,b_tree) step
  └
  Then we can connect the step using an existential types to describe
  that if we have a path from nodes of type `top' to a node of type
  `bottom', we don't necessarily know the intermediary types
  ┌
  │ type ('bottom,'top) path =
  │   | []: ('top,'top) path
  │   | (::):
  │   ('bottom , 'previous_bottom) step * ('previous_bottom,'top) path ->
  │ ('bottom,'top) path
  └

  Then a zipper is simply:
  ┌
  │ type ('bottom,'top) zipper = { value: 'bottom; path:('bottom,'top) path }
  └
  However, sometime we don't care if we don't know where we are in the
  tree, thus we may need to erase the `bottom' information from the
  zipper:

  ┌
  │ type 'top any_zipper = Any: ('bottom, 'top) zipper -> 'top any_zipper
  └
  and we can still use this `any_zipper' type to write an `up' function
  for instance:
  ┌
  │ let up (type top) (Any z: top any_zipper) =
  │   match z.path with
  │   | [] -> Any z
  │   | A (Left,r) :: rest ->
  │ Any { path=rest; value = Node_A(z.value,r) }
  │   | B (Left,r) :: rest ->
  │ Any { path=rest; value = Node_B(z.value,r) }
  │   | A (Right,l) :: rest ->
  │ Any { path=rest; value = Node_A(l, z.value) }
  │   | B (Right,l) :: rest ->

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-09-28 Thread Alan Schmitt
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:
  



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'] 

[`js_of_ocaml'] 

[API docs and manuals] 

[release notes]



Become an Outreachy Mentor: support the growth and diversity of the OCaml 
community
═══

  Archive:
  



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

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



OCaml 4.13.0 (and 4.12.1)
═

  Archive: 


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:

  • 

  and there:

  • 


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] 

[Announcing Tezos’ 8th protocol upgrade proposal: Hangzhou]

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-09-21 Thread Alan Schmitt
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:
  



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]



Hardcaml MIPS CPU Learning Project and Blog
═══

  Archive:
  



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]


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


[conclusion blog post]



Puzzling through some GADT errors
═

  Archive:
  


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] 


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:
  


UnixJunkie announced


  There is now an implementation using multicore-OCaml in the 'domains'
  branch.

  

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-09-14 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of September 07 to
14, 2021.

Table of Contents
─

opam-grep: search through the sources of all the packages in opam-repository
The OCaml 4.13 preview for Merlin is now available
Outreachy Summer 2021
http-cookie v4.2.0
Dune 2.9.1
MDX 1.11.0
OCaml 4.13.0, first release candidate
New release: ProVerif 2.03
ocaml-lsp-server 1.8.0
Multicore OCaml: August 2021
Higher-kinded bounded polymorphism
OCaml Workshop 2021: Live Stream
Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
Old CWN


opam-grep: search through the sources of all the packages in opam-repository


  Archive:
  



Kate announced
──

  [opam-grep] is an opam plugin that greps through the sources of all
  opam packages.

  To install it, simply call:
  ┌
  │ $ opam install opam-grep
  └
  Then to use it, simply call:
  ┌
  │ $ opam grep "your regexp"
  └
  /Side note/: currently opam-grep will cache the sources in your cache
  directory (`~/.cache/opam-grep'), so a few GB of available disk space
  is most likely required.

  I hope this can help core compiler and community library devs alike,
  to know which part of their software is used in the wild.


[opam-grep] 


The OCaml 4.13 preview for Merlin is now available
══

  Archive:
  



Kate announced
──

  Over the past previous OCaml releases the release-readiness team tried
  its best to make most packages, and especially core OCaml packages
  (dune, merlin, ppxlib, …) available day one so people can have the
  smoothest transition possible to the new compiler release.

  Today I'm announcing that merlin (arguably the trickiest core tool to
  port to new releases, and the most indispensable) is now available to
  install for early adopters of OCaml 4.13.

  To install the latest OCaml 4.13 beta together with Merlin simply
  call:
  ┌
  │ $ opam switch create 4.13 --formula='"ocaml-base-compiler" {>= "4.13" & < 
"4.14"}'
  │ $ opam install merlin
  └
  The package is still an early preview. If you encounter any problems
  while using merlin, please feel free to report it directly in
  

  All of the [OCaml core packages] (with the exception of ocaml-lsp,
  hopefully [soon]) should be available out-of-the-box. If some packages
  aren't available yet, opam-alpha-repository should have you covered:
  ┌
  │ $ opam remote add alpha 
git://github.com/kit-ty-kate/opam-alpha-repository.git
  └

  If you have any questions or remarks feel free to ask them here.


[OCaml core packages]


[soon] 


Outreachy Summer 2021
═

  Archive: 


Patrick Ferris announced


  This summer the OCaml community rebooted its participation in
  Outreachy "…a diversity initiative that provides paid, remote
  internships to people subject to systemic bias and impacted by
  underrepresentation in the technical industry where they are living".

  We had the pleasure of working with three talented interns over 13
  weeks this summer on projects relating to v3.ocaml.org.  Each intern
  has summarised their experience in a blog post that we'd like to share
  with you.

  *A quick reminder, if you are interested in mentoring for the OCaml
   community in the next round, please [read this post] and [apply with
   your project]. The project submission deadline is Sept. 23, 2021 at
   4pm UTC.*


[read this post]


[apply with your project]


A Graphql Endpoint for Packages on OCaml.org


  One of the centre-pieces for the ocaml.org revamp is [centralised docs
  for every version of every opam package]. With all of this information
  it would be useful to expose an API for exploring the packages. This
  is exactly what Odinaka Joy worked on and is live now at
  v3.ocaml.org/graphiql! For more information [have a read of the
  accompanying blog post].


[centralised docs for every version of every opam package]


[have a read of the accompanying blog post]



A Modern Front-end for OCaml.org


  Another goal of v3.ocaml.org was to modernise the design and 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-09-07 Thread Alan Schmitt
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: 


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:
  

  ┌
  │ 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:
  



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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-08-31 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of August 24 to 31,
2021.

Table of Contents
─

First beta release of OCaml 4.13.0
Windows-capable Diskuv OCaml 0.1.0
v3.OCaml.org: A roadmap for OCaml's online presence
Software engineer at Wolfram MathCore
memprof-limits (first official release): Memory limits, allocation limits, and 
thread cancellation, with interrupt-safe resources
OCaml Workshop 2021: Live Stream
Goodbye Core_kernel
Old CWN


First beta release of OCaml 4.13.0
══

  Archive:
  


octachron announced
───

  The release of OCaml 4.13.0 is getting closer.

  The set of new features has been stabilized, and core opam packages
  already work with this release (see
  ). 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 here:

  

  The full release of OCaml 4.13.0 is currently planned for 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~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 switch
  to the option variant with:
  ┌
  │ opam update
  │ opam switch create  
--packages=ocaml-variants.4.13.0~beta1+options,
  │ 
--repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └
  where `' 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~beta1+flambda+nffa
  │ 
--packages=ocaml-variants.4.13.0~beta1+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 beta release is also available at these
  addresses:

  • 


Changes since the last alpha release


  • [10549]: Stack overflow detection and naked pointers checking for
ARM64 (Xavier Leroy, review by Stephen Dolan)

  • [10442], [10446]: Fix regression in the toplevel to #directory
caused by corrections and improvements to the Load_path in
[9611]. #directory now adds the path to the start of the load path
again (so files in the newly added directory take priority).  (David
Allsopp, report by Vasile Rotaru, review by Florian Angeletti and
Nicolás Ojeda Bär)

  • [10450], [10558]: keep %apply and %revapply primitives working with
abstract types. This breach of backward compatibility was only
present in the alpha releases of OCaml 4.13.0 .  (Florian Angeletti,
review by Thomas Refis and Leo White)

  • [10380]: Correct handling of UTF-8 paths in configure on Windows
(David Allsopp, review by Sébastien Hinderer)

  • [10543]: Fix Ast_mapper to apply the mapping function to the
constants in "interval" patterns `c1..c2'.  (Guillaume Petiot,
review by Gabriel Scherer and Nicolás Ojeda Bär)

  • [10550], [10551]: fix pretty-print of gadt-pattern-with-type-vars
(Chet Murthy, review by Gabriel Scherer)

  • [10497]: Styling changes in the post-processed HTML manual (webman)
(Wiktor Kuchta, review by Florian Angeletti)


[10549] 

[10442] 

[10446] 

[9611] 

[10450] 

[10558] 

[10380] 

[10543] 

[10550] 

[10551] 

[10497] 


Windows-capable Diskuv OCaml 0.1.0
══

  Archive:
  


jbeckford announced
───

  I am pleased to announce the first preview release of the /Diskuv
  OCaml/ ("DKML") distribution. Parts of the [diskuv / diskuv-ocaml
  README.md] are reproduced below:

  /Diskuv OCaml/ is an OCaml distribution focused on a) secure,
  cross-platform software development and b) ease of use for language
  learners and professional 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-08-24 Thread Alan Schmitt
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:
  


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 -
  


[routes] 

[#115] 

[@Chattered] 

[#118] 

[#129] 

[@Lupus] 

[#121] 

[#123] 

[tests]


[small demo]


[here] 


Feather 0.3.0
═

  Archive: 


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] 

[documentation]


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]



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) 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-08-17 Thread Alan Schmitt
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:
  



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]


[multipart_form] 

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


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:

  • Keynote:

-
  • ICFP 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:
  


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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-08-10 Thread Alan Schmitt
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: 


Raphaël Proust announced


  We are glad to announce the release of version 5.4.2 of Lwt: a
  bugfix-only release.

  

  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:
  


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


[Duties]


  • Moderating the text chats
  • Controlling microphones in the video-conferencing
  • Watching for the time
  • Performing sound checks
  • Welcoming and otherwise guiding participants


[Duties] 


opam 2.1.0!
═══

  Archive: 


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] 

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

[pre-releases changelogs] 


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] 


containers 3.5
══

  Archive: 


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] 

[here] 


Short contract job for OCaml/C++ programmer
═══

  Archive:
  


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.

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-08-03 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of July 27 to August
03, 2021.

Table of Contents
─

OCaml Café: Wed, Aug 4 @ 7pm (U.S. Central)
Do You Need `ppxlib' and `ocaml-migrate-parsetree' in the Same Project?
first release of FASMIFRA (a molecular generator)
Become an Outreachy Mentor: support the growth and diversity of the OCaml 
community
Alt-Ergo 2.4.1
Set up OCaml v1.1.12
Set up OCaml 2.0.0-beta3
JSOO build integration with JS front-end project?
Multicore OCaml: July 2021
Old CWN


OCaml Café: Wed, Aug 4 @ 7pm (U.S. Central)
═══

  Archive:
  


Michael Bacarella announced
───

  Reminder: this is in 2 days!


Do You Need `ppxlib' and `ocaml-migrate-parsetree' in the Same Project?
═══

  Archive:
  



Sonja Heinze announced
──

  Hello PPX users (directly or transitively),

  I'd like to discuss here in this thread if there's still a demand to
  use `ppxlib' and `ocaml-migrate-parsetree.1.x' (`OMP1') in the same
  project. Yesterday, I posted here on discuss about the state of the
  PPX ecosystem and [pointed out that the public PPX ecosystem has
  almost completely shifted to `ppxlib'].  Still, we'd like to know your
  perspective on this question. Have you lately run into a problem due
  to the incompatibility between `ppxlib' and `OMP1'? Did you formerly
  have such problems but lately all the PPXs you use have already been
  ported to `ppxlib'? These questions are directed to any OCaml user, so
  please comment any details on this post and point out which PPXs were
  involved. Thanks in advance!

  The rest of this post gives some more context about why we're asking
  these questions now in case folks are interested, but it's not needed
  for the discussion we'd like to have about the questions stated above.


[pointed out that the public PPX ecosystem has almost completely shifted
to `ppxlib']


Some Context


  The next `ppxlib' release `0.23.0' will contain the integration of
  `Astlib' and therefore will drop its dependency on
  `ocaml-migrate-parsetree' (`OMP'). Now we need to decide if to mark
  `OMP1' as a conflict for `ppxlib' in opam or not.

  To give more background, the PPX ecosystem is [transitioning to be
  more up-to-date].  The three contextually relevant states of this
  transition are:
  1. `ppxlib' depends on `OMP < 2.0.0'. The PPX driver is in `OMP'.
  2. `ppxlib' depends on `OMP >= 2.0.0'. The PPX driver is in `ppxlib'.
  3. `ppxlib' doesn't depend on `OMP' anymore. It uses its internal /
 the compiler library `Astlib'. The PPX driver is in `ppxlib'.

  During State 1, you can use `ppxlib' PPXs and `OMP1' PPXs in the same
  project. During State 2, `ppxlib' opam conflicts with `OMP1'. During
  State 3, if we leave everything as-is, you can install both `ppxlib'
  and `OMP1' for the same project. But also during State 3, you're
  unable to use `ppxlib' PPXs and `OMP1' PPXs in the same library or
  executable because if your build system uses a PPX driver, the PPX
  driver needs to be unique. Now we need to decide whether to leave the
  conflict between `ppxlib' of State 3 and `OMP1' at the level of the
  build system or to lift it up to the package manager by making `OMP1'
  an opam conflict for `ppxlib'. Both options have their pros and cons,
  which have already been somewhat discussed on [the corresponding
  PR]. To sum them up:


[transitioning to be more up-to-date]


[the corresponding PR] 

Option 1: not making `OMP1' a conflict for `ppxlib'
┄┄┄

  *Advantage*: You would be able to use `ppxlib' PPXs and `OMP1' PPXs in
  the same project, but they still can't be used together inside the
  same library or executable.

  *Disadvantage*: If you use several PPXs inside the same library or
  executable, there's no direct guarantee that you and your users
  install compatible versions of the PPXs for the build system. To
  guarantee that, you'd have to add certain dependency constraints to
  your opam file. We would make sure the way to define those dependency
  constraints would be well documented and could be found easily.


Option 2: making `OMP1' a conflict for `ppxlib'
┄┄┄

  *Advantage*: Without adding any dependency constraints yourself, opam
  will ensure that you and your users don't install 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-07-27 Thread Alan Schmitt
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:
  



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'] 

[here] 


OCaml+Opam Images for Docker for Windows


  Archive:
  



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 , 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_.

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-07-20 Thread Alan Schmitt
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:
  


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:

  

  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] 


OTOML 0.9.0 — a compliant and flexible TOML parsing, manipulation, and 
pretty-printing library
══

  Archive:
  



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:  GitHub:
  

  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] 

[TOML 1.0-compliant] 

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] 


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  at line 1 at column 7 (position 7)",
  │{Toml.Parser.source = ""; 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 = 
  │ 
  │ utop # Toml.Lenses.(get toml_data (
  │   key "this" |-- table
  │   |-- key "is" |-- table
  │   |-- key "a" |-- table
  │   |-- key "deeply" |-- table
  │   |-- key "nested" |-- table
  │   |-- key "table" |-- table

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-07-06 Thread Alan Schmitt
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:
  



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.

  


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:

  


  


  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:
  )
  and some aspects of the separation of concerns weren't so well
  established.


[gitlab] 

[github mirror] 


u2f - universal second factor
═

  Archive:
  


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
   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 
  – 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:
  


Hannes Mehnert announced


  we are pleased to announce reproducible binary images for MirageOS
  unikernels (see the blog post at
  ). The binaries are located at
   (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
   is used that adds some
 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-06-29 Thread Alan Schmitt
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:
  


Gerd Stolpmann announced


  I'd like to announce a new project to develop a code generator that
  emits WebAssembly:

  

  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 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-06-22 Thread Alan Schmitt
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:
  



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 

  Feedback, contributions and downloads are very welcome!


[dirsp-exchange] 


Job offer: 3 year research engineer in static analysis of OCaml programs at 
Inria Rennes


  Archive:
  



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:
  

  Please feel free to transfer this announce to people that you think
  could be interested.


IRC channels available on libera.chat
═

  Archive:
  


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:
   And used for
  #mir...@irc.libera.chat

  It's a nice example about MirageOS/unikernel and I may deploy one to
  save 

[cwn] Attn: Development Editor, Latest OCaml Weekly News

2021-06-15 Thread Alan Schmitt
Hello

Here is the latest OCaml Weekly News, for the week of June 08 to 15,
2021.

Table of Contents
─

Dependency visualization tool
Multicore OCaml: May 2021
First release of Popper
Orsetto: structured data interchange languages (release 1.1)
Old CWN


Dependency visualization tool
═

  Archive:
  


Chet Murthy announced
─

  In the past, I've found doing this sort of dependency-graphing to be
  very useful for figuring out where modularization in a large system
  needs to be applied.  And it's not very hard to do, based on ocamldep
  output or other dependency information that already exists.

  On a lark, I wrote something that did this for installed findlib
  packages: 

  I mention this not to plug the tool, but rather, just to note that
  it's really easy, and yeah, people should avail themselves of this
  more.


Multicore OCaml: May 2021
═

  Archive: 


Anil Madhavapeddy announced
───

  Welcome to the May 2021 [Multicore OCaml] monthly report! This month's
  update along with the [previous updates] have been compiled by @avsm,
  @ctk21, @kayceesrk and @shakthimaan.

  Firstly, all of our upstream activity on the OCaml compiler is now
  reported as part of the shiny new [compiler development newsletter #2]
  that @gasche has started. This represents a small but important shift
  – domains-only multicore is firmly locked in on the upstream roadmap
  for OCaml 5.0 and the whole OCaml compiler team has been helping and
  contributing to it, with the [GC safe points] feature being one of the
  last major multicore-prerequisites (and due to be in OCaml 4.13 soon).

  This multicore newsletter will now focus on getting our ecosystem
  ready for domains-only multicore in OCaml 5.0, and on how the
  (not-yet-official) effect system and multicore IO stack is
  progressing.  It's a long one this month, so settle in with your
  favourite beverage and let's begin :-)


[Multicore OCaml] 

[previous updates] 

[compiler development newsletter #2]


[GC safe points] 

OCaml Multicore: 4.12.0+domains
╌╌╌

  The multicore compiler now supports CTF runtime traces of its garbage
  collector and there are [tools to display chrome tracing
  visualisations] of the garbage collector events. A number of
  performance improvements (see speedup graphs later on) that highlight
  some ways to make best use of multicore were made to the existing
  benchmarks in Sandmark.  There has also been work on scaling up to 128
  cores/domains for task-based parallelism in domainslib using [work
  stealing deques], bringing us closer to Cilk-style task-parallel
  performance.

  As important as new features are what we have decided _not_ to
  do. We've been working on and evaluating Domain Local Allocation
  Buffers (DLABs) for some time, with the intention of reducing the cost
  of minor GCs. We've found that the resulting performance didn't match
  our expectations (_vs_ the complexity of the change), and so we've
  decided not to proceed with this for OCaml 5.0.  You can find the
  [DLAB summary] page summarises our experiences. We'll come back to
  this post-OCaml 5.0 when there are fewer moving parts.


[tools to display chrome tracing visualisations]


[work stealing deques]


[DLAB summary]



Ecosystem changes to prepare for 5.0.0 domains-only
╌╌╌

  As we are preparing 5.0 branches with the multicore branches over the
  coming months, we are stepping up preparations to ensure the OCaml
  ecosystem is ready.


Making the multicore compilers available by default in opam-repo


  Over the next few week, we will be merging the multicore
  4.12.0+domains and associated packages from their opam remote over in
  [ocaml-multicore/multicore-opam] into the mainline
  opam-repository. This is to make it more convenient to use the variant
  compilers to start testing your own packages with ~Domain~s.

  As part of this change, there are two new base packages that will be
  available in opam-repository:

  • `base-domains': This package indicates that the current compiler has
the `Domain' module.
  • `base-effects': This package indicates the current 

  1   2   3   4   >