A blog at Gallium: informal posts about research, programming practice, OCaml development, and general ramblings.

## ICFP programming contest 2014: a retrospective (part 2/2)

- May 25, 2015
- Last updated on 2015/05/25

This is the second post on the Gagallium participation to the ICFP programming context last year -- 2014. See the first post for the introduction and a link to the source code; this post details the design of the ghost code.

## ICFP programming contest 2014: a retrospective (part 1/2)

- May 22, 2015

The dates for the 2015 ICFP programming contest have been announced on the contest webpage. This is a good occasion to dig out a summary of our 2014 participation, that had been written over the span of several months (mostly right after the contest), and that we had unexplainably failed to publish before.

In 2013, some Gallium members (Thibaut Balabonski, Thomas Braibant, Jacques-Henri Jourdan and Gabriel Scherer) participated to the ICFP programming contest, and it was a lot of fun. We participated again in 2014, with a bit less gallium in the team (blame the precarity of post-docs, and some badly-chosen dates for a honeymoon) and a skewed alphabetic distribution: François Bobot, Pierre Boutillier, Thomas Braibant, Damien Doligez and Gabriel Scherer.

This (double) blog post was written over the course of the last ~5 months by three different persons. With hindsigth, we could probably have phrased some of the post differently. We believe that this blog post is best enjoyed as a pot-pourri of our thoughts, much like our ragtag submission.

## Namespace archeology

- March 19, 2015

At the very end of 2011, and then at the very beginning of 2013, I worked for some weeks on namespaces for OCaml (what they could be, why would we need them, what would be a good solution). The resulting proposal was too complex to gather steam, so I moved on -- and never got around to making the documents publicly available. Here they are.

## Fast vectorizable math functions approximations

- January 26, 2015
- Last updated on 2015/01/27

How and why I designed my own approximated implementations
of `log`

, `exp`

, `sin`

and `cos`

. The approximation error is quite
small, and the functions are fast and vectorizable. For example, my
`logapprox`

function is 7.5x faster in tight loops than
the `icsi_log`

function, while being more precise.

## Left-recursive versus right-recursive lists in LR parsers

- January 21, 2015
- Last updated on 2015/01/22

Contrary to top-down (LL) parsers, which do not support left recursion, bottom-up (LR) parsers support both left recursion and right recursion. When defining a list-like construct, a user of an LR parser generator, such as Menhir, faces a choice between these two flavors. Which one should she prefer?

Two considerations guide this choice: expressiveness (which flavor leads to fewer conflicts?) and performance (which flavor leads to a more efficient parser?).

In this post, I am mainly interested in discussing expressiveness. I also comment on performance in the setting of Menhir.

As we will see, the bottom line is that neither formulation seems deeply preferable to the other.

## Normalization by realizability also computes

- December 2, 2014
- Last updated on 2014/12/02

I share with Pierre Dagand the pleasure of having finished
the redaction of a small article on realizability for JFLA
15 (Journées francophones des langages
applicatifs). It is a rather simple presentation of the *computational
content* of adequacy proofs, which we hoped to understand better by
exhibiting their proof terms as well-typed lambda-terms in a dependently
typed meta-language.

http://gallium.inria.fr/~scherer/research/norm*by*rea/dagand-scherer-jfla15.pdf

## 2-or-more approximation for intuitionistic logic

- November 25, 2014

I just finished the proof of a property of the simply-typed lambda-calculus that hopefully can serve as a termination argument to decide whether a type has a unique inhabitant.

http://gallium.inria.fr/~scherer/drafts/2-or-more-approximation.pdf

The 10-pages note containing the proof is available, and all comments are warmly welcome -- in particular about an already-existing proof of this result, I don't know about any. The rest of this post is (a HeVeA rendering of) the introduction, motivating the problem and presenting the fact to be proved -- or disproved. Feel free to ask yourself whether it is true or false before looking at the full note. The answer is at the last sentence of the introduction (only in the note).

It is interesting that we don't have much intuition about whether the result is true or false -- I changed my mind several times about it, and people asked about it guessed different way. The proof, however, is relatively simple and not particularly technically involved -- but I spent a few days simplifying the concepts and the notations.

## Two final versions and a Verasco release

- November 3, 2014

We have just submitted the final version of two papers, presenting the state of our recent research.

- A Formally-Verified C Static Analyzer, by Jacques-Henri Jourdan, Vincent Laporte, Sandrine Blazy, Xavier Leroy, and David Pichardie
- Verified compilation of floating-point computations, by Sylvie Boldo, Jacques-Henri Jourdan, Xavier Leroy, and Guillaume Melquiond

## Lawvere theories and monads

- July 29, 2014
- Last updated on 2014/07/30

In this Agda file, I give an introduction to Lawvere theories and Monads. It's not exactly a "gentle" introduction because:

- I'm still trying to grok these things myself,
- I've to live up to my reputation of writing unfathomable gagaposts.

We'll start with the State monad and, briefly, a Tick monad. The game is the following: I'll present them syntactically -- through a signature -- and semantically -- through a collection of equations. I'll then show how the usual monad is related to this presentation.

## Paper draft: the Essence of Ornaments

- June 16, 2014

The Essence of Ornaments (pdf) is a draft of a new article, hoping to provide an accessible introduction to the theory of ornaments. Any feedback on the draft, in the comments or by email, is warmly welcome.