Thicket thicket
ocaml
REPOS 5

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

W27.2026 · 29 Jun – 5 Juloxcaml/oxcaml

Features

  • SSA intermediate representation (experimental, -use-ssa): New SSA IR between Cmm and CFG with a reducer framework, automatic dead-code elimination, and a Cfg_compare validator that checks register-equivalence against the legacy pipeline. Currently on by default for coverage; forced off under -llvm-backend. #5810

  • Functional mode polymorphism (experimental, -extension mode_polymorphism_alpha): Integrates level-relation operations (update-level, generalize, instantiate) into type inference. Polymorphic mode variables are printed as [< 'm] / [> 'm] bounds with constraints. Printing gated behind -extension mode_polymorphism_printing. #5483

  • Compact frametable encoding (draft): Reworks native-code frame tables via alignment removal, linker string de-duplication, and a "short" descriptor format. Reduces rodata by ~28% and total executable size by ~5.5% on measured binaries. ARM64 and internal-assembler support pending. #6399

  • Heap extension runtime API (draft): caml_add_extent(base, size, free_callback) registers externally-allocated memory as valid OCaml blocks managed by the GC. The callback fires when all blocks in the extent become free. #6248

  • BFS meet strategy for Flambda2 (draft, -X flambda2-meet-strategy=bfs): Replaces depth-first equation processing with breadth-first saturation to avoid losing precision when recursive meets introduce new equations. A "hybrid" variant delays only on detected loops. #6191

  • Alloc regions for zero-alloc checking (draft): Threads alloc_region parameters through all allocating primitives in Flambda2. No checking is performed yet; regions are erased at Cmm translation. Groundwork for @zero_alloc annotations. #6121

Fixes

  • Heap-to-stack pointer invalidation in Flambda2 (draft): Detects when simplify_make_block would construct a heap-to-stack pointer and emits an Invalid node. Addresses a class of memory-corruption bugs previously undetected (e.g. #6316). #6400

  • GADT equation scope escape through functors (open): Corrects constructor scopes after functor application so that types refined by local equations cannot leak into the resulting signature. Prevents spurious typechecking of M.t foo outside a match on the witness. #6406