From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id ECC9A5D5 for ; Tue, 1 Dec 2020 08:55:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.78,384,1599516000"; d="scan'208,217";a="480379005" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 01 Dec 2020 09:55:18 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 4C685E00CA; Tue, 1 Dec 2020 09:55:18 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 670C5E00C7 for ; Tue, 1 Dec 2020 09:55:08 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.78,384,1599516000"; d="scan'208,217";a="366157847" Received: from cbg35-2-78-242-14-140.fbx.proxad.net (HELO set) ([78.242.14.140]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 09:55:07 +0100 From: Alan Schmitt To: "lwn" , "cwn" , caml-list@inria.fr, comp@lists.orbitalfox.eu Date: Tue, 01 Dec 2020 09:54:57 +0100 Message-ID: <87mtyxaota.fsf@m4x.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Subject: [Caml-list] Attn: Development Editor, Latest OCaml Weekly News Reply-To: Alan Schmitt X-Loop: caml-list@inria.fr X-Sequence: 18295 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Here is the latest OCaml Weekly News, for the week of November 24 to December 01, 2020. Table of Contents =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80 drom.0.2.0: OCaml Project Manager, beta release OCaml on the BEAM webinar ocaml-lsp-server 1.3.0 OCaml User Survey 2020 http-cookie 2.0.0 reparse 2.0.0 VSCode OCaml Platform v1.5.0 Database modelling Opium 0.19.0 Operator lookup tool for OCaml Other OCaml News Old CWN drom.0.2.0: OCaml Project Manager, beta release =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Fabrice Le Fessant announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80 I am happy to announce the first release of `drom', version 0.2.0, a tool to create and manage OCaml projects. `drom' is a simple layer on top of `opam' and `dune', with project and package descriptions written in TOML syntax. It is an attempt at providing a `cargo'-like experience for developers, with builtin support for standard OCaml tools (`opam', `dune', `odoc', etc.) and source managers (Github for now, with Github Actions and Github Pages). There are mainly 2 use-cases of `drom': =E2=80=A2 Scafolding tool: `drom' makes it easy to create OCaml projects = by generating all the files needed for a standard OCaml project. It creates files for `opam' and `dune', formatters (`ocp-index' and `ocamlformat'), documentation (`sphinx' and `odoc'), testing directories and Github CI. Once these files have been created, `drom' is not needed anymore and you can keep using your preferred tools. =E2=80=A2 Management tool: `drom' can also be used to keep managing the project afterwards. It has commands like `drom build' to build the project, automatically installing a local switch with all needed dependencies, `drom doc' to generate the documentation and `drom test' to execute tests. `drom' works as a simple interface over `opam' and `dune' so you almost never need to use them directly. (this site and the documentation was mostly generated by `drom' itself) `drom' is available in the official opam repository. Examples: =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 $ drom new mylib --skeleton library // generate library project =E2=94=82 // or =E2=94=82 $ drom new hello // generate program project =E2=94=82=20 =E2=94=82 $ cd hello =E2=94=82 $ emacs drom.toml // edit the project description =E2=94=82 $ drom project // update files =E2=94=82 $ drom build // create local switch and build =E2=94=82 // or =E2=94=82 $ drom build --switch 4.10.0 // use global switch and build =E2=94=82 $ ./hello // run the executable =E2=94=82 $ drom test // run tests =E2=94=82 $ drom install // install in opam switch =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 This is an early release to get feedback from users. `drom' has been tested on several of our internal projects, like `opam-bin' and `ez_file'. Since `drom' creates local `opam' switches for every project by default (though it is possible to use global switches too), it is advised to use it with `opam-bin' to speed up switch creation and upgrades. `drom' works by creating projects using "skeletons", i.e. project and package templates. `drom' comes with a few predefined skeletons (`program' or `library'), and allows users to add their own skeletons. We will of course extend the substitution language to help users develop such new skeletons. `drom' is a collaborative work between OCamlPro and Origin Labs. Fran=C3=A7ois Bobot asked and Fabrice Le Fessant replied =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 I'm very happy to see work in the OCaml world in that direction. I was currently looking for duniverse for that kind of need. Do they fullfil different needs or how do they compare? My understanding is that `duniverse' tackles the problem of the "mono-repo", i.e. when you want to manage many different projects as just one project, using `dune' capacity to build them all at once. I would say that `drom' tackles an orthogonal problem, which is to simplify the creation of simple OCaml projects (generating all the standard files you need, like Makefile, dune-project, dune, .ocamlformat, .github CI, documentation, license, etc.) and day-to-day management (changing dependencies, having a copy of headers that you can insert in new files, etc.). It also provides a single interface over basic opam/dune commands. It would probably be possible to use `duninverse' on a set of projects containing projects generated by `dune', but I don't know enough about `duniverse' to be sure. Of course, `drom' can manage projects composed of multiple libraries and executables (called `packages' because `drom' generates one `opam' file for every one of them), but I wouldn't call that a mono-repo, it's just frequent to have more than one package in a small project. OCaml on the BEAM webinar =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Yawar Amin announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80 Erlang Solutions is going to do a webinar on Leandro Ostera's new BEAM backend for OCaml: Should be exciting! ocaml-lsp-server 1.3.0 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Rudi Grinberg announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 On behalf of the ocaml-lsp team, I=E2=80=99d like to announce version 1.3= .0. This release an improvement in keyword completion and a new code action. Keywords are now filtered by the context the user requested the completion, and there's a new code action to quickly populate .mli files with the the inferred types from the .ml file. OCaml User Survey 2020 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Xavier Leroy announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Here is a summary and analysis of the survey results I wrote on behalf of the OCaml Software Foundation: Enjoy! http-cookie 2.0.0 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90 Archive: Bikal Lem announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80 A new version of `cookies' package - now named `http-cookie'- has been released to opam. This version has been rewritten to remove all its external and ppx dependencies and now only depends on stock ocaml and its stdlib. `http-cookie' is a [RFC 6265] compliant HTTP cookie library. RFC 6265 is a HTTP cookie standard specifying cookie data validity requirements. Additionally, I have also removed the use of `Result.t' from the previous version and have used plain old exceptions to denote any cookie data validation errors. =E2=80=A2 [Github - http-cookie] =E2=80=A2 [Docs - http-cookie] [RFC 6265] [Github - http-cookie] [Docs - http-cookie] reparse 2.0.0 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Bikal Lem announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80 A new version of `reparse' 2.0.0 has been released to opam. Reparse is a monadic, recursive descent based, comprehensive, parser construction library for ocaml. CHANGES for version 2.0.0: =E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2= =95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95= =8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C= =E2=95=8C =E2=80=A2 Rewrite the whole package to use exceptions rather than `result' type =E2=80=A2 Adds many more parsing combinators =E2=80=A2 Adds comprehensive unit tests =E2=80=A2 Adds comprehensive documentation, host documentation and add li= nks in repo home page =E2=80=A2 Adds abstraction for input source =E2=80=A2 Provides unix file source and string input source =E2=80=A2 Adds separate package `reparse-unix' for unix file input =E2=80=A2 Adds calc.ml and json.ml in examples. Additionally, the API is now comprehensively documented with at least an example for each API call. =E2=80=A2 [Github Reparse] =E2=80=A2 [API Docs] [Github Reparse] [API Docs] VSCode OCaml Platform v1.5.0 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90 Archive: Max Lantas announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80 We are happy to announce the v1.5.0 release of [VSCode OCaml Platform], a Visual Studio Code extension for OCaml. It is available on the [VSCode Marketplace] and [Open VSX Registry]. This release has the following changes: =E2=80=A2 Highlight `rec' keyword in OCaml mli files for recursive modules ([#434]) =E2=80=A2 Highlight `cram' stanza in dune-project files ([#441]) =E2=80=A2 Fix reason highlighting of let extensions ([#447]) =E2=80=A2 Improve highlighting of Menhir new syntax ([#450]) =E2=80=A2 Improve Menhir syntax highlighting ([#455]) =E2=80=A2 Add `Alt + P' keyboard shortcut for infer interface code action ([#448]) =E2=80=A2 Infer interface when switching to a non-existing interface file ([#437]) This is the first release to be automatically published to Open VSX, which will benefit users of [VSCodium] and other editors. Please feel free to share feedback. [VSCode OCaml Platform] [VSCode Marketplace] [Open VSX Registry] [#434] [#441] [#447] [#450] [#455] [#448] [#437] [VSCodium] Database modelling =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90 Archive: Reviving this very old thread, paul announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80 And a version for postgresql: Opium 0.19.0 =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Thibaut Mattio announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 On behalf of the Opium team, I am pleased to announce a new version of Opium (`0.19.0') is available on Opam. This release comes with a complete rewrite of Opium's internals to switch from Cohttp to Httpaf (work done by @anuragsoni). As demonstrated in several benchmarks, Httpaf's latency is much lower than Cohttp's in stress tests, so it is expected that Opium will perform better in these high-pressure situations. The underlying HTTP server implementation is now contained in a `rock' package, that provides a Service and Filter implementation, inspired by Finagle's. The architecture is similar to Ruby's Rack library (hence the name), so one can compose complex web applications by combining Rock applications. The `rock' package offers a very slim API, with very few dependencies, so it should be an attractive option for other Web frameworks to build on, which would allow the re-usability of middlewares and handlers, independently of the framework used (e.g. one could use Sihl middlewares with Opium, and vice versa). Apart from the architectural changes, this release comes with a lot of additional utilities and middlewares which should make Opium a better candidate for complex web applications, without having to re-write a lot of common Web server functionalities. The Request and Response modules now provide: =E2=80=A2 JSON encoders/decoders with `Yojson' =E2=80=A2 HTML encoders/decoders with `Tyxml' =E2=80=A2 XML encoders/decoders with `Tyxml' =E2=80=A2 SVG encoders/decoders with `Tyxml' =E2=80=A2 multipart/form encoders/decoders with `multipart_form_data' =E2=80=A2 urlencoded encoders/decoders with `Uri' And the following middlewares are now built-in: =E2=80=A2 `debugger' to display an HTML page with the errors in case of failures =E2=80=A2 `logger' to log requests and responses, with a timer =E2=80=A2 `allow_cors' to add CORS headers =E2=80=A2 `static' to serve static content given a custom read function (e.g. read from S3) =E2=80=A2 `static_unix' to serve static content from the local filesystem =E2=80=A2 `content_length' to add the `Content-Length' header to responses =E2=80=A2 `method_override' to replace the HTTP method with the one found= in the `_method' field of `application/x-www-form-urlencoded' encoded `POST' requests. =E2=80=A2 `etag' to add `ETag' header to the responses and send an HTTP c= ode `304' when the computed ETag matches the one specified in the request. =E2=80=A2 `method_required' to filter the requests by the HTTP method and respond with an HTTP code `405' if the method is not allowed. =E2=80=A2 `head' to add supports for `HEAD' request for handlers that rec= eive `GET' requests. Lastly, this release also adds a package `opium-testing' that can be used to test Opium applications with Alcotest. It provides `Testable' modules for every Opium types, and implements helper functions to easily get an `Opium.Response' from an `Opium.Request'. As this release changes the API drastically, we will keep maintaining the `0.18.0' branch for bug fixes, for users who don't want to (or can't) migrate to `0.19.0'. What's next? =E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2= =95=8C=E2=95=8C=E2=95=8C=E2=95=8C Recent discussions have shown that building optimized applications was not trivial. This is partly due to the lack of documentation, and probably because some configurations that should come by default, are left to the user to optimize. Therefore, we will keep performance in mind for the next release and investigate the current bottlenecks in Opium. We will also continue adding higher-level functionalities to Opium to make users productive with real-world applications. This includes: =E2=80=A2 Sessions support (with signed cookies) =E2=80=A2 Handlers for authentication =E2=80=A2 Adding more middlewares (compression, flash messages, caching, = etc.) Your feedback is welcome, don't hesitate to open Issues on Github! Andreas Poisel asked and Anurag Soni replied =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80 Does Opium + Httpaf support TLS? It doesn't at the moment. Calascibetta Romain then said =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 According the interface of `opium', it's possible to have the support of TLS (with `ocaml-tls') with the [new version of Conduit] and [`paf'] (which is a MirageOS compatible layer of HTTP/AF - unreleased): =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 let stack ip =3D =E2=94=82 Tcpip_stack_socket.UDPV4.connect (Some ip) >>=3D fun udpv4 -> =E2=94=82 Tcpip_stack_socket.TCPV4.connect (Some ip) >>=3D fun tcpv4 -> =E2=94=82 Tcpip_stack_socket.connect [ ip ] udpv4 tcpv4 =E2=94=82=20 =E2=94=82 let http_with_conduit (ip, port) error_handler request_handler = =3D =E2=94=82 Paf.https httpaf_config ~error_handler ~request_handler:(fun = _ -> request_handler) =E2=94=82 ({ Paf.TCP.stack=3D stack ip =E2=94=82 ; keepalive=3D None =E2=94=82 ; nodelay=3D false =E2=94=82 ; port=3D port}, Tls.Config.server ~certificates ()) =E2=94=82=20 =E2=94=82 let () =3D match Lwt_main.run (Opium.run (https_with_conduit (I= paddr.V4.localhost, 4343)) opium_app) with =E2=94=82 | Ok () -> () =E2=94=82 | Error err -> Fmt.epr "%a.\n%!" Conduit_mirage.pp_error err =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 I used it for a long time on my personal unikernels and did some tests to ensure that [it does fails when it handles many requests]. Note that you are able to use OpenSSL too if you want. [new version of Conduit] [`paf'] [it does fails when it handles many requests] Robin Bj=C3=B6rklin also replied =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80 If you want to use this new version of Opium there are ways around this problem. You could have Haproxy (or similar) terminate your TLS connections externally and if your environment requires TLS for your internal network something like [Consul Connect] can cover that use-case for you. [Consul Connect] Operator lookup tool for OCaml =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Archive: Craig Ferguson announced =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 I'm pleased to announce the initial release of craigfe.io/operator-lookup/, a search tool for OCaml operators and syntax elements: For each operator, the tool provides a short explanation of its behaviour, examples of usage and warnings of common misuses and misunderstandings: The intent of writing this tool was to give OCaml beginners a quick way to find the standard / conventional operators in the language and to disambiguate "operator-like" syntax that can be hard to search for otherwise. It currently supports: =E2=80=A2 all standard library operators, =E2=80=A2 conventional infix operators (`>>=3D', `>>|', `>|=3D'), =E2=80=A2 binding operators (`let+', `let*', `and+', etc.), =E2=80=A2 syntax that is often confused for an operator (`#', `;;'). Please let me know if you have any suggestions for improvements. I hope you find it useful! Acknowledgements =E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2= =95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C=E2=95=8C This tool is heavily based on the [JavaScript operator lookup] utility by [Josh Comeau]. Thanks to him for the initial idea and for allowing me to re-use his design elements. [JavaScript operator lookup] [Josh Comeau] Kakadu asked and Craig Ferguson replied =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 It's not obvious for me are these operators hardcoded or do you scan opam packages from time to time? They're hardcoded. The operators fall into three classes: =E2=80=A2 The vast majority of them are from the `Stdlib' module, so I do= n't expect those to change very regularly. =E2=80=A2 A small number of "conventional" operators used in the community (`>>=3D', `let*', etc.). Even for that small set there is some divergence in Opam =E2=80=93 c.f. `>>|' vs `>|=3D' for a _map_ operator= =E2=80=93 so I suspect there are not many other candidates for this group. =E2=80=A2 There are a few regexes behind the scenes for catching valid operator names that don't fall into the first two categories. e.g. many search terms are classified as "_a left-associative operator_" with a correspondingly vague description. Other OCaml News =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 >From the ocamlcore planet blog =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Here are links from many OCaml blogs aggregated at [OCaml Planet]. =E2=80=A2 [=E2=80=9CUniversal=E2=80=9D Dune Tip: Rebuild Stuff, Sometimes] [OCaml Planet] [=E2=80=9CUniversal=E2=80=9D Dune Tip: Rebuild Stuff, Sometimes] Old CWN =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 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] --=-=-= Content-Type: text/html; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable OCaml Weekly News

OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of November 24 to Decemb= er 01, 2020.

drom.0.2.0: OCaml Project Manager, beta release

Fabrice Le Fessant announced

I am happy to announce the first release of drom, version 0.2.= 0, a tool to create and manage OCaml projects. drom is a simple lay= er on top of opam and dune, with project and package de= scriptions written in TOML syntax. It is an attempt at providing a cargo-= like experience for developers, with builtin support for standard OCaml tools (opam, dune, odoc, etc.) and s= ource managers (Github for now, with Github Actions and Github Pages).

There are mainly 2 use-cases of drom:

  • Scafolding tool: drom makes it easy to create OCaml projec= ts by generating all the files needed for a standard OCaml project. It creates files for opam and dune, formatters (ocp-index and ocamlformat), documentation (sphinx and odo= c), testing directories and Github CI. Once these files have been created, drom is not needed anymore and you can keep using your preferr= ed tools.
  • Management tool: drom can also be used to keep managing the project afterwards. It has commands like drom build to build t= he project, automatically installing a local switch with all needed dependencies, drom doc to generate the documentation and drom test to execute tests. drom works as a simple interfa= ce over opam and dune so you almost never need to use the= m directly.

https://ocamlpro.github.io/drom=

(this site and the documentation was mostly generated by drom = itself)

