From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from Hermes.metastack.local (172.16.0.8) by Hermes.metastack.local (172.16.0.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17 via Mailbox Transport; Tue, 17 Jan 2023 08:38:47 +0000 Received: from Hermes.metastack.local (172.16.0.8) by Hermes.metastack.local (172.16.0.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 17 Jan 2023 08:38:47 +0000 Received: from exchange.romulus.metastack.com (172.16.0.21) by Hermes.metastack.local (172.16.0.8) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.2507.17 via Frontend Transport; Tue, 17 Jan 2023 08:38:47 +0000 Received: from romulus.metastack.com ([172.16.0.20]) by exchange.romulus.metastack.com (8.14.2/8.14.2) with ESMTP id 30H8c4N8022811 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Jan 2023 08:38:04 GMT Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id 30H8bsXD022794 for ; Tue, 17 Jan 2023 08:37:54 GMT Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 17 Jan 2023 09:37:51 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id D1619E034E; Tue, 17 Jan 2023 09:37:52 +0100 (CET) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8241BE016E for ; Tue, 17 Jan 2023 09:37:45 +0100 (CET) Received: from mx1.polytechnique.org ([129.104.30.34]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 09:37:43 +0100 Received: from mac-03220211.irisa.fr (mac-03220211.irisa.fr [131.254.21.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 8C1A3564A5B; Tue, 17 Jan 2023 09:37:43 +0100 (CET) From: Alan Schmitt To: lwn , cwn , "caml-list@inria.fr" Subject: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News Thread-Topic: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News Thread-Index: AQHZKk8e5q1706wcgES7TiuaQv3dyw== Sender: "caml-list-request@inria.fr" X-MS-Exchange-MessageSentRepresentingType: 2 Date: Tue, 17 Jan 2023 08:37:43 +0000 Message-ID: Keywords: Sent to dra-news@metastack.com,MetaStack - Lists,MetaStack List-Help: List-Subscribe: List-Unsubscribe: Reply-To: Alan Schmitt Content-Language: en-GB X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-AuthSource: Hermes.metastack.local X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-Network-Message-Id: 39265420-1e92-493d-f112-08daf866406c X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 x-scanned-by: MIMEDefang 2.65 on 62.31.23.242 received-spf: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@sympa.inria.fr) identity=helo; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="caml-list-owner@inria.fr"; x-sender="postmaster@sympa.inria.fr"; x-conformance=spf_only x-ironport-av: E=Sophos;i="5.97,222,1669071600"; d="scan'208,217";a="87965279" x-spam-flag: Unsure, tests=bogofilter, spamicity=0.499014, queueID=D7C4A564A5C x-ironport-anti-spam-filtered: true x-loop: caml-list@inria.fr x-no-archive: yes Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 OCaml Weekly News

OCaml Weekly News

Previous We= ek Up Next We= ek

Hello

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

Installing Windows OCaml 5.0.0 in opam

David Allsopp announced

One of opam 2.2=92s headline features is that both =93upstream=94 opam (= i.e. opam built from un-patched sources from ocaml/opam) and =93un-forked= =94 opam-repository (i.e. ocaml/opam-repository<= /a>) finally provide native Windows opam switches. We=92re aiming to get an= alpha release of this out in the coming weeks, but I=92ve had various requ= ests directly for how to use OCaml 5.0 with opam-repository-mingw in the meantime, so I=92m just sharing this tem= porary solution, in case it=92s of use to others.

I have a demonstration workflow at https://github.com/dra27/ocaml5-ci-demo 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=3Docaml.5.0.0,ocaml-option-m=
ingw
      - run: opam exec --switch=3D5.0 -- ocamlopt -config
      - run: opam install --switch=3D5.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#op=
am2

The windows-5.0 branch adds just enough to provide the OCam= l 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=92ll actually pick up a v= ersion patched with ocaml/ocaml#11846= .

The only change once the alpha release comes out should be the removal o= f the opam repo add dra27 part.

Release of Mehari 0.1

Tim ats announced

@artichaut and I are very pleased to announce the first release of Mehar= i.

Mehari was created w= ith the aim of offering a cross-platform framework to create Gemini applications.

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

On the =93Geminispace=94, there are mainly static content like blogs and= other applications like games, BBS, etc.

Mehari API=92s 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 environme= nt 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 securit= y.

Mehari is our first MirageOS-compatib= le library, so the creation of unikernels is experimental, and we=92d love = to get feedback on it.

Outreachy Summer 2023

Patrick Ferris announced

Yep, it=92s that time of the year again! Outreachy has officially starte= d asking for organisations and mentors for the Summer 2023 round.

What is Outreachy?

Outreachy is a paid, remote internship program. Outreachy promotes diver= sity in open source and open science. Our internships are for people who fa= ce under-representation, and discrimination or systemic bias in the technol= ogy industry of their country.

Given the long discussion in https://discuss.ocaml.org/t/what-are-the-biggest-reasons-newcomers-give-up-= on-ocaml/10958 I can guarantee you that if you want some more really go= od answers, participating in Outreachy is one way to do that!

To help get a feel for what is to be a mentor, Outreachy will be holding= a livestreamed call with previous mentors taking part which should be avai= lable on peertube (I=92ll post links when available).

Important Dates

  • Jan. 17 at 3pm UTC - Mentor chat on YouTube and PeerTube
  • Feb. = 6 at 3pm UTC - Mentor chat on YouTube and PeerTube
  • Feb. 10 at 4pm = UTC - Deadline for open source and open science communities to sign up to b= e an Outreachy mentoring organization
  • Feb. 24 at 4pm UTC - Deadline for mentors to submit project descri= ptions for May 2023 interns to work on

This round

We had some excellent proposals for projects working on the compiler but= unfortunately in the end no intern was found for it, please don=92t be dis= heartened by this and I hope to see more projects suggested.

I=92ve had the great fortune of working with Prisca on ocaml-t= opojson which has come on leaps and bounds thanks to her work! We=92ll = have a proper debrief towards the end of the project like the previous two = rounds, although it may be a little shorter given the OCaml community only has one intern this round.

The older, but still relevant post https://discuss.ocaml.org/t/become-an-outreachy-mentor-support-the-growth-a= nd-diversity-of-the-ocaml-community/8213 contains some more information= about being a mentor which you may want to take a look at.

Please uses this thread for any questions, ideas or thoughts. Thank you = :camel: !

Patrick Ferris later added

Friendly reminder the live chat will take place on https://diode.zone/a/outreachy tomorrow (17th Jan. 2023) at 3pm UTC. Wh= ilst primarily focused on helping prospective applicants, it is still super= useful for mentors to understand the process to help them out when the tim= e comes.

Petrol 1.0.0 - A high-level typed SQL API for OCaml designed t= o go fast!

Kiran Gopinathan announced

Heyo! Pleased to annouce the release of a new library that I=92ve been w= orking on for some personal projects, but thought might be useful for other= s.

Petrol is a Free software library that provides a high-level OCam= l API for interacting with SQL databases. The aim of this interface is to p= rovide a type-safe API to allow developers to define their SQL tables and q= ueries directly in OCaml, thereby avoiding the impedence mismatch and fragility that comes with having to di= rectly write SQL code, as is typical in a normal Caqti-based project.

open Petrol

(* define a new schema *)
let schema =3D Stat=
icSchema.init ()

(* declare a table *)
let example_table, =
Expr.[name; age] =3D
    StaticSchema.declare_table schem=
a ~name:"example"
    Schema.[
        field "name" ~ty:Type.=
text;
        field "age" ~ty:Type.<=
/span>int
    ]

Petrol=92s DSL allows you to express complex SQL queries as simple OCaml= function compositions:

(* create =
a query *)
let insert_person ~=
name:n ~age:a db =3D
    Query.insert ~table:example_table
        ~values:Expr.[
            name :=3D s n;
            age :=3D i a
         ]
    |> Request.make_zero
    |> Petrol.exec db

Another selling point of Petrol is that it comes out of the box with a v= ersioning system to gracefully allow changing the schemas in your applicati= on over time - this and more is described in the documentation.

https://github.com/gop= iandcode/petrol

Anyway, as usual, I=92ve tried to spend some quality time tuning the doc= umentation to make it as easy to pick up as possible, so feel free to have = a gander: https://= gopiandcode.github.io/petrol/petrol/index.html

ocaml-search 0.1.1 - In-memory Search Index for OCaml values

Patrick Ferris announced

I=92m happy to announce the release of a little OCaml library for doing = in-memory searches over OCaml values: ocaml-search.=

Here=92s a quick example:

module Book =3D struct
  type t =3D {
    title : string;
    author : string;
  }
end

let books : =
Book.t list =3D
  [
    { title =3D "Dune"; au=
thor =3D "Frank Herbet" };
    { title =3D "The Day of the Triffi=
ds"; author =3D "John Wynd=
ham" };
    { title =3D "The Remains of the Da=
y"; author =3D "Kazuo Ishi=
guro" }
  ]

module Mono =3D Searc=
h.Tfidf.Mono (Search.Uids.String) (Book)
let search =3D Mono=
.empty ()

You can then add an index to your search index along with the documents.=

Mono.ad=
d_index search (fun t -> t.title);
List.iter (fun doc -> Mono.add_document search =
doc.Book.title doc) books

Before finally being able to search.

Mono.se=
arch search "day";;
- : Mono.doc list =3D
[{Book.title =3D "The Remains of the Day"; author =3D "Kazuo Ishiguro"};
 {Book.title =3D "The Day of the Triffids"; author =3D "John Wyndham"}]

The README= provides more thorough documentation and also explains how it can also pro= vide a heterogeneous search index should you want it. I have plans to make = the library more easily extendible with your own search strategies, but thought the initial TF-IDF implementa= tion might already be useful.

This library is heavily inspired by js-search without which it wouldn=92t exist.

Happy Hacking :camel:

Old CWN

If you happen to miss a CWN, you can send me a message and I=92ll 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.