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 December 19 to 26,
2023.
Table of Contents
─────────────────
Release of odoc 2.4.0
Ppxlib dev meetings
grid 0.1.0 - A tiny library for two-dimensional arrays
Draft tutorials on Modules, Functors and Libraries
Esperanto, when OCaml meets Cosmopolitan
OCaml in cultural heritage
colors 0.0.1 – colorspace manipulation in pure OCaml
OCaml is *awesome*
Other OCaml News
Old CWN
Release of odoc 2.4.0
═════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-release-of-odoc-2-4-0/13676/1>
Emile Trotignon announced
─────────────────────────
The odoc team is delighted to announce the release of odoc 2.4.0. It
mainly contains support for search engines. There are of course
bugfixes and smaller new features.
:star2: Spotlight Feature of Odoc 2.4.0 : Search
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Odoc now support searching in the documentation ! The search is made
to run in the browser, so that you do not need a server to enable
search: you can have search on your documentation hosted on github
pages or even locally on your machine.
No search engine is shipped with, you need to provide one, but all the
facilities to make use of one are present. We adapted @art-w ’s
[sherlodoc] for seamless integration with odoc, alongside with new
features. It is not yet released on opam, but we hope it will be soon.
You can already test sherlodoc and play with it on your own projects,
there are instructions in its [readme]. Sherlodoc has fuzzy
typed-based search like [hoogle] in the haskell world, and is made to
work best for OCaml (unlike a general purpose search engine like
elastic search).
Check the results on odoc’s own online documentation :
[ocaml.github.io/odoc].
[sherlodoc] <https://github.com/art-w/sherlodoc/tree/jsoo>
[readme] <https://github.com/art-w/sherlodoc/blob/jsoo/README.md>
[hoogle] <https://hoogle.haskell.org/>
[ocaml.github.io/odoc] <https://ocaml.github.io/odoc/>
:handshake: Join The Mission
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
While we are dedicated to developing the best tooling to generate and
serve documentation on OCaml.org, creating a well-documented library
ecosystem can only be a collective effort. Package authors: we’re
working hard to give you great tools, but we’ll need all your help to
create an ecosystem of well-documented libraries for OCaml!
If you find that writing documentation for your library isn’t as
straightforward as you would like, please do share your feedback with
us.
:gear: Full changelog
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
◊ Added
• Add support for external search engines (@panglesd, @EmileTrotignon,
#972) This includes the generation of an index and the display of
the results in the UI (HTML only).
• Display ’private’ keyword for private type extensions (@gpetiot,
#1019)
• Allow to omit parent type in constructor reference (@panglesd,
@EmileTrotignon, #933)
◊ Fixed
• Warn and exit when table(s) is not closed (@lubegasimon, #1050)
• Hint when list(s) is not closed (@lubegasimon, #1050)
• Fix crash on functors returning an alias (@Julow, #1046)
• Fix rendering of polymorphic variants (@wikku, @panglesd, #971)
• Add references to extension declarations (@gpetiot, @panglesd, #949)
◊ Changed
• Style: Adjusted line height in the TOC to improve readability
(@sorawee, #1045)
• Style: Remove font fallback to Helvetica, Arial (@Julow, #1028)
• Style: Preformatted elements fallback to UA monospace (@toastal,
#967)
• Style: Sidebar is now stuck to the left of the content instead of
the left of the viewport (@EmileTrotignon, #999)
Ppxlib dev meetings
═══════════════════
Archive: <https://discuss.ocaml.org/t/ppxlib-dev-meetings/12441/13>
Continuing this thread, Sonja Heinze announced
──────────────────────────────────────────────
Here are today’s meeting notes:
<https://github.com/ocaml-ppx/ppxlib/wiki/Dev-meeting-19-12-2023>
From next meeting on, I’ll make sure to only send one message on
discuss per meeting containing both the agenda and a link to future
meeting notes.
Have a nice new year everyone! :tada::)
grid 0.1.0 - A tiny library for two-dimensional arrays
══════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-grid-0-1-0-a-tiny-library-for-two-dimensional-arrays/13680/1>
Jean Christophe Filliatre announced
───────────────────────────────────
Dear all,
My colleague @K_N managed to have half of the lab addicted to [Advent
of Code] :sweat_smile:
This year, many problems involve grids, and it proved useful to have a
tiny library to handle two-dimensional arrays. So here it is (and via
opam):
• <https://github.com/backtracking/grid>
• [documentation]
Nothing sophisticated, and nothing you could not do with `Array' from
the standard library, of course, but useful nonetheless.
Note: This is /not/ a linear algebra library.
Happy hacking, Jean-Christophe
[Advent of Code] <https://adventofcode.com/2023>
[documentation] <https://backtracking.github.io/grid/>
Draft tutorials on Modules, Functors and Libraries
══════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/draft-tutorials-on-modules-functors-and-libraries/13686/1>
Cuihtlauac Alvarado announced
─────────────────────────────
Dear OCamlers,
The series on ocaml.org tutorial updates continue. This time, the
ocaml.org team has three drafts related to the module system in a
single pull request. We want your feedback on it:
• GH PR: [ Update Modules and Functors Tutorials #1778]
• Online drafts:
• [Modules] — This is refresh of the previous version
• [Functors] — This is mostly new material
• [Libraries With Dune] — This is entirely new material
The *target audience* is developers learning OCaml. No functional
programming knowledge is assumed. However, it comes after the “Get
Started” series:
1. [Installing OCaml]
2. [A Tour of OCaml]
3. [Your First OCaml Program]
They also require the first two tutorials of the “Introduction” series
as prerequisites:
1. [Values and Functions]
2. [Basic Datatypes and Pattern Matching]
As the previously announced drafts, these also contain overlooked
issues. We want to make it better with your help.
Share your feedback on GitHub or here, but do not use the “Contribute”
link at the bottom of the staging pages.
Hope it helps
[ Update Modules and Functors Tutorials #1778]
<https://github.com/ocaml/ocaml.org/pull/1778>
[Modules] <https://staging.ocaml.org/docs/modules>
[Functors] <https://staging.ocaml.org/docs/functors>
[Libraries With Dune] <https://staging.ocaml.org/docs/libraries-dune>
[Installing OCaml] <https://ocaml.org/docs/installing-ocaml>
[A Tour of OCaml] <https://ocaml.org/docs/tour-of-ocaml>
[Your First OCaml Program] <https://ocaml.org/docs/your-first-program>
[Values and Functions] <https://ocaml.org/docs/values-and-functions>
[Basic Datatypes and Pattern Matching]
<https://ocaml.org/docs/basic-data-types>
Esperanto, when OCaml meets Cosmopolitan
════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-esperanto-when-ocaml-meets-cosmopolitan/10501/4>
Calascibetta Romain announced
─────────────────────────────
I’m glad to announce the release of Esperanto (0.0.5). This release
integrates the last release of [Cosmopolitan 3.1].
The latter incorporates a great deal of work on the Cosmopolitan
toolchain:
1) a modification of the GCC compilation so that code no longer needs
to be patched to transform constants into variables
2) cross-compilation support for aarch64
3) support for Apple Silicon
This release introduces a change in the construction of the portable
artifact from OCaml source code, which is explained [here]. More
generally, the steps are:
• compilation to `x86_64'
• compilation to `aarch64'
• linking the two artifacts with `apelink'.
Currently, this version of Esperanto has been tested with [bob], an
OCaml file-sharing program. We have tested its portability on Debian,
Ubuntu, Mac M1, FreeBSD and Windows. As we make clear in the
description, Esperanto’s sole purpose is to assist in the distribution
of software (rather than to provide a supportive environment for
developers). We therefore advise you to use Docker (or related
technology) to create your portable executable from your sources
([bob] has, for example, a GitHub CI that produces such an
executable).
Of course, we’re planning to integrate with OCaml 5, since `pthread'
support is now available in Cosmopolitan (it wasn’t at first). So we
only support OCaml 4.14 and OCaml 4.13. We’re waiting for a review of
another project which is preparing its transition to OCaml 5
([`ocaml-solo5']) before integrating it into Esperanto.
Finally, we would like to thank the [robur.coop] cooperative (which
you can [help]) for giving us the freedom to maintain this project.
PS: Esperanto is still in [a release process]() (and not immediately
available via OPAM), but the process should be completed in the next
few days.
[Cosmopolitan 3.1]
<https://twitter.com/justinetunney/status/1726141024597324189?t=K1nIh-2Y7JjaoOc9Y6bUzA>
[here] <https://github.com/dinosaure/esperanto>
[bob] <https://github.com/dinosaure/bob>
[bob]
<https://github.com/dinosaure/bob/blob/main/.github/workflows/esperanto.yml>
[`ocaml-solo5'] <https://github.com/mirage/ocaml-solo5/pull/124>
[robur.coop] <https://robur.coop>
[help] <https://robur.coop/Donate>
OCaml in cultural heritage
══════════════════════════
Archive:
<https://discuss.ocaml.org/t/ocaml-in-cultural-heritage/13696/1>
zedstar announced
─────────────────
Hi all!
Just wanted to share some efforts to bring OCaml to the cultural
heritage sector. So far I have built a web annotation server using
Dream and Irmin <https://github.com/nationalarchives/miiify> but have
some plans to continue the work.
The challenges for our digital services are mainly around scale and
there is a growing interest around green computing. Inspired by the
talk Hannes gave at CCC, it would be great to explore the benefits of
MirageOS!
colors 0.0.1 – colorspace manipulation in pure OCaml
════════════════════════════════════════════════════
Archive:
<https://discuss.ocaml.org/t/ann-colors-0-0-1-colorspace-manipulation-in-pure-ocaml/13697/1>
ostera announced
────────────────
Hi folks :wave: just wanted to share a little library I put together
to do color manipulation in [Mint Tea]. It’ll be used in the next
release of Mint Tea, and allow us to do gradients and all sorts of
nice color stuff:
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/5/56ebee747107d8e9dc9dec79edf7d39b30c98088.gif>
<https://global.discourse-cdn.com/business7/uploads/ocaml/original/2X/5/543f4fae71143670719e56e7e294e7b138c54ff7.gif>
This first release of colors:
• Introduces RGB, LRGB, XYZ, LUV, UV types
• Includes standard white reference point `d65`
• Supports Linearizing/Delinearizing RGB
• Includes conversions between ANSI, RGB, LRGB, XYZ, and LUV
• Has blending for LUV and RGB (via LUV) with configurable mixing
• Includes an ANSI to RGB color table
I’m hoping to keep it super small and in pure OCaml so we can use it
for terminals but also other places like web, or other graphics
settings.
You can read the full [changelog here].
If you’re interested in contributing to any of these, look for open
[good first issues], and don’t hesitate to reach out on Discord/X:
@leostera :slight_smile:
Happy hacking! :camel: :hand_with_index_finger_and_thumb_crossed:
[Mint Tea] <https://github.com/leostera/minttea>
[changelog here]
<https://github.com/leostera/colors/blob/main/CHANGES.md>
[good first issues]
<https://github.com/leostera/colors/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22>
OCaml is *awesome*
══════════════════
Archive: <https://discuss.ocaml.org/t/ocaml-is-awesome/13700/1>
jbeckford announced
───────────────────
I have a full article and repository at
[https://gitlab.com/diskuv/samples/merrychristmas2023#dksdk-merry-christmas-2023].
Short version … huge thanks to Oleg for his preprint paper [Generating
C: Heterogeneous metaprogramming system description]. I’ve adapted it
so it mostly works with PPX and without BER MetaOCaml (although I
intend to switch to BER MetaOCaml at some point).
Typing real OCaml on your keyboard:
┌────
│ $ git clone https://gitlab.com/diskuv/samples/merrychristmas2023.git
│ $ cd merrychristmas2023
│ $ opam switch create . 4.14.1 # or on Windows: dkml init
│ $ opam install . utop --with-test --yes
│ $ opam exec -- dune utop
│ #require "metaquot.ppx";;
│ open DkSDKMetatype_Offshore;;
│ open Xmas2023;;
│ let sum_ar_staged =
│ ( Lexing.dummy_pos,
│ [%expr
│ fun arr n ->
│ let sum = ref 0 in
│ for i = 0 to 3 do
│ for j = i to min (i + 3) (n - 1) do
│ sum := !sum + arr.(j)
│ done
│ done;
│ !sum],
│ Lexing.dummy_pos ) ;;
│
│ print_c "sum_ar" (module SumArConv) sum_ar_staged ;;
└────
prints real C code:
┌────
│ int DkSDKMetatype_Offshore_sum_ar(int * const arr,int const n){
│ int sum = 0;
│ for (int i = 0; i < (1 + 3); i += 1)
│ for (int j = i; j < (1 + min(i + 3,n - 1)); j += 1)
│ sum = sum + (arr[j]);
│ return sum;
│ }
└────
Other languages are easy to add.
Merry Christmas! Jonah
[https://gitlab.com/diskuv/samples/merrychristmas2023#dksdk-merry-christmas-2023]
<https://gitlab.com/diskuv/samples/merrychristmas2023#dksdk-merry-christmas-2023>
[Generating C: Heterogeneous metaprogramming system description]
<https://www.sciencedirect.com/science/article/abs/pii/S0167642323000977>
Other OCaml News
════════════════
From the ocaml.org blog
───────────────────────
Here are links from many OCaml blogs aggregated at [the ocaml.org
blog].
• [OCaml Survey: Developers’ Perception, Interest, and Perceived
Barriers]
• [OCaml: Memory Safety and Beyond]
[the ocaml.org blog] <https://ocaml.org/blog/>
[OCaml Survey: Developers’ Perception, Interest, and Perceived Barriers]
<https://tarides.com/blog/2023-12-20-ocaml-survey-developers-perception-interest-and-perceived-barriers>
[OCaml: Memory Safety and Beyond]
<https://tarides.com/blog/2023-12-14-ocaml-memory-safety-and-beyond>
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/>