Thicket thicket
ocaml
REPOS 9

Tools covers builds, package management, editors, documentation and JavaScript compilation.

W46.2026 · 9–15 Novocsigen/js_of_ocaml

Features

  • The compiler and runtime no longer emit holey arrays for dead block fields or runtime allocations. ocamlc runs 2–4% faster with 4% lower peak memory; fannkuch_redux improves 17%. #2609 (merged, @vouillon)

  • The default switch_size for code generation rises from 60 to 256 cases; switches whose case values span more than 1000 are also split. QuickJS is the only engine measured slower. #2612 (merged)

  • caml_bytes_get/set{16,32,64}u now read and write the underlying Uint8Array directly instead of per-byte calls. The digestif benchmark, which stores state in bytes, was twice as slow before. #2608 (merged, @vouillon)

Compatibility and Releases

  • A draft portint flag represents int as i31 | ref to i64 and nativeint as i64 in Wasm output, making integers wire-compatible with 64-bit native OCaml. No stable API yet. #2617 (open draft, @rricard)

Fixes

  • With GADTs, a variable typed as an integer could be used as a reference in dead code, producing an invalid ref.cast or call on an i32 in Wasm output. The compiler now boxes such variables. #2615 (merged, @vouillon)

  • Empty float arrays in Wasm output (constants, recursive dummies, Float.Array.concat []) carried tag 254 instead of 0, diverging from native behaviour. The tag is now 0. #2594 (merged, @smjleo)

  • Calls to functions stored in blocks are emitted as M[i](x) instead of M[i].call(null, x), restoring V8 inlining. Separate-compilation benchmarks improve 6–19%; whole-program --opt 3 ocamlc is ~2% slower on node 22. #2613 (open, @hhugo)