Thicket thicket
ocaml
REPOS 5

OxCaml covers the compiler extensions and their supporting tools and packages.

September 2026OxCaml

The most significant development this month is the continued progress on link-time optimisation. The reaper's whole-program solver, which had been a prototype earlier in the month, was split into three stages—traverse, solve, and rebuild—each runnable in a separate compiler invocation, with intermediates stored in .cmx and .ltosol files. By the end of the month, a demo build of ocamlopt itself produced an ARM64 binary 41.6 percent smaller than the non-LTO version. The pull requests remain open, so none of this is in a release yet, but the design is concrete. (Source, Source)

A new intermediate representation was merged into the optimiser's code-generation pipeline, adding dead-code elimination as a dedicated pass. It was temporarily enabled by default earlier in the month and is now gated behind an experimental-optimisations flag; it is incompatible with the LLVM backend. Users on the default build path should expect the optimisation sequence to shift in upcoming releases. (Source)

Mode polymorphism, which makes mode variables first-class in type inference with generalisation and subsumption, was merged and is available behind an extension flag. A compilable demo combining the pieces appeared mid-month, and a principality-check fix for mode crossing landed in the final week. Separately, a segfault in the reaper that occurred when unboxing was disabled was fixed, closing that particular crash path. (Source, Source)

W39.2026 · 21–27 SepOxCaml

Features

  • SSA intermediate representation (merged): New -use-ssa flag activates an experimental SSA pipeline between Cmm and CFG, gated by -experimental-optimizations. Incompatible with -llvm-backend. #5810

  • Link-time optimisation flags (open): -support-lto, -reaper-solve, and -reaper-rebuild enable whole-program LTO across .cmx units. A demo ocamlopt build produces a 41.6%-smaller ARM64 binary. #7264 #7268 #7274 #7289

  • Linker-level dead code elimination (open): Per-symbol data sections allow --gc-sections to drop unreferenced functions and module fields. Measured 31.8% file-size reduction on a 1.3 GB executable; a follow-up reaches 38.2%. #7324 #7334

  • Guard-page stack idling (open): Suspended fibers are moved into malloced buffers, freeing their 8 MiB guarded stack mappings. AMD64 only; OCAMLRUNPARAM Xmax_guarded_stacks (default 1024) bounds total guarded stacks. #7349

  • Allocation mode axis (open): Introduces alloc / noalloc / noalloc_strict as a first-class modality orthogonal to statefulness. The type checker rejects allocation in noalloc contexts. #7162

Fixes

  • Reaper segfault with -no-reaper-unbox (merged): The calling-convention-changes analysis was skipped when unboxing was disabled, causing a segfault. The analysis now runs unconditionally. #7320

  • Principality check for mode crossing (merged): crossing_of_ty used generic_level as threshold, but moregen operates at subject_level, so crossings were always replaced by Crossing.max. The check now tests >= subject_level. #7298

  • dune-ignore patch for oxcaml-compiler (open): A corrected patch is proposed after an upstream implementation change invalidated the existing one. PR remains open. #60

Compatibility and Releases

  • -syntax-quotations / -no-syntax-quotations flags (merged): Syntax quotation is now a per-invocation compiler flag (also OCAMLPARAM syntax-quotations=0|1) rather than a configure-time constant. Accepted by ocamlc, ocamlopt, ocaml, ocamlnat, ocamldep. #7286