[ANN] New release of Fix


I am pleased to announce a new release of Fix, with several new modules
contribued by Frédéric Bour (thanks!).

In short, Fix is a toolkit that helps perform memoization and fixed point
computations (including data flow analyses). More generally, it offers a
number of basic algorithmic building blocks that can be useful in many

opam update
opam install fix.20211125

Documentation can be found here:

README.md · master · POTTIER Francois / fix · GitLab
Fix (fix.Fix)


François Pottier


  • The new module CompactQueue offers a minimalist mutable FIFO queue. It is
    comparable with OCaml’s Queue module. In comparison with Queue, it uses
    a more compact internal representation: elements are stored contiguously in
    a circular array. This has a positive impact on performance: both time and
    memory consumption are reduced. This data structure is optimized for maximum
    throughput. (Contributed by Frédéric Bour, reviewed by François Pottier.)

  • The new functor DataFlow.ForCustomMaps offers a forward data flow analysis
    that is tuned for greater performance. (Contributed by Frédéric Bour,
    reviewed by François Pottier.)

  • The new module Indexing offers a safe API for manipulating indices into
    fixed-size arrays. This API involves some dynamic checks as well as static
    type checks, thereby (hopefully) greatly reducing the risk of confusion in
    code that uses many arrays and many indices into these arrays. (Contributed
    by Frédéric Bour, reviewed by François Pottier.)

  • In DataFlow, allow the function foreach_root
    (which is part of the signature DATA_FLOW_GRAPH)
    to call contribute x _ several times at a single root x.


Thanks! This looks nice.

I have used Fix in the past, but I was not aware that it is doing more than efficient fixpoint computation thanks to dynamic dependency checking. (It looks like the project has gone from “descriptive name” to “nice-sounding name that’s not entirely related to what’s in the package”.)

Some idle feedback from just looking at the documentation: I find the main documentation page unstructured and difficult to read. The README is much nicer, but also not what people will get by looking for “the documentation” of the package, manually or through automated tools.

Have you considered moving the README content and structure to the documentation proper, and having a shorter README that points to the documentation for usage examples etc.?

Note: you may be interested in this Discuss thread on how to write a good documentation landing page for packages using Dune. (This is documented in the Dune documentation, but only if you select the “latest” as opposed to “stable” version of the documentation website.)

1 Like

I just came across your reply. Thanks! It is indeed true that Fix now contains much more than a single fixed point computation algorithm, as it did in the early days. It is a toolbox that contains several fixed point computation algorithms as well as utilities related to memoization, numbering objects with unique numbers, hash-consing, safe array access, etc.

Thanks for your advice regarding the documentation; I will have a look at your pointers.

1 Like

Indeed, the result is much nicer, thanks!