Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt <[email protected]>
Newsgroups gmane.comp.lang.caml.inria
Message-ID <[email protected]>
Hello

Here is the latest OCaml Weekly News, for the week of February 13 to 20,
2024.

Table of Contents
─────────────────

List of protected keyword in OCaml
ocaml.codes, code search for OPAM packages
dune 3.14
Learn-OCaml 1.0 is out!
Melange 3.0
Docfd: TUI multiline fuzzy document finder 2.2.0
Re: Ppxlib dev meetings
Owl project concluding
Other OCaml News
Old CWN


List of protected keyword in OCaml
══════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/list-of-protected-keyword-in-ocaml/3002/6>


Muzimuzhi announced
───────────────────

  Here's the latest link, with working anchor:
  <https://v2.ocaml.org/manual/lex.html#sss:keywords>

  The OCaml manual also provides an Index of keywords which is helpful
  in reading syntaxes and mentions of keywords in detail.
  <https://v2.ocaml.org/manual/manual074.html>


ocaml.codes, code search for OPAM packages
══════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-ocaml-codes-code-search-for-opam-packages/14092/1>


prgbln announced
────────────────

  I recently started using a local instance of [livegrep] to easily
  search through a bunch of OCaml repositories. It's been helpful for
  looking at examples of how others use certain functions or libraries
  where documentation is scarce.

  I thought I'd set up a public instance in case others would find this
  handy too. You can now search through the code of most OPAM packages
  on [https://ocaml.codes/].

  Here are some things to keep in mind:

  • I'm currently only indexing GitHub repositories from the /dev-repo/
    field of OPAM packages, as most are hosted there (2375
    repositories). I plan on indexing the remaining repositories if
    there's interest (e.g., stuff on GitLab, Bitbucket, personal
    domains).
  • There's no automated re-indexing to keep up with the addition of new
    packages yet, but this could be implemented fairly easily.
  • The livegrep instance is running on a low-end VPS, so the
    performance isn't optimal. However, it still feels snappy and
    perfectly usable to me.

  I'm looking forward to any feedback.


[livegrep] <https://github.com/livegrep/livegrep>

[https://ocaml.codes/] <https://ocaml.codes/>


dune 3.14
═════════

  Archive: <https://discuss.ocaml.org/t/ann-dune-3-14/14096/1>


Etienne Millon announced
────────────────────────

  We're happy to announce that Dune 3.14.0 is now available. This
  feature has many fixes and new features that you can find in the
  changelog.

  There are a few new features that we would like to specially
  highlight.


Dynamic dune files with `(dynamic_include)'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  It is common for some parts of a build to be dynamic: for example a
  source file can be generated, or some parts of the configuration like
  C flags can be generated from a Dune rule. But until now it was not
  possible to generate rules dynamically.

  For example, one might want to do it is to set up one rule per input
  file. This is a common pattern in test suites and is easy to do with
  Make. But Dune does not have a concept of parameterized rules, so it
  is necessary to set up one rule per input file.

  The pattern to do this with Dune is to:

  • Write a generator that lists the input files and emits Dune stanzas
    (as text);
  • Add a rule that makes a `dune.inc' file using this generator;
  • Add `(include dune.inc)' in the main `dune' file,

  However, this requires checking in the generated `dune.inc' file in
  the repository. Another drawback is that when modifying the list of
  input files, it is necessary to run tests twice: one to update
  `dune.inc', one to run the new test.

  This release of Dune adds a new `(dynamic_include)' stanza that lifts
  these restrictions: `dune.inc' does not have to be part of the source
  tree, it can be generated transparently. This comes with some
  restrictions: some stanzas can not be generated, in particular the
  ones that define public libraries. And due to how rule loading works,
  the generated stanza needs to be defined in a different directory.

  Still, this should be useful for many users that rely on the
  generate-include-commit bpattern described above.


Sherlodoc integration
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Sherlodoc is a search engine for OCaml documentation, which supports
  search by name, documentation and fuzzy type search (similar to Hoogle
  in the Haskell world). It can be obtained from opam using `opam
  install sherlodoc'.

  When it is available, Dune commands that produce HTML documentation,
  such as `dune build @doc' and `dune build @doc-new', will include a
  search bar in the generated output.


Changelog
╌╌╌╌╌╌╌╌╌

◊ Added

  • Introduce a `(dynamic_include ..)' stanza. This is like `(include
    foo)' but allows `foo' to be the target of a rule. Currently, there
    are some limitations on the stanzas that can be generated. For
    example, public executables, libraries are currently
    forbidden. (#9913, @rgrinberg)

  • Introduce `$ dune promotion list' to print the list of available
    promotions. (#9705, @moyodiallo)

  • If Sherlodoc is installed, add a search bar in generated HTML docs
    (#9772, @EmileTrotignon)

  • Add `only_sources' field to `copy_files' stanza (#9827, fixes #9709,
    @jchavarri)

  • The `(foreign_library)' stanza now supports the `(enabled_if)'
    field. (#9914, @nojb)


◊ Fixed

  • Fix `$ dune install -p' incorrectly recognizing packages that are
    supposed to be filtered (#9879, fixes #4814, @rgrinberg)

  • subst: correctly handle opam files in opam/ subdirectory (#9895,
    fixes #9862, @emillon)

  • Odoc private rules are not set up if a library is not available due
    to `enabled_if' (#9897, @rgrinberg and @jchavarri)


◊ Changed

  • When dune language 3.14 is enabled, resolve the binary in `(run
    %{bin:..} ..)' from where the binary is built. (#9708, @rgrinberg)

  • boot: remove single-command bootstrap. This was an alternative
    bootstrap strategy that was used in certain conditions. Removal
    makes the bootstrap a bit slower on Linux when only a single core is
    available, but bootstrap is now reproducible in all cases. (#9735,
    fixes #9507, @emillon)


Learn-OCaml 1.0 is out!
═══════════════════════

  Archive: <https://discuss.ocaml.org/t/learn-ocaml-1-0-is-out/14100/1>


Louis Gesbert announced
───────────────────────

  Hello all,

  Learn-OCaml 1.0 is finally out :tada:

        [*Learn-OCaml*] is a web platform for exercises in OCaml
        programming, with automated grading that was originally
        developped for the OCaml MOOC. The interface features a
        code editor and client-side evaluation and grading ; it
        can be served statically, but if running the bundled
        server there are also server-side saves, facilities for
        teachers to follow the progress of students, give
        assignments, get grades, etc.


[*Learn-OCaml*] <https://github.com/ocaml-sf/learn-ocaml/>

Get me there!
╌╌╌╌╌╌╌╌╌╌╌╌╌

  There is a live demo at [ocaml-sf.org].

  Although most changes will be mostly meaningful for teachers running
  their instances, this already shows the growing corpus of exercises.

  To run your own instance, see the [guide].


[ocaml-sf.org] <https://ocaml-sf.org/learn-ocaml-public>

[guide]
<https://ocaml-sf.org/learn-ocaml/howto-deploy-a-learn-ocaml-instance.html>


What's new
╌╌╌╌╌╌╌╌╌╌

  This first major release, along with a lot of quality-of-life
  improvements, features a significant rewrite of the evaluation engine.
  The main visible consequences are:

  • a nice speedup to the grading of exercises in the browser
  • a huge (x100) speedup to the pre-processing of the exercises (when
    running `learn-ocaml build')
  • exercise solutions can no longer leak (the server only provides the
    already compiled jsoo version to the client), making the platform
    more suitable for evaluations
  • error messages when compiling exercises are much, much better

  A few other most-wanted features have also been added, like a reworked
  exercise choice page, and the ability to update a running instance
  with minimal downtime (`learn-ocaml build serve --replace') ; as well
  as lots of QoL improvements, like bugfixes and integrated
  documentation in the teacher interface.


What's coming
╌╌╌╌╌╌╌╌╌╌╌╌╌

  A proper login system with choice between email/password or a Moodle
  server is [in the works] ; we expect it to land shortly in 1.1, once
  we work on the remaining rough edges.

  Porting to more recent versions of OCaml is also planned.


[in the works] <https://github.com/ocaml-sf/learn-ocaml/pull/362>


Feedback
╌╌╌╌╌╌╌╌

  Feedback is very welcome here or on [Github].

  — Louis Gesbert (OCamlPro), on behalf of the Learn-OCaml team

  With thanks to the OCaml Foundation for funding the major part of this
  work.


[Github] <https://github.com/ocaml-sf/learn-ocaml/issues>


Melange 3.0
═══════════

  Archive: <https://discuss.ocaml.org/t/ann-melange-3-0/14102/1>


Antonio Nuno Monteiro announced
───────────────────────────────

  Dear OCaml users,

  the Melange team is proud to announce the release of Melange 3.0.

  Melange is a backend for the OCaml compiler that emits
  JavaScript. This release focuses on:

  • Improved OCaml version support: we're releasing Melange v3 with full
    support for OCaml 4.14 and OCaml 5.1, similar to Merlin's recent
    versioning scheme (3.0.0-414 and 3.0.0-51).
  • Better JavaScript interop: we support more combinations in our
    Foreign Function Interface layer, allowing to output more JavaScript
    constructs without resorting to `%mel.raw'
  • Made Melange leaner and more robust:
    • in the compiler core, we fixed a few crashes, removed unused code
      and made other code faster;
    • in the Melange runtime libraries, we unified APIs that were
      duplicated or inconsistent
  • Implemented more runtime primitives and enabled additional Stdlib
    functions

  With the release of Melange 3, we're also introducing a redesign of
  our [documentation website]. We added an overall new design, snappier
  navigation and real-time search.

  I wrote a more comprehensive release announcement in the following
  post:

  <https://melange.re/blog/posts/announcing-melange-3>

  As always, feedback is very much appreciated.

  This release of Melange is sponsored by Ahrefs and the [OCaml Software
  Foundation ].


[documentation website] <https://melange.re/v3.0.0/>

[OCaml Software Foundation ] <https://ocaml-sf.org/>


Docfd: TUI multiline fuzzy document finder 2.2.0
════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-docfd-tui-multiline-fuzzy-document-finder-2-2-0/14109/1>


Darren announced
────────────────

  I am happy to share a new release of Docfd, 2.2.0.

  [Repo]. Also packaged on [opam], [AUR], and Nix (as `docfd'),

  Think interactive grep for both text files and PDFs, but word/token
  based instead of regex and line based, so you can search across lines
  easily.

  Docfd aims to provide good UX via integration with common text editors
  and PDF viewers, so you can jump directly to a search result with a
  single key press.


[Repo] <https://github.com/darrenldl/docfd>

[opam] <https://ocaml.org/p/docfd/latest>

[AUR] <https://aur.archlinux.org/packages/docfd-bin>

Demos
╌╌╌╌╌

  Navigating repo:

  <https://raw.githubusercontent.com/darrenldl/docfd/main/demo-vhs-gifs/repo.gif>

  Navigating "OCaml Programming: Correct + Efficient + Beautiful" book
  PDF and opening it to the closest location to the selected search
  result via PDF viewer integration:

  <https://github.com/darrenldl/docfd/blob/main/screenshots/pdf-viewer-integration.jpg?raw=true>


Major changes since last announcement
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  • Search expression is added (and properly documented more recently).
    A search expression is one of:
    • Search phrase, e.g. `fuzzy search'
    • `?expression' (optional)
    • `(expression)'
    • `expression | expression' (or), e.g. `go ( left | right )'
  • Search results with balanced opening and closing symbols (`()',
    `[]', `{}') are ranked higher to reduce visual noise when searching
    <https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/6/63b2c346f9ed698a807da33c8d94b87d6b1a94ce.png>
  • Added file selection support via `fzf'
  • Added support for `jed~/~xjed'
  • Restored behaviour of skipping file extension checks for top-level
    user specified files. This behaviour was likely removed during some
    previous overhaul.


Re: Ppxlib dev meetings
═══════════════════════

  Archive: <https://discuss.ocaml.org/t/ppxlib-dev-meetings/12441/16>


Sonja Heinze announced
──────────────────────

  Thanks everyone who has participated in the poll! :heart: It seems
  like a few people do appreciate the monthly posts, so I/we'll keep on
  doing them. If anyone has any comment, just let us know. However,
  according to the current state of the poll, there's also one person
  who finds this thread a bit spammy - and there might be more. I'll
  leave the poll open for as long as discuss allows me, so that I can
  see if that number increases in the future. In the meantime: I'm sorry
  for the inconvenience for the very few who find the posts spammy!

  This month, we're having the meeting on Monday instead of Tuesday,
  same time as always: [date=2024-02-19 time=18:00:00
  timezone="Europe/Madrid"] . That's also reflected in the public
  calendar event. Here's our agenda. Remember that everyone is welcome
  to add things:
  ‣ 5.2 support
    ‣ Let's discuss the complicated compiler AST changes for 5.2, among
      others, if we're testing their support enough.
      ‣ Syntactic support for functions with arity > 1
      ‣ Have there been more complicated AST changes this time?
    ‣ The compiler `ocaml.ppx.context' change
      ‣ This affects the PPX world iff people want to build their
        project with a different OCaml version than their PPX is built
        with. Do we want to keep on supporting that workflow?
      ‣ Why was the change of `ocaml.ppx.context' in the compiler done
        in a breaking way? Is it worth for us to discuss that with them?
    ‣ The ppxlib `~preview' release with 5.2 support
  ‣ Upcoming things to do on `ppxlib'
    ‣ When to start with the work to bump ppxlib's AST to 5.2?
    ‣ When to start with the upstream `Astlib' efforts?
  ‣ In case we have time, let's also discuss how to improve the repo for
    people to get involved easier (issue labels, contribution guidelines
    etc)


Owl project concluding
══════════════════════

  Archive: <https://discuss.ocaml.org/t/owl-project-concluding/14117/1>


solitary_crow announced
───────────────────────

  [more at owl project github repo ]

  Owl project is concluding after 8 years of development.


[more at owl project github repo ] <https://github.com/owlbarn/owl>


Other OCaml News
════════════════

From the ocaml.org blog
───────────────────────

  Here are links from many OCaml blogs aggregated at [the ocaml.org
  blog].

  • [Introducing DBCaml, Database toolkit for OCaml]
  • [Building a Connnection Pool for DBCaml on top of riot]
  • [MetAcsl v0.6 for Frama-C 28.0 Nickel]
  • [Multicore Testing Tools: DSCheck Pt 1]
  • [Speeding elliptic curve cryptography]
  • [Cooperation and Lwt.pause]


[the ocaml.org blog] <https://ocaml.org/blog/>

[Introducing DBCaml, Database toolkit for OCaml]
<https://priver.dev/blog/dbcaml/dbcaml/>

[Building a Connnection Pool for DBCaml on top of riot]
<https://priver.dev/blog/dbcaml/building-a-connnection-pool/>

[MetAcsl v0.6 for Frama-C 28.0 Nickel]
<https://frama-c.com/fc-plugins/metacsl.html>

[Multicore Testing Tools: DSCheck Pt 1]
<https://tarides.com/blog/2024-02-14-multicore-testing-tools-dscheck-pt-1>

[Speeding elliptic curve cryptography]
<https://blog.robur.coop/articles/speeding-ec-string.html>

[Cooperation and Lwt.pause]
<https://blog.osau.re/articles/lwt_pause.html>


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
  to the [caml-list].

  [Alan Schmitt]


[send me a message] <mailto:[email protected]>

[the archive] <https://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <https://alan.petitepomme.net/cwn/cwn.rss>

[caml-list] <https://sympa.inria.fr/sympa/info/caml-list>

[Alan Schmitt] <https://alan.petitepomme.net/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.