caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alan Schmitt <>
To: "lwn" <>, "cwn"  <>,
Subject: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News
Date: Tue, 07 Sep 2021 15:23:55 +0200	[thread overview]
Message-ID: <> (raw)

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


Here is the latest OCaml Weekly News, for the week of August 31 to
September 07, 2021.

Table of Contents

Just reinvented OOP 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

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

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))
  │     |> snd
  │   | [| start; finish |] ->
  │     List.to_iter ls
  │     |> Iter.zip_i
  │     |> Iter.drop_while (Pair.fst_map ((>) start))
  │     |> Iter.take_while (Pair.fst_map ((>) finish))
  │     |> 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))
  │     |> snd
  └──── A roadmap for OCaml's online presence


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
        [ ] for some things (eg best
        practices, community) but the (to me) most valuable
        feature is missing: The ecosystems overview, where I can
        find packages sorted thematically. Could such a section
        also have a place in the packages subpage somewhere?
        Alternatively, maybe opam can allow to “tag” packages in
        the future so one could see all packages for graphics,
        databases etc.

  The styling of the /packages sub-URL does indeed differ from the main
  design, but this is simply due to a temporary technical detail. The
  majority of the site uses React/NextJS to generate the frontend, and
  this uses the now-trendy medium-contrast colours and also features
  like fast-page-switching that NextJS offers.  However, the
  documentation portion generated around 2.7 million individual pages
  when run across the full opam repository, and so we restored to
  dynamic generation of the content for that. What's going to happen
  next is a rationalisation of the code across the ReScript and OCaml
  frontends so that there will be no observable difference in the colour
  schemes across the full site.

  Regarding creating a categorised list of recommendations, that is
  absolutely in scope for the v3 iteration of the site. However, this
  metadata should ideally live in the opam-repository (for example,
  using `tags' as you suggest, which opam already supports). If anyone
  would like to have a go at this, I'd encourage PRs to the
  opam-repository to add the relevant tag metadata for a
  codex. Meanwhile, @lambda_foo @tmattio and @patricoferris are working
  on the core OCaml Platform workflow information for the guides section
  of the website which will cover opam, merlin, lsp-server, dune and so

        Do we have access to all of the previous years’ workshops
        to add to []?  I can see pieces of 2015,
        2017, 2020 and this year. @avsm

        Is it possible to add the ML Workshop as well?

  Absolutely. The has held up nicely after the OCaml
  Workshop, so I think it's in good shape to populate with more
  videos. This needs a volunteer to help us upload the past [nine years]
  of videos from YouTube to If anyone wants to have a
  go, please message me and I'll create you an account.

        It’s a bit unclear what you meant in this paragraph. Does
        that mean that you plan to kill the ocaml planet ? I would
        find it a little bit sad.

        One of the reason why you may feel it doesn’t work well
        may be that it has been constantly broken in the current
        version of the site…

  I'm not sure why you think the current new feed has been
  broken – it's been working fairly reliably for the past decade. The
  only real problem came up a few times when a feed's domain expired and
  got taken over by domain squatters, at which point we got spam into
  the main page of

  What I meant with that part of the announcement is that the
  syndication feed should not be mistaken with original news on the
  website. Right now it's difficult to distinguish official
  announcements (such as compiler or opam releases) as they are a little
  scattered (e.g. on The plan is to combine the
  [platform-blog] with the new website directly. I've also been
  considering just having a special tag on this forum so that nice
  announcement posts could also be syndicated to the website easily (for
  example, @gasche's compiler newsletters).

  My general desire is to _grow_ the planet feed and syndication system,
  but to clearly demarcate them as not being published by and
  to manage them via more modern decentralised techniques that feature
  spam, moderation and archival. PeerTube is a good example of this for
  videos that is working well, and I'd welcome suggestions for Atom/RSS
  (there must be something in this space, ideally ActivityPub-based).

  Depending on how the experiments go, it's very likely that we'll have
  a Matrix homeserver for where CI bots can report status
  information (see this [prototype PR]) for ocaml-ci that will also
  apply to opam-repository. The goal here is to for to publish
  its data using an open protocol, which can then be syndicated into
  whatever technologies are in vogue (e.g. Discord, Slack, Teams, …).

  So if you spot some decentralised syndication system that you think
  might be interesting for OCaml, please do let me know.  Even better,
  if you'd like to develop one to tailor it to our needs, let me know
  even sooner ;-)

[packages landing page ] <>

[ ] <>

[] <>

[nine years] <>

[platform-blog] <>

[prototype PR] <>

Become an Outreachy Mentor: support the growth and diversity of the OCaml community


Anil Madhavapeddy announced

  There's been a very disappointing response to this call for mentors to
  increase the diversity of our community. Precisely *noone* has been in
  touch for the winter call, leaving the burden of mentorship on the
  same people that did all the work this summer.

  Before making [new calls for programs like GSoC], let's get Outreachy
  onto more sustainable ground please. We are purely limited by
  mentorship time at present. This can be as simple as organising new
  first issues for projects in the ecosystem, and all the way to pair
  programming with a mentee. You can chose how to be involved.

[new calls for programs like GSoC]

Generating static and portable executables with OCaml


OCamlPro announced

  It has been a few times now that we have been tasked to generate
  portable binaries for different projects. Over time, we have gathered
  quite some know-how and, seeing the question frequently arise in the
  community, we decided to share this experience.

  You can find the article written by Louis Gesbert on[ the OCamlPro

        Distributing OCaml software on opam is great (if I dare
        say so myself), but sometimes you need to provide your
        tools to an audience outside of the OCaml community, or
        just without recompilations or in a simpler way.

        However, just distributing the locally generated binaries
        requires that the users have all the required shared
        libraries installed, and a compatible libc. It's not
        something you can assume in general, and even if you don't
        need any C shared library or are confident enough it will
        be installed everywhere, the libc issue will arise for
        anyone using a distribution based on a different kind, or
        a little older than the one you used to build.

        There is no built-in support for generating static
        executables in the OCaml compiler, and it may seem a bit
        tricky, but it's not in fact too complex to do by hand,
        something you may be ready to do for a release that will
        be published. So here are a few tricks, recipes and advice
        that should enable you to generate truly portable
        executables with no external dependency whatsoever. Both
        Linux and macOS will be treated, but the examples will be
        based on Linux unless otherwise specified.

  Don't hesitate to share your thoughts with us, have a good reading!

[ the OCamlPro blog]

OCaml quant-developer at Bloomberg. London or New York


Philip Craig announced

  Extend a financial contracts DSL that is implemented in OCaml.

  It's London or New York based. It's not a remote position.

  Please see details and/or apply at

HTTP client library

  Archive: <>

Hannes Mehnert announced

  we just released to the opam-repository the [`http-lwt-client']
  package, which consists of both a library doing HTTP requests and a
  binary (`hurl') that does HTTP requests.

  The code is based on [HTTP/AF] and [H2], and uses [tls] for HTTPS
  connections. Both HTTP/1(.1) and HTTP/2 protocols are supported. The
  motivation behind this package is to have a http client that has a
  reasonably small dependency cone, is purely implemented in OCaml, and
  uses the asynchronous task library lwt.

  This package uses [happy-eyeballs] to connect to a remote host via
  IPv4 and IPv6, as proposed by IETF [RFC 8305]: on any computer with
  either IPv4 or IPv6 connectivity, a remote IPv6 or IPv4 server will be
  connected. Preference is given to IPv6.

  If a https url is provided, the server certificate is verified using
  the [ca-certs] package.

  If you experience any issues or have further needs for this package,
  please report an issue on the GitHub issue tracker.

  The installation is just an `opam install http-lwt-client' away :)

[`http-lwt-client'] <>

[HTTP/AF] <>

[H2] <>

[tls] <>

[happy-eyeballs] <>

[RFC 8305] <>

[ca-certs] <>

Hannes Mehnert later added

  now [0.0.2] is released that unifies the response type and API
  (previously it was a variant and clients had to write code for both
  HTTP1 and HTTP2). Now, a single record and Status/Headers/Version
  module aliases are provided (very close to HTTP/AF). Enjoy.

[0.0.2] <>

Other OCaml News

From the ocamlcore planet blog

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

  • [Goodbye Core_kernel]
  • [Tarides Engineers to Present at ICFP 2021]
  • [Benchmarking OCaml projects with current-bench]
  • [What the interns have wrought, 2021 edition]

[OCaml Planet] <>

[Goodbye Core_kernel] <>

[Tarides Engineers to Present at ICFP 2021]

[Benchmarking OCaml projects with current-bench]

[What the interns have wrought, 2021 edition]


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

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

  [Alan Schmitt]

[send me a message] <>

[the archive] <>

[RSS feed of the archives] <>

[online] <>

[Alan Schmitt] <>

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

             reply	other threads:[~2021-09-07 13:24 UTC|newest]

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

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:

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

  git send-email \ \ \ \ \ \

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