Thicket thicket
ocaml
REPOS 5

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

W36.2026 · 31 Aug – 6 Sepoxcaml/oxcaml

Features

  • SSA intermediate representation (merged): A new SSA IR sits between Cmm and CFG, with a reducer framework for SSA-to-SSA transforms, aggressive dead-code elimination, and a Cfg_compare validator that checks register-equivalence against the legacy pipeline. Controlled by -use-ssa (temporarily on by default). #5810

  • Link-time optimization prototype (merged): The Reaper now serialises whole-program solutions to .ltosol files, computes calling-convention changes and slot offsets at solve time, and rebuilds from the stored solution rather than re-solving. A draft LTO branch tracks further work. #6964, #7030, #7082, #6895 (open)

  • Functional mode polymorphism (merged): Mode variables are now first-class in type inference, with generalisation, instantiation, and subsumption. Enabled via -extension mode_polymorphism_alpha; subsumption prevents a soundness hole where a less-polymorphic implementation was accepted against a more polymorphic signature. #5483, #6279

  • Static functors (open): Introduces "templates" whose arguments exist at both compile-time and runtime, enabling compile-time functor application with fracturing and eval. Currently restricted to single-argument functors; partial application planned in follow-up. #6846

  • Experimental compiler fuzzer (open): A random-program generator covering a subset of OxCaml. Already discovered double-rounding bugs in blambda float32/int64 conversions. #6933, #7064

  • Datalog-based CFG validators (merged): Adds -cfg-eliminate-dead-code-validate, -cfg-dominators-validate, and -cfg-liveness-validate flags that independently recompute pass invariants via the internal Datalog engine (Z3 fallback), providing a cross-check on the CFG stage. #7076

  • Metaprogramming unit unloading (open): A nine-PR stack adds runtime support for GC-reclaimable JIT-compiled units: code blocks are donated to the major heap, the mark phase tracks code pointers via frame descriptors, and the loader activates/deactivates units. #7050

  • Atomic primitives for unboxed types (merged): New %unsafe_atomic_*_ptr and %unsafe_atomic_*_ext_ptr families operate on block pointers and externally-managed memory. Byte-offset-based primitives eliminate a redundant shift+tag on every idx_atomic access. The caml_domain_alone fast-path is removed to prevent non-atomic stores. #6802, #6831, #6747, #6937 (open)

Fixes

  • Reaper miscompilation in -Oclassic (merged): When all arguments of a tupled function are unused, the tupled argument was deleted, causing a segfault in the caml_tuplify wrapper. The reaper now preserves the tuple accessors. The -Oclassic reaper path was reverted and re-landed with this fix. #7072, #7075

  • Allocation pointer bug on stack overflow (merged): The SEGV-to-caml_raise_stack_overflow path failed to save %r15, corrupting recently-allocated values. A regression test with --disable-stack-checks is included. #7020 (merged 9/10, outside interval—omitted)

Compatibility and Releases

  • Magic numbers bumped to 586 for the 5.4.0-ox7 release. #7019