OCaml Roundup: January 2026 [ocaml-roundup-january-2026]
- February 5, 2026
- Patrick Ferris
A new year, another roundup in my open-source, OCaml activities. This month has been busy with lots of work on ocaml-tiff thanks to Tambe Salome and ppxlib.
Outreachy
- February 5, 2026
- Patrick Ferris
Tambe Salome has been working to add write support to ocaml-tiff; and we are well on the way to having good support. Writing TIFF files is no easy business. Unlike many formats, TIFF files have an internal metadata-data split, with values sometimes being place nowhere near the metadata describing the values in the file. In practice, it means if you do not wish to read the whole file into memory, then your IO layer must support seeking to file offsets. This means when you come to write the file, you might need to write at different offsets too.
This becomes particularly complicated when you do not know ahead of time how you are going to layout the file (e.g. how many strips will the raw data be separated into). For now, we are doing the sane first step and assuming we are copying a TIFF file we have access to but pushing all the copying via the OCaml values we read from our source TIFF. And Salome has made excellent progress:
$ exiftool test/data/uniform.tiff > input.exif $ dune exec -- example/copy.exe test/data/uniform.tiff example.tiff $ exiftool example.tiff > output.exif $ patdiff input.exif output.exif ------ input.exif ++++++ output.exif @|-1,23 +1,23 ============================================================ |ExifTool Version Number : 13.39 -|File Size : 66 kB +|File Size : 118 bytes |File Permissions : -rw-r--r-- |File Type : TIFF |File Type Extension : tif |MIME Type : image/tiff |Exif Byte Order : Little-endian (Intel, II) |Image Width : 256 |Image Height : 256 |Bits Per Sample : 8 |Compression : Uncompressed |Photometric Interpretation : BlackIsZero |Strip Offsets : 122 |Rows Per Strip : 256 |Strip Byte Counts : 65536 |Planar Configuration : Chunky |Image Size : 256x256 |Megapixels : 0.066
From this slightly edited output, we can see that the OCaml libary is doing a good job at preserving the metadata. The file size discrepancy is because we have not tackled writing the raw data to the file yet! This is next on our TODOs, write data to a file given a strip-offset plan. Once we do that we can then start to think how might we come up with such a plan if we did not have one.
Ppxlib
- February 5, 2026
- Patrick Ferris
The first cut of OCaml 5.5 is not too far away, at which point the Parsetree will be frozen. Unfortunately (for ppxlib maintainers), a handful of new features sneaked into this release including: modular explicits, external type declarations and the previously mentioned local structure items.
All of these features require migrations to support newer compilers. In this migration process, ppxlib lowers modern ASTs to the AST of OCaml 5.2. New AST nodes (or new items of exisiting AST nodes) must be encoded to survive the migration process. We have a few PRs to support 5.5 fully:
Additionally, Nathan has been adding better feature encoding support for the 5.3 and 5.4. Unlike the migration code above, these also include Ast_builder and Ast_pattern functions for building and matching on the new AST nodes. This allows ppx authors to use those nodes in their ppxes.
Finally, we have an important bug fix where long identifiers were given a Location.none. Unfortunately, it is not possible to fully recover a long identifier's location because of the possibility of whitespaces (e.g. Foo (M).t is valid). Read more about that fix here.