drom is available in the official opam repository.

Examples:

$ drom new mylib --skeleton library // generate library project
                                    //           or
$ drom new hello                    // generate program project

$ cd hello
$ emacs drom.toml // edit the project description
$ drom project    // update files
$ drom build                  // create local switch and build
                              //      or
$ drom build --switch 4.10.0  // use global switch and build
$ ./hello         // run the executable
$ drom test       // run tests
$ drom install    // install in opam switch

This is an early release to get feedback from users. drom has = been tested on several of our internal projects, like opam-bin and ez_file.

Since drom creates local opam switches for every = project by default (though it is possible to use global switches too), it is advised to use it with opam-bin to speed up switch creation and upgrades.

drom works by creating projects using "skeletons", i.e. projec= t and package templates. drom comes with a few predefined skeletons (program or library), and allows users to add the= ir own skeletons. We will of course extend the substitution language to help users develop such new skeletons.

drom is a collaborative work between OCamlPro and Origin Labs.

Fran=C3=A7ois Bobot asked and Fabrice Le Fessant repl= ied

I'm very happy to see work in the OCaml world in that direction. I was curr= ently looking for duniverse for that kind of need. Do they fullfil different needs or how do = they compare?

My understanding is that duniverse tackles the problem of the "mono-repo", i.e. when you want to manage many different projects as just one project, using dune capacity to build them all at onc= e. I would say that drom tackles an orthogonal problem, which is to simplify the creation of simple OCaml projects (generating all the standard files you need, like Makefile, dune-project, dune, .ocamlformat, .github CI, documentation, license, etc.) and day-to-day management (changing dependencies, having a copy of headers that you can insert in new files, etc.). It also provides a single interface over basic opam/dune commands.

