[cwn] Attn: Development Editor, Latest OCaml Weekly News
Alan Schmitt
alan.schmitt at polytechnique.org
Tue Jan 24 00:57:00 PST 2023
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:
<https://discuss.ocaml.org/t/blog-the-growth-of-the-ocaml-binary-distribution/11202/1>
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:
<https://ocamlpro.com/blog/2023_01_02_ocaml_distribution>
Hope it can be interesting to read !
Ocaml 5.0.0 in Pyre - mostly smooth sailing, Gc.stat regression
═══════════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ocaml-5-0-0-in-pyre-mostly-smooth-sailing-gc-stat-regression/11205/1>
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]
<https://github.com/facebook/pyre-check/commit/d10dec43ccd1489657d3325898cec3508d45d47e>
[a call to Gc.stat]
<https://github.com/facebook/pyre-check/commit/91eba63147d202fd272c15d01da0d39c3c1a71fc>
Adopting the OCaml Code of Conduct
══════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/adopting-the-ocaml-code-of-conduct/10870/2>
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 -
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/c/c4ae62cab555531e63740d5a6949cc68ceda103e.gif>
[ocaml/ocaml] <https://github.com/ocaml/ocaml/pull/11761>
[ocaml/dune] <https://github.com/ocaml/dune/pull/6875>
[ocaml/opam] <https://github.com/ocaml/opam/pull/5419>
Esperanto, when OCaml meets Cosmopolitan
════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-esperanto-when-ocaml-meets-cosmopolitan/10501/3>
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]
<https://github.com/dinosaure/esperanto/releases/tag/v0.0.2>
[is pending] <https://github.com/ocsigen/lwt/pull/945>
[an issue] <https://github.com/ocaml/dune/issues/6843>
[Bob] <https://bob.osau.re>
[here]
<https://builds.osau.re/job/bob/build/ac20dfce-58b5-4b81-9e53-4fd11f484064>
[here] <https://blog.osau.re/articles/reproducible.html>
Looking for Participants for User Survey on ocaml.org Package Documentation and Learn Area
══════════════════════════════════════════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/looking-for-participants-for-user-survey-on-ocaml-org-package-documentation-and-learn-area/11128/36>
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
interest of getting a good overview of the userbase, Claire will
select people and send out invites.
Summary:
╌╌╌╌╌╌╌╌
17 people are using OCaml for personal projects, 7 for business
purposes, and 6 use OCaml for research purposes.
We have a good mix of junior and senior software development and
research roles, as well as organisations of varying sizes and a broad
mix of tasks people work on. I do not list these individually.
Pain points / package documentation:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
• Missing content from odoc-generated package documentation: preamble,
images, guides/tutorials not visible on the navigation
• Lack of search / indexed navigation
• Need to be able to link to the latest version of a package to write
good package documentation in READMEs
• Problems with the rendering of documentation of modules included
within another module.
• Problems with white space, font size, layout and color, and
accessibility e.g. scaling up the page gives the mobile layout
• Documentation link on package over view page is hard to spot
• Lack of “jump to source code”-links
• Lack of proper dark mode
• Lack of syntax highlighting for OCaml code in the text - authors
would be more encouraged to add examples if they rendered
beautifully
• Tree view can get very busy for packages with lots of items
◊ Ideas/suggestions package documentation:
• Tree navigation should be improved, e.g. library vs toplevel module
should be consolidated, hiding other libraries when going down into
a module should be removed
• Index for declarations (values, types, exceptions, etc.) of a module
could be displayed in place of the empty TOC / appended to the TOC
◊ Problems with content and documentation writing experience:
• Lack of example code, quality of documentation on package docs
displayed on ocaml.org
• UI/UX of odoc for writing package documentation could be improved
• hard to incorporate ocamldoc and markdown when writing documentation
Workarounds / package documentation:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
• inspect source code
• odig, sherlocode.com, opam grep
• look at package’s tests
• search in forums, StackOverflow, look for links to package author’s
documentation site in package’s public git repository
Pain points / learning section:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
• Layout/scroll problems on <https://ocaml.org/doc>. People need to
scroll too much to see the content. Scrolling down the page does not
show the tutorials and guides section, scrolling down the navbar on
the left it is hard to scroll down to “common error messages”, “best
practices” and “OCaml platform”
• Accessibility problems w/visual contrast
• Difficulty level/prerequisites of tutorials not always clear
• Lack of important content (e.g. “single-page syntax introduction”,
dune and opam guide, task-oriented examples for different levels of
language learning)
• Styling difference between manual/stdlib API and main pages
• “Standard Library API” link goes to the index instead of to Chapter
28 of the OCaml manual (manual gives a more adequate introduction to
the standard library for beginners and does not expose internal
functions like the automatically generated index does)
• Problems with outdated information
◊ Pain points overall:
• Site doesn’t motivate people enough to use OCaml by showing how
OCaml is cool, interesting, nice to use and how using it makes you a
better programmer
◊ Ideas/suggestions learning section:
• The more basic sections, e.g. if statements, pointers, could be
merged or made collapsible to make it easier to see all items on the
side navigation
• “Papers” section is not so relevant to most OCaml beginners and
should be moved below “Books”
• Have a “beginner”/“advanced” toggle at the top of the learn page
that switches the content area to be tailored better to the
different use cases
• add more context on who should read a particular book (e.g.
prerequisites, topics covered)
◊ Workarounds learning section:
• directly go to the manual
• books, blogs, other sites
• ask on forum/discord/StackOverflow
• check ocamlverse
Tbh, this took a bit longer than I thought: there is so much useful
info in your feedback! I want to add links to corresponding issues,
but this will have to wait until I edit this post tomorrow.
OCaml Software Foundation: January 2023 update
══════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ocaml-software-foundation-january-2023-update/11217/1>
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.
(Previous update: [summer 2022].)
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, Alan Schmitt and
myself, with administrative personel provided by [INRIA]. (Alan
Schmitt is a new member this year, he agreed to work as an “interim
director” from September to March to reduce my own Foundation workload
a bit. Thanks Alan.)
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 questions/suggestions :-)
[OCaml Software Foundation] <http://ocaml-sf.org/>
[earlier thread]
<https://discuss.ocaml.org/t/ann-the-ocaml-software-foundation/4476>
[our industrial sponsors] <http://ocaml-sf.org/#sponsors>
[summer 2022]
<https://discuss.ocaml.org/t/ocaml-software-foundation-summer-2022-update/10234>
[Executivee Committee] <http://ocaml-sf.org/about-us/>
[INRIA]
<https://en.wikipedia.org/wiki/French_Institute_for_Research_in_Computer_Science_and_Automation>
[ahrefs] <https://ahrefs.com/>
[Jane Street] <https://janestreet.com/>
[Tezos] <https://tezos.com/>
[Bloomberg] <https://bloomberg.com/>
[Lexifi] <https://lexifi.com/>
[SimCorp] <https://simcorp.com/>
[MERCE] <https://www.mitsubishielectric-rce.eu/>
[Tarides] <https://tarides.com/>
[get in touch] <http://ocaml-sf.org/becoming-a-sponsor/>
Recent actions
╌╌╌╌╌╌╌╌╌╌╌╌╌╌
◊ Outreach
The OCaml Foundation is funding the OCaml User Meeting in Paris, which
recently [celebrated its 10th anniversary]. We are interested in
supporting OCaml meetups and events all over the world, please let us
know if you are organizing something.
We will also sponsor the 2023 edition of ICFP, the International
Conference on Functional Programming. It is the academic conference
that hosts the OCaml Workshop, and is attended by research and
industrial users of many of our neighbor languages (Haskell, F#,
Scala, Erlang, Rust, etc.).
[celebrated its 10th anniversary]
<https://discuss.ocaml.org/t/10-years-of-oups-meetup-january-2023/11140>
◊ Community
We worked a few years ago on trying to build a group of OCamlers to
establish a Code of Conduct (CoC) that could be adopted by interested
organizations within the OCaml community, but this effort was on hold.
We funded Sudha Parimala to rebuild this “code of conduct committee”
and deliver a Code of Conduct that could be adopted.
Sudha and the committee members (who are not paid by the Foundation
for their work) [proposed] a CoC text, received a ton of (sometimes
tense) feedback from the community, and iterated to get a final
version that was felt acceptable by most members of the community, and
is already adopted by several organizations (including this Discuss).
This was a delicate, controversial effort, and it is too soon to say
if has really made our community stronger yet, but we hope that it
will be the case and were impressed by the work of Sudha Parimala and
the committee members (currently: Louis Roché, Marcello Seri, Raja
Boujbel, Simon Cruanes and Sonja Heinze).
See the [OCaml code of conduct] repository for more details.
[proposed]
<https://discuss.ocaml.org/t/ocaml-community-code-of-conduct/10494/1>
[OCaml code of conduct] <https://github.com/ocaml/code-of-conduct>
◊ Ecosystem
We are currently (partially) supporting the work of several
contributors to the OCaml ecosystem, including:
• Jonah Beckford and his [Diskuv OCaml distribution] for Windows,
• Daniel Bünzli for many ongoing contributions to the OCaml ecosystem,
• Kiran Gopinathan for [Gopcaml-mode] and other contributions to the
ecosystem,
• Antonio Montero’s work on [Melange],
• Zach Shipko on [ocaml-rs], and
• Petter Urkedal on [Caqti].
[Diskuv OCaml distribution]
<https://diskuv-ocaml.gitlab.io/distributions/dkml/index.html>
[Gopcaml-mode] <https://gitlab.com/gopiandcode/gopcaml-mode>
[Melange] <https://github.com/melange-re/melange>
[ocaml-rs] <https://github.com/zshipko/ocaml-rs>
[Caqti] <https://github.com/paurkedal/ocaml-caqti/>
An Emacs mode for Cram tests
════════════════════════════
Archive:
<https://discuss.ocaml.org/t/an-emacs-mode-for-cram-tests/11221/1>
Kiran Gopinathan announced
──────────────────────────
Hi all! Recently I’ve been playing with tests, and have fallen in love
with dune’s cram tests :heart:
As I wasn’t able to find any support for it elsewhere, I’ve written a
small Emacs mode to highlight cram tests to make it a little easier to
distinguish between comments, commands and outputs:
<https://gist.github.com/Gopiandcode/b17e15b09c28e70aa18453a1658021dc>
Here’s what it looks like:
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/3/319945ff15cdd2c61f591a092618921fee824422.png>
There’s probably some things that I’m not doing properly w.r.t to
Emacs conventions, but I’ve found it works well enough for my
usecases.
Aside: Cram tests really are awesome! I think they’re the best method
of writing tests that I’ve found in OCaml, and I’m only saddened that
I didn’t try it earlier! The ease of creating new tests (simply a new
file, no boilerplate needed), updating expected outputs (`dune runtest
--autopromote'), enabling a result to be tested (simply make sure it
has a conversion to string – no need to hassle around with deriving
equality etc.) are leagues above the other approaches I’ve used so
far.
My current approach to testing my projects - (so far, mainly
SQL-backed applications), is to first write a runner binary that calls
the appropriate library functions based on its arguments and prints
the result (sometimes I generate this programmatically from the types
of my APIs), and then write cram tests to document the different
interactions between calls that I expect. Especially when interacting
with Lwt, I’ve found my cram tests to be far more readable than the
corresponding unit tests that I might write with Alcotest.
Taking a look: some open OCaml Pull Requests
════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/taking-a-look-some-open-ocaml-pull-requests/11222/1>
Lukasz Stafiniak said
─────────────────────
Hi! Coming back to OCaml after 7+ years, today I decided to look at
the open PRs to see where the language is headed. Maybe someone finds
it useful. I’m mostly omitting Stdlib changes. These stood out to me:
1. [Bidirectional type checking]: more type propagation during
inference, improves autocompletion (e.g. for OO code).
2. [Monadic syntax for `match']. Also: [Jane Street not using binding
operators, but the old PPX] ← is it still true? [The `let' syntaxes
are not fully made use of].
3. Bigarray: [free] and [overlap].
4. Unwind-protect mechanism [`Fun.with_resource'] → in draft.
5. Built-in syntax [Promote constructors to functions] → contested use
of curried functions.
6. [Unique types] to make more abstract types work well with GADTs
7. [Modular explicits], modular implicits without the implicit
application part. This has the power of first-class functors, but
with much more concise syntax, avoids explicit signatures, and
allows local type annotations like `let f {module M : S} (x : M.t)
= x'
8. MetaOCaml: [reserve `>.'], [syntax for `.<e>.', `.~e'],
[pprintast], [support for `.<e>.', `.~e'].
9. [“Subtyping syntax” for modules] enables things like `include (M :>
S)'.
10. [Half-precision floats in `Bigarray'].
11. [`Atomic.modify'].
12. [~let.op x = ~ bindings] parameterized by the `op', complementing
the current `let+ x =' and `let* x =' binding syntaxes.
13. [OCaml memory model] documentation.
14. [Turn keywords to identifiers] (mainly for backward
compatibility).
15. [Serialize `Random.State.t'].
16. Built-in syntax [Promote fields to functions].
[Bidirectional type checking] <https://github.com/ocaml/ocaml/pull/285>
[Monadic syntax for `match'] <https://github.com/ocaml/ocaml/pull/1955>
[Jane Street not using binding operators, but the old PPX]
<https://github.com/ocaml/ocaml/pull/1955#issuecomment-1090468356>
[The `let' syntaxes are not fully made use of]
<https://github.com/ocaml/ocaml/pull/2122>
[free] <https://github.com/ocaml/ocaml/pull/389>
[overlap] <https://github.com/ocaml/ocaml/pull/8618>
[`Fun.with_resource'] <https://github.com/ocaml/ocaml/pull/8962>
[Promote constructors to functions]
<https://github.com/ocaml/ocaml/pull/9005>
[Unique types] <https://github.com/ocaml/ocaml/pull/9042>
[Modular explicits] <https://github.com/ocaml/ocaml/pull/9187>
[reserve `>.'] <https://github.com/ocaml/ocaml/pull/10130>
[syntax for `.<e>.', `.~e'] <https://github.com/ocaml/ocaml/pull/10131>
[pprintast] <https://github.com/ocaml/ocaml/pull/10132>
[support for `.<e>.', `.~e'] <https://github.com/ocaml/ocaml/pull/11871>
[“Subtyping syntax” for modules]
<https://github.com/ocaml/ocaml/pull/10612>
[Half-precision floats in `Bigarray']
<https://github.com/ocaml/ocaml/pull/10775>
[`Atomic.modify'] <https://github.com/ocaml/ocaml/pull/10798>
[~let.op x = ~ bindings] <https://github.com/ocaml/ocaml/pull/10979>
[OCaml memory model] <https://github.com/ocaml/ocaml/pull/10995>
[Turn keywords to identifiers]
<https://github.com/ocaml/ocaml/pull/11252>
[Serialize `Random.State.t'] <https://github.com/ocaml/ocaml/pull/11329>
[Promote fields to functions]
<https://github.com/ocaml/ocaml/pull/11407>
odep initial release
════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-odep-initial-release/11236/1>
Simmo Saan announced
────────────────────
I’m glad to announce the initial release of [odep] – dependency graphs
generator for OCaml modules, libraries and packages.
Some months ago I was frustrated with the lack of such modern tool
([list of similar ones I found]) and decided to code up [one universal
tool that covers all the use cases (xkcd reference)]. After interest
from the community, I have now made a proper release of the tool on
opam.
[odep] <https://github.com/sim642/odep>
[list of similar ones I found]
<https://github.com/sim642/odep#other-tools>
[one universal tool that covers all the use cases (xkcd reference)]
<https://xkcd.com/927/>
Example
╌╌╌╌╌╌╌
Running `odep dune | dot -Tsvg' in the project’s own repository
produces the following comprehensive graph. It shows modules in the
project itself, clustered by dune libraries, and other findlib
libraries, clustered by opam packages. This information is gathered
and combined from `dune describe workspace --with-deps', findlib and
opam.
[dune-odep.svg]
See [README on GitHub] for more usage examples.
[dune-odep.svg]
<https://raw.githubusercontent.com/sim642/odep/master/img/dune-odep.svg>
[README on GitHub] <https://github.com/sim642/odep#examples>
Old CWN
═══════
If you happen to miss a CWN, you can [send me a message] and I’ll mail
it to you, or go take a look at [the archive] or the [RSS feed of the
archives].
If you also wish to receive it every week by mail, you may subscribe
[online].
[Alan Schmitt]
[send me a message] <mailto:alan.schmitt at polytechnique.org>
[the archive] <https://alan.petitepomme.net/cwn/>
[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>
[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>
[Alan Schmitt] <https://alan.petitepomme.net/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/caml-news-weekly/attachments/20230124/44167174/attachment.htm>
More information about the caml-news-weekly
mailing list