Thicket thicket
ocaml
REPOS 2

Core covers the OCaml compiler and language RFCs.

September 2026Core

OCaml 5.5.1 is out, patching a type-system bug in module-dependent functions and closing integer-overflow holes in Marshal and bytecode loading. It also fixes a 5.5.0 regression on Windows where a single non-yielding thread could starve every other thread in its domain. If you run 5.5 on Windows or handle untrusted serialized data, this is the update to make. Release notes

Windows networking picked up a cluster of fixes across the month. Unix.select previously returned wrong descriptors when a socket appeared in multiple file-descriptor lists, and a follow-up patch closed an out-of-bounds array access in the 63-fd emulation path plus a socket-handle leak on the error path. Together these make select-based I/O on Windows noticeably more trustworthy. #15025 #15093

Two changes in trunk will touch existing code. The with module type syntax now binds tighter, so a signature like T with module type S = X -> X parses as T with module type S = (X -> X); code that relied on the old grouping will fail to compile. Separately, the bit-manipulation functions Int.popcount, Int.leading_zeros, and Int.trailing_zeros have merged, lowering to single clz and ctz instructions on amd64 and arm64 for a measured two-to-three-fold speedup. #14978 #15018

W39.2026 · 21–27 SepCore

Features

  • Dynarray.sort, Dynarray.stable_sort, Dynarray.stable_sort_sub added to the standard library. They delegate to Array.stable_sort_sub and raise on length change. Merged. (#14848)

  • Bulk float-array operations (dot, sum, scale, axpy, add, mul) proposed as Float.Array primitives. The compiler emits a four-lane Cmm loop; an arm64 NEON exemplar is included. Open proposal. (#15094)

Compatibility

  • Weak.get_copy is deprecated and now an alias of Weak.get (no shallow copy). Code relying on the copy-to-avoid-lifetime-extension semantics must migrate. Merged. (#15064)

  • New warning 76 (syntactic-unerasable-optional-argument) proposed for optional arguments not followed by a non-labelled argument. Extends warning 16; disabled by default. Open proposal. (#15097)

Fixes

  • Int.popcount, Int.leading_zeros, Int.trailing_zeros now lower to %popcount/%clz/%ctz primitives. arm64 emits a single instruction; other backends fall back to a C call. 2–3× speedup on amd64 and arm64. Merged. (#15018)

  • Unaligned memory accesses enabled on s390x. Bytes.get_int64 and related operations no longer emit byte-at-a-time sequences. 2× speedup on z15 for unaligned 64-bit reads. Merged. (#15090)

  • Typemod.type_package now calls Mtype.lower_nongen, preventing a weak type variable from unifying with an out-of-scope type. The compiler previously accepted programs that should be rejected. Merged. (#12195)

  • Unix.select on Windows: fixed an out-of-bound array access in the 63-fd packet emulation and a socket-handle leak on the error path. Merged. (#15093, #14975)