OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of November 22 to 29, 2022.

Table of Contents

B·o·B, an universal and secure peer-to-peer file-transfer in OCaml

Continuing this thread, Yawar Amin asked and Calascibetta Romain replied

Hello and thank you for your interest in the project!

Does this mean that uncompressed files are sent without encryption?

Any documents sent with Bob is encrypted :) . What we don’t want to do is infer the MIME type of what the user wants to send - in this we are not trying to introspect the content of the document. The trade-off is that we can’t infer whether it would make sense to compress the document or not. For example, a user might expect Bob to be smart enough to recognise the document as a video and, in that case, not compress the document. This is not the case, however, if you do not want to introspect the MIME type of the document to be sent.

In other words, the user must be aware of what is trying to be sent and use --no-compression or not accordingly. Again, the latter option does not override the encryption :) .

Would it be possible to use the relay only for establishing the connection and after that is done for the relay to connect the two peers directly, removing itself from the middle?

One of the improvements we want to make is the ability for Bob to actually do “peer-to -peer” - and not go through the relay. However, we would like to keep the default of using the relay for simplicity. The peer-to-peer case probably requires a network state (open ports, accessible peer) that many don’t have for various reasons - conversely, we know that it is possible for the user not to have access to our relay (but to have access to the peer) and it is in this case that we would like to do true peer-to-peer.

ISO3166 (Country Codes)

Patrick Ferris announced

Hello :wave:

On behalf of the geocaml organisation, I’m happy to announce the initial release of ISO3166, a very simple library for working with “country codes”.

# ISO3166.alpha3_to_country `IRL |> ISO3166.Country.name;;
- : string = "Ireland"

The Country module already contains all of the countries for convenience named after the alpha2 country code.

# ISO3166.Country.fr |> ISO3166.Country.name;;
- : string = "France"
# ISO3166.Country.fr |> ISO3166.Country.numeric |> ISO3166.numeric_to_string;;
- : string = "250"

This is the data source, read it with care if you want to use this library in your code.

Happy coding :))

Is there any way to get live preview of plots from Owl_plplot?

Continuing this thread, sanette announced

Done!

version 0.6 (github) now uses SDL2 (via tsdl)

OCaml Community Code of Conduct

Sudha Parimala said

Once again, thanks everyone for all the feedback here and over DMs. Really appreciate everyone’s involvement in this. Below is our response. Feel free to nudge us if we missed somethig!

Scope of the Code of Conduct

The list of spaces has been modified to better capture the essence of the spaces this Code of Conduct applies to (thanks to Xavier & Gabriel for the wording)