It would probably be possible to use duninverse on a set of pr= ojects containing projects generated by dune, but I don't know enough= about duniverse to be sure.

Of course, drom can manage projects composed of multiple libra= ries and executables (called packages because drom gen= erates one opam file for every one of them), but I wouldn't call that a mono-repo, it's just frequent to have more than one package in a small project.

OCaml on the BEAM webinar

Yawar Amin announced

Erlang Solutions is going to do a webinar on Leandro Ostera's new BEAM back= end for OCaml: https:= //www2.erlang-solutions.com/webinar-registration-2

Should be exciting!

ocaml-lsp-server 1.3.0

Rudi Grinberg announced

On behalf of the ocaml-lsp team, I=E2=80=99d like to announce version 1.3.0.

This release an improvement in keyword completion and a new code action. Ke= ywords are now filtered by the context the user requested the completion, and there's a new code actio= n to quickly populate .mli files with the the inferred types from the .ml file.

OCaml User Survey 2020

Xavier Leroy announced

Here is a summary and analysis of the survey results I wrote on behalf of t= he OCaml Software Foundation: https://www.dropbox.com/s/omba1d8vhljnrcn/OCaml-us= er-survey-2020.pdf?dl=3D0 Enjoy!

http-cookie 2.0.0

Bikal Lem announced

A new version of cookies package - now named http-cookie= - has been released to opam. This version has been rewritten to remove all its external and ppx dependencies = and now only depends on stock ocaml and its stdlib.

http-cookie is a RFC 6265 compliant HTTP cookie library. RFC 6265 is a HTTP cookie standard specifying cookie data validity requirem= ents.

Additionally, I have also removed the use of Result.t from the= previous version and have used plain old exceptions to denote any cookie data validation errors.

reparse 2.0.0

Bikal Lem announced

A new version of reparse 2.0.0 has been released to opam.

Reparse is a monadic, recursive descent based, comprehensive, parser constr= uction library for ocaml.

CHANGES for version 2.0.0:

  • Rewrite the whole package to use exceptions rather than result type
  • Adds many more parsing combinators
  • Adds comprehensive unit tests
  • Adds comprehensive documentation, host documentation and add links in r= epo home page
  • Adds abstraction for input source
  • Provides unix file source and string input source
  • Adds separate package reparse-unix for unix file input
  • Adds calc.ml and json.ml in examples.

Additionally, the API is now comprehensively documented with at least an ex= ample for each API call.

VSCode OCaml Platform v1.5.0

Max Lantas announced

We are happy to announce the v1.5.0 release of VSCode OCaml Platform, a Visual Studio Code extension for OCaml. It is available on the VSCode Marketplace and Open VSX Registry.

This release has the following changes:

  • Highlight rec keyword in OCaml mli files for recursive mod= ules (#434)
  • Highlight cram stanza in dune-project files (#441)
  • Fix reason highlighting of let extensions (#447)
  • Improve highlighting of Menhir new syntax (#450)
  • Improve Menhir syntax highlighting (#455)
  • Add Alt + P keyboard shortcut for infer interface code act= ion (#448)
  • Infer interface when switching to a non-existing interface file (#437)=

This is the first release to be automatically published to Open VSX, which = will benefit users of VSCodium and other edi= tors.

Please feel free to share feedback.

Database modelling

Reviving this very old thread, paul announced

Opium 0.19.0

Thibaut Mattio announced

On behalf of the Opium team, I am pleased to announce a new version of Opiu= m (0.19.0) is available on Opam.

This release comes with a complete rewrite of Opium's internals to switch f= rom Cohttp to Httpaf (work done by @anuragsoni).

As demonstrated in several benchmarks, Httpaf's latency is much lower than = Cohttp's in stress tests, so it is expected that Opium will perform better in these high-pressure situat= ions.

The underlying HTTP server implementation is now contained in a rock<= /code> package, that provides a Service and Filter implementation, inspired by Finagle's. The architecture is simil= ar to Ruby's Rack library (hence the name), so one can compose complex web applications by combining = Rock applications.

The rock package offers a very slim API, with very few depende= ncies, so it should be an attractive option for other Web frameworks to build on, which would allow the re-usabi= lity of middlewares and handlers, independently of the framework used (e.g. one could use Sihl midd= lewares with Opium, and vice versa).

Apart from the architectural changes, this release comes with a lot of addi= tional utilities and middlewares which should make Opium a better candidate for complex web appl= ications, without having to re-write a lot of common Web server functionalities.

The Request and Response modules now provide:

  • JSON encoders/decoders with Yojson
  • HTML encoders/decoders with Tyxml
  • XML encoders/decoders with Tyxml
  • SVG encoders/decoders with Tyxml
  • multipart/form encoders/decoders with multipart_form_data<= /li>
  • urlencoded encoders/decoders with Uri

And the following middlewares are now built-in:

  • debugger to display an HTML page with the errors in case o= f failures
  • logger to log requests and responses, with a timer
  • allow_cors to add CORS headers
  • static to serve static content given a custom read functio= n (e.g. read from S3)
  • static_unix to serve static content from the local filesys= tem
  • content_length to add the Content-Length head= er to responses
  • method_override to replace the HTTP method with the one fo= und in the _method field of application/x-www-form-urlen= coded encoded POST requests.
  • etag to add ETag header to the responses and = send an HTTP code 304 when the computed ETag matches the one s= pecified in the request.
  • method_required to filter the requests by the HTTP method = and respond with an HTTP code 405 if the method is not allowed= .
  • head to add supports for HEAD request for han= dlers that receive GET requests.

Lastly, this release also adds a package opium-testing that ca= n be used to test Opium applications with Alcotest. It provides Testable modules for every Opium ty= pes, and implements helper functions to easily get an Opium.Response from an Opium.Request.

As this release changes the API drastically, we will keep maintaining the <= code>0.18.0 branch for bug fixes, for users who don't want to (or can't) migrate to 0.19.0.

What's next?

Recent discussions have shown that building optimized applications was not = trivial. This is partly due to the lack of documentation, and probably because some configurations that= should come by default, are left to the user to optimize. Therefore, we will keep performance in mind f= or the next release and investigate the current bottlenecks in Opium.

We will also continue adding higher-level functionalities to Opium to make = users productive with real-world applications. This includes:

  • Sessions support (with signed cookies)
  • Handlers for authentication
  • Adding more middlewares (compression, flash messages, caching, etc.)

Your feedback is welcome, don't hesitate to open Issues on Github!

Andreas Poisel asked and Anurag Soni replied

Does Opium + Httpaf support TLS?

It doesn't at the moment.

Calascibetta Romain then said

According the interface of opium, it's possible to have the su= pport of TLS (with ocaml-tls) with the new version of Conduit and paf= (which is a MirageOS compatible layer of HTTP/AF - unreleased):

let stack ip =3D
  Tcpip_stack_socket.UDPV4.connect (=
Some ip) =
>>=3D fun udpv4 ->
  Tcpip_stack_socket.TCPV4.connect (=
Some ip) =
>>=3D fun tcpv4 ->
  Tcpip_stack_socket.connect [ ip ] =
udpv4 tcpv4

let http_with_conduit (ip, port) error_handler reque=
st_handler =3D
  Paf.https httpaf_config ~error_han=
dler ~request_handler:(fun _ -&=
gt; request_handler)
    ({ Paf.TCP.stack=3D stack ip
     ; keepalive=3D None
     ; nodelay=3D false
     ; port=3D port}, Tls.Config.ser=
ver ~certificates ())

let () =3D match Lwt_=
main.run (Opium.run (https_wi=
th_conduit (Ipaddr.V4.localhost, 434=
3)) opium_app) with
  | Ok ()=
 -> ()
  | Error=
 err -> Fmt.epr "%a.\n%!" Conduit_mir=
age.pp_error err

I used it for a long time on my personal unikernels and did some tests to e= nsure that it= does fails when it handles many requests. Note that you are able to use OpenSSL too if you want.

Robin Bj=C3=B6rklin also replied

If you want to use this new version of Opium there are ways around this pro= blem. You could have Haproxy (or similar) terminate your TLS connections externally and if your environm= ent requires TLS for your internal network something like Co= nsul Connect can cover that use-case for you.

Operator lookup tool for OCaml

Craig Ferguson announced

I'm pleased to announce the initial release of craigfe.io/operator-lookup/,= a search tool for OCaml operators and syntax elements:

3D"=

For each operator, the tool provides a short explanation of its behaviour, = examples of usage and warnings of common misuses and misunderstandings:

3D"=

The intent of writing this tool was to give OCaml beginners a quick way to = find the standard / conventional operators in the language and to disambiguate "operator-like" = syntax that can be hard to search for otherwise. It currently supports:

  • all standard library operators,
  • conventional infix operators (>>=3D, >>|= , >|=3D),
  • binding operators (let+, let*, and+, etc.),
  • syntax that is often confused for an operator (#, ;;= ).

Please let me know if you have any suggestions for improvements. I hope you= find it useful!

Acknowledgements

This tool is heavily based on the JavaScript operator lookup utility by Josh Comeau. Thanks to him for the initial idea and for allowing me to re-use his design elements.

Kakadu asked and Craig Ferguson replied

It's not obvious for me are these operators hardcoded or do you scan opam p= ackages from time to time?

They're hardcoded. The operators fall into three classes:

  • The vast majority of them are from the Stdlib module, so I= don't expect those to change very regularly.
  • A small number of "conventional" operators used in the community (>>=3D, let*, etc.). Even for that small set the= re is some divergence in Opam =E2=80=93 c.f. >>| vs >|=3D for a map operator =E2= =80=93 so I suspect there are not many other candidates for this group.
  • There are a few regexes behind the scenes for catching valid operator n= ames that don't fall into the first two categories. e.g. many search terms = are classified as "_a left-associative operator_" with a correspondingly va= gue description.

Other OCaml News

From the ocamlcore planet blog

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

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 loo= k at the archive or the RSS feed of the archives<= /a>.

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

--=-=-=--