These rules apply to the projects hosted in the GitHub ocaml organization, the discuss.ocaml.org forum, the [caml-list@inria.fr](mailto:caml-list@inria.fr) mailing list, [OCaml IRC](irc://irc.libera.chat:6697/#ocaml), OCaml discord, physical events like OCaml Workshop, and any other OCaml-related space that adopted this Code of Conduct. A more comprehensive list of spaces is available at the code-of-conduct GitHub repository.

Built-in moderation tools

Platforms such as discuss have built-in moderation tools to make it easier to bring something to the attention of the moderators. At the moment, we think it might be best to keep admin activities such as spam filtering and Code of Conduct violations separate. We may want to display Code of Conduct details at platforms like discuss/discord etc. Happy to sync on this with the admins and moderators of the various platforms on this.

Offline events

This code of conduct document can serve as a good place to start for offline events such as OCaml workshop, Mirage retreat, local meetups etc., but it may not be sufficient to cover all the needs for physical events. The Code of Conduct team is willing to work with organisers of OCaml related physical events to improve the text and help with moderation.

Violations outside community spaces

We understand inhibitions about including violations outside community spaces, though we think it’s important not to skip it in the text. It is in order to account for interactions not within the places we’ve listed explicitly; such as direct messages, private mailing lists etc. in the context of OCaml community. Hopefully we have little need to fall back to this clause, and even when there is it will be evaluated in a case by case basis.

Reporting

As mentioned in the document itself, the rules apply to everyone in the community. We would like to make it clear that there are no exceptions to this, including Code of Conduct committee members. If a report is submitted on a committee member, the report will be treated as any other report, the committee composed by all members except the one reported against. If any other member wants to recuse themselves for whatever reason, they will be free to do so. In fact, members will be free to recuse themselves for any report before the discussions start, e.g. if the reporter or the person whom it is reported against is close to the member. This is one of the reasons individual emails to contact members are made available, people are free to contact a subset of the committee members to submit a violation report. Again, the member will recuse from the process when they themselves are reporting a violation. If a member’s actions are found to be in strong violation of the CoC, after necessary steps are taken, they may also be asked to resign and a new member inducted.

Next steps

The text has a more permanent place at https://github.com/ocaml/code-of-conduct. You are welcome to use it for your OCaml projects. Recommendations for using this Code of Conduct can be found in the repository. Feel free to get in touch or use the issue tracker if you have questions.

Adopting the OCaml Code of Conduct

Sudha Parimala announced

Hello everyone!

The OCaml Community Code of Conduct is hosted at https://github.com/ocaml/code-of-conduct. The code of conduct applies to the spaces listed in the document, namely the GitHub ocaml organization, the discuss.ocaml.org forum, the [caml-list@inria.fr](mailto:caml-list@inria.fr) mailing list, [OCaml IRC](irc://irc.libera.chat:6697/#ocaml), OCaml discord, physical events like OCaml Workshop.

In addition to this, OCaml open source projects and OCaml community spaces are welcome to adopt this Code of Conduct. When you adopt this code of conduct for your project, you can add your project to the list of adopters.

You are requested to add your contact details for reporting violations, and/or you may also add the Code of Conduct team’s contact details for reporting violations if you wish. Some recommendations to add the Code of Conduct to your projects here.

Happy inclusive camling!

OCaml 5.0.0, second beta release

octachron announced

The release of OCaml 5.0.0 is drawing close.

In order to test the most recent bug fixes and to help you update your software and libraries ahead of the release, we have released a second beta version of OCaml 5.0.0, (see below for the installation instructions).

If you find any bugs, please report them here:

https://github.com/ocaml/ocaml/issues

Compared to the first beta release, this second beta contains many small internal standard library fixes, one configuration fix and many small bug fixes.

We also have few updates of the documentation, which introduce two new alerts: one for the unstable modules Domain and Effect, and another for functions doing unsynchronized_access to mutable state in the standard library. Those two alerts are disabled by default, but are available for interested users.

The first release candidate for OCaml 5.0.0 is expected to follow closely this second beta release.

If you are interested by the ongoing list of bug fixes, the updated change log for OCaml 5.0.0 is available at:

https://github.com/ocaml/ocaml/blob/5.0/Changes

You can also follow the state of the opam ecosystem on

http://check.ocamllabs.io/

A short summary of the changes since the first beta release is also available below.

Installation instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.0.0~beta2

For previous versions of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.0.0~beta2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

It might be also interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the beta release is available at these addresses:

Fine-tuned compiler configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam updatse
opam switch create <switch_name> ocaml-variants.5.0.0~beta2+options <option_list>

where <option_list> is a comma separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0~beta2+flambda+nffa ocaml-variants.5.0.0~beta2+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions anterior to 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~beta2+options,<option_list>
--repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with “opam search ocaml-option”.

Changes since the first beta

  • Configuration changes
    • #11097: Build native-code compilers on NetBSD/aarch64 (Kate Deplaix, review by Anil Madhavapeddy)
  • Bug fixes
    • #10875, +#11731: Add option to allocate fiber stacks and sigaltstacks with mmap(MAP_STACK) instead of malloc. This is exposed via a configure –enable-mmap-map-stack option, and is enabled by default on OpenBSD where it is mandatory. (Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly, Michael Hendricks and KC Sivaramakrishnan).
    • #11652: Fix benign off-by-one error in Windows implementation of caml_mem_map. (David Allsopp, review by Gabriel Scherer)
    • #11669, #11704: Fix construction of Effect.Unhandled exceptions in the bytecode interpreter. (David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy and Gabriel Scherer)
    • #11184, +#11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)
    • #11194, #11609: Fix inconsistent type variable names in “unbound type var” messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)
    • #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)
    • #11662, #11673: fix a memory leak when using Dynlink, the bug was only present in development version of OCaml 5. (Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)
    • #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)
    • #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
  • Documentation
    • #11193, #11227: documentation on concurrency safety for mutable data types and states in the standard library. A unsynchronized_access alert have been added for functions that require user synchronizations on concurrent access. The new alert is diabled by default. (Florian Angeletti, review by François Pottier and KC Sivaramakrishnan )
    • #11526, add a unstable alert to the Domain and Effect modules. The new alert is disabled by default. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Kate Deplaix)
    • #11640: Add Flambda commonly-used options to the ocamlopt manpage (Amandine Nangah, review by David Allsopp, Florian Angeletti, Sébastien Hinderer, and Vincent Laviron)

OUPS meetup december 2022

zapashcanon announced

The next OUPS meetup will take place on Thursday, 8th of December 2022. It will start at 7pm at the 4 place Jussieu, 75005 Paris.

:warning: :trumpet: It won’t be in the usual room but in the Astier amphitheater in the Esclangon building. :trumpet: :warning:

Please, register on meetup as soon as possible to let us know how many pizza we should order.

As usual, presentations will be streamed on the OUPS’ galène.

For more details, you may check the OUPS’ website.

This month will feature the following talks :

Camlboot: debootstrapping the OCaml compiler - Nathanaëlle Courant

In this talk, I will present Camlboot, a project which debootstraps the OCaml compiler, that is, is able to compile the OCaml compiler without using the bootstrap binary. Camlboot consists in a naïve compiler for a subset of OCaml called MiniML, and an interpreter for OCaml written in MiniML. I will first justify the interest of debootstrapping, then explain the architecture and parts of Camlboot, and finally present the experimental validation of Camlboot.

The Camel’s Voice - Enguerrand Decorne

This presentation will be an informal and simplistic introduction to music programming via a computer. There are many “live coding” languages (SonicPi, TidalCycles), but it is also quite possible to experiment with having fun with our favorite language! I will present various projects on which I have experimented, with accompanying sound demonstrations. Disclaimer: This presentation contains compliments to the MIDI protocol.

YOcaml - Xavier Van de Woestyne

YOCaml is a static blog generator that was developed to test the Preface library. It is relatively impragmatic, partially poorly documented, and has no effective caching strategy. However, its genesis is fun (and tries to use tools not very present in the world of OCaml) and some external contributions have made it quite explicitly coupling with MirageOS. In this presentation, I invite you to discover its general operation, some design choices and a brief tutorial on how to use it.

After the presentations, there will be some pizzas offered by the OCaml Software Foundation ! :pizza:

Optimising an interpreter

Jon Harrop asked

If I have an interpreter written in OCaml and I want it to run code faster without the burden of having to write a compiler what are my options?

I could use MetaOCaml and do staged metaprogramming. Should be easy and achieve a very respectable speedup but MetaOCaml is obscure so I assume dev tools would no longer work?

If I run my interpreter as bytecode can I generate bytecode on-the-fly and have it executed? If so, how? Can malfunction do this sort of thing?

Are there any libraries that might help like expression trees to LLVM compilers?

Didier Wenzek replied

This series of posts might help you: How I wrote my own “proper” programming language. This uses a combination of OCaml/C++/LLVM. So not exactly what you are looking for, but definitely a valuable source of inspiration.

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 online.