6.5.02026-10-23
CHANGES:
Features/Changes
OCaml versions
* Compiler/Runtime: support for OCaml 5.6: use the optimization hints
recorded in the bytecode, support the bit counting primitives and
Sys.filepathexists, Weak.getcopy no longer copies
(#1721, #2227, #2469, #2488, #2493, #2494)
* Compiler/Runtime: OxCaml: block index and small-int string-like indexing
primitives; OxCaml-specific primitives are gated on //If: oxcaml
(#2342, #2463)
* Compiler/Runtime: support building with Introcaml (OCaml fork with runtime
introspection), gated by the introspect flag (#2409)
* Compiler/Runtime: with Introcaml, support runtime introspection
(Introspect.Print and friends) in JavaScript: the descriptor of a block
is stored in its header word above the tag (tag | (desc << 8)), the
block descriptors of the program are embedded, and Marshal.Reserved_bits
is honored; can be disabled with --disable introspection (#2433)
Compiler
* Compiler: require sedlex 3.8.1 (#2503)
* Compiler: faster compilation (about 25% faster than 6.4.1 on large
programs): new Inttrie and Intset data structures,
sharing-preserving Subst and Jstraverse.map, Jstraverse.free as
an iterator, circular-buffer worklists, faster JavaScript printer and
lexer (#2445, #2446, #2447, #2448, #2449, #2452, #2454, #2512)
* Compiler: keep the name of function expressions that do not refer to
themselves; the unused-js-vars warning now reports such names (#2449)
* Compiler: emit large binary string constants as base64 literals, which are
much smaller than \xNN-escaped literals (-14% on the toplevel example)
(#2432)
* Compiler: report JavaScript syntax errors as file:line:col followed by
the offending line; columns start from 1 (#2464, #2471, #2491)
* Compiler: the JavaScript parser accepts source phase imports
(import source x from "m") (#2523)
* Compiler: drop redundant breaks out of labelled blocks, turning the
blocks into if/else statements or conditional expressions; the nesting
this introduces is bounded by --set=breaksinkdepth, and the
mergenodemax parameter is renamed label_depth (#2513)
* Compiler: simplify the generated JavaScript (!x for negated
conditions, no empty if branches) (#2500)
* Compiler: omit the | 0 coercion after an unsigned right shift by a
constant (#2531)
* Compiler: inline pending expressions at the end of a try body, avoiding
temporaries such as try{var c = f(x); return c;} (#2532)
* Compiler: bind identical literals of a bytecode program to a single
variable, which shrinks the generated code and speeds up compilation of
programs with many duplicated constants; identical literals may now be
physically equal (==) (#2547)
* Compiler: fold if (c) return a; return b into return c ? a : b
(#2533)
* Compiler: test integers against 0 by truthiness (!x rather than
0 === x) when the result is only used as a condition (#2538)
* Compiler: simplify !c ? a : b into c ? b : a (#2538)
* Compiler: compare integers directly rather than comparing the result
of compare with 0 (#2529)
* Compiler: faster reading of debug events, used with --pretty and
--debug-info (#2541, #2548)
Effects
* Compiler: with --effects={cps,double-translation}, specialize calls to
known functions before the CPS transformation (#2458)
* Compiler: with --effects=double-translation, only generate a CPS version
of the functions that may run below an effect handler (#2441)
* Compiler/Wasm: with --effects=cps, no longer turn mutually recursive
functions into CPS, since Wasm has proper tail calls (#2441)
* Runtime: specialize one- and two-argument partial applications in
double-translation mode (#2437)
Wasm
* Compiler/Wasm: intern string constants (program-wide with whole-program
compilation, per compilation unit otherwise) (#2436)
* Compiler/Wasm: small code generation improvements (negation, physical
equality on JavaScript values, bigarray dimensions, result types of
runtime primitives, masking of i31 values, range checks in the runtime)
(#2472, #2475, #2529)
Compiler/Wasm: add --setenv, matching jsof_ocaml (#2415)
* Compiler/Wasm: emit a sourcemap mapping at the start of each function, for
the Chrome profiler (#2417)
* Compiler/Wasm: the linker supports the wide arithmetic and custom
descriptor instructions (#2515)
* Compiler/Wasm: store more long-lived toplevel variables in globals; fix a
crash when one of them is assigned in a try body (#2516)
Runtime/Wasm: faster camlhash, compare, lexer engines, Str
searches and outputvalue sharing detection (with WASI, outputvalue
now shares boxed numbers with equal contents); single bound check in
fixed-width Bytes accesses (#2470, #2505)
Libraries
* Lib: add WebGL2 bindings; the webgl example uses WebGL2 and a new
webgl2_particles example demonstrates transform feedback (#1226, #2388)
* Lib: add Crypto (Web Crypto API) bindings (#2380)
* Lib: add Notification and Clipboard bindings (#2379)
* Lib: add Service Worker, MessageChannel/MessagePort and Cache API
bindings (#2381)
* Lib: add FontFace (CSS Font Loading API) bindings (#2255)
Lib: add the Pointer Capture API to Domhtml.element, and
getPredictedEvents, altitudeAngle and azimuthAngle to pointerEvent
(#2403)
* Lib: consolidate the duplicate messageEvent class types into
('target, 'data) Dom_html.messageEvent; the old ones are deprecated
class type aliases (#2382, #2390, #2555)
Lib: add Lwtjs_events.mutation/mutations (MutationObserver) (#250)
Lib: Lwtjs_events.load/error/abort accept any element, not only
images (#2404)
Lib (breaking): Typedarray.float32Array_fromArray and
float64ArrayfromArray take a numbert js_array t, as required by
wasmofocaml (#2416)
Lib (breaking): remove jsofocaml-lwt.logger, as lwtlog is
deprecated (#2378)
* Lib: the native stubs of the JavaScript primitives are weak symbols, so
that they can be overridden (#2435)
Lib: add the jsof_ocaml.devtools library, whose
Jsofocamldevtools.registerformatters installs a custom formatter in
globalThis.devtoolsFormatters: when the compiler is built with Introcaml,
Chrome DevTools then displays OCaml values in OCaml syntax
(Circle ({x = 0; name = "o"}, 1)), expandable to their fields by name;
JavaScript values embedded in them are left to the console (#2433)
Toplevel
* Toplevel: new Wrapped and Async APIs, and protocol, worker and
workerlwtclient sublibraries to run the toplevel in a WebWorker
(#66, #833, #2377)
Bug fixes
Compiler
* Compiler: fix two reference unboxing bugs (#2426, #2489)
* Compiler: fix an invariant violation with recursive inlining
(#2482, #2495)
* Compiler: fix variable coalescing with ES classes (#2462)
* Compiler: fix unsound corner cases of the JavaScript simplification
passes: || fusion of effectful conditions, dropped var declarations
when folding an if, catch-parameter destructuring defaults (#2393)
* Compiler: fix the printing of JavaScript code: parentheses around optional
chains, no ES2021 logical assignments, keep the braces around a single
block-scoped declaration (#2465, #2502)
* Compiler: keep static on the same line as the class element it modifies
(Safari 17 misparsed static class fields) (#2420, #2421)
* Compiler: fix the JavaScript lexer on out-of-range unicode escapes, on
CR, U+2028 and U+2029 inside strings and templates, on numeric separators
in the integer part of a float, and on an HTML close comment --> after a
multi-line comment (#2503, #2524)
Effects
* Compiler: with --effects=cps or double-translation, fix mutable local
variables in try bodies and exception handlers (#2484)
* Compiler: with --effects=double-translation, fix over-applications of
functions that do not perform effects (#2455)
* Compiler/Wasm: with `--effects=
6.5.0~beta2预发布2026-10-22
CHANGES:
Features/Changes
OCaml versions
* Compiler/Runtime: support for OCaml 5.6: use the optimization hints
recorded in the bytecode, support the bit counting primitives and
Sys.filepathexists, Weak.getcopy no longer copies
(#1721, #2227, #2469, #2488, #2493, #2494)
* Compiler/Runtime: OxCaml: block index and small-int string-like indexing
primitives; OxCaml-specific primitives are gated on //If: oxcaml
(#2342, #2463)
* Compiler/Runtime: support building with Introcaml (OCaml fork with runtime
introspection), gated by the introspect flag (#2409)
Compiler
* Compiler: require sedlex 3.8.1 (#2503)
* Compiler: faster compilation (about 25% faster than 6.4.1 on large
programs): new Inttrie and Intset data structures,
sharing-preserving Subst and Jstraverse.map, Jstraverse.free as
an iterator, circular-buffer worklists, faster JavaScript printer and
lexer (#2445, #2446, #2447, #2448, #2449, #2452, #2454, #2512)
* Compiler: keep the name of function expressions that do not refer to
themselves; the unused-js-vars warning now reports such names (#2449)
* Compiler: emit large binary string constants as base64 literals, which are
much smaller than \xNN-escaped literals (-14% on the toplevel example)
(#2432)
* Compiler: report JavaScript syntax errors as file:line:col followed by
the offending line; columns start from 1 (#2464, #2471, #2491)
* Compiler: the JavaScript parser accepts source phase imports
(import source x from "m") (#2523)
* Compiler: drop redundant breaks out of labelled blocks, turning the
blocks into if/else statements or conditional expressions; the nesting
this introduces is bounded by --set=breaksinkdepth, and the
mergenodemax parameter is renamed label_depth (#2513)
* Compiler: simplify the generated JavaScript (!x for negated
conditions, no empty if branches) (#2500)
* Compiler: omit the | 0 coercion after an unsigned right shift by a
constant (#2531)
* Compiler: inline pending expressions at the end of a try body, avoiding
temporaries such as try{var c = f(x); return c;} (#2532)
* Compiler: bind identical literals of a bytecode program to a single
variable, which shrinks the generated code and speeds up compilation of
programs with many duplicated constants; identical literals may now be
physically equal (==) (#2547)
* Compiler: fold if (c) return a; return b into return c ? a : b
(#2533)
* Compiler: test integers against 0 by truthiness (!x rather than
0 === x) when the result is only used as a condition (#2538)
* Compiler: simplify !c ? a : b into c ? b : a (#2538)
* Compiler: compare integers directly rather than comparing the result
of compare with 0 (#2529)
* Compiler: faster reading of debug events, used with --pretty and
--debug-info (#2541, #2548)
Effects
* Compiler: with --effects={cps,double-translation}, specialize calls to
known functions before the CPS transformation (#2458)
* Compiler: with --effects=double-translation, only generate a CPS version
of the functions that may run below an effect handler (#2441)
* Compiler/Wasm: with --effects=cps, no longer turn mutually recursive
functions into CPS, since Wasm has proper tail calls (#2441)
* Runtime: specialize one- and two-argument partial applications in
double-translation mode (#2437)
Wasm
* Compiler/Wasm: intern string constants (program-wide with whole-program
compilation, per compilation unit otherwise) (#2436)
* Compiler/Wasm: small code generation improvements (negation, physical
equality on JavaScript values, bigarray dimensions, result types of
runtime primitives, masking of i31 values, range checks in the runtime)
(#2472, #2475, #2529)
Compiler/Wasm: add --setenv, matching jsof_ocaml (#2415)
* Compiler/Wasm: emit a sourcemap mapping at the start of each function, for
the Chrome profiler (#2417)
* Compiler/Wasm: the linker supports the wide arithmetic and custom
descriptor instructions (#2515)
* Compiler/Wasm: store more long-lived toplevel variables in globals; fix a
crash when one of them is assigned in a try body (#2516)
Runtime/Wasm: faster camlhash, compare, lexer engines, Str
searches and outputvalue sharing detection (with WASI, outputvalue
now shares boxed numbers with equal contents); single bound check in
fixed-width Bytes accesses (#2470, #2505)
Libraries
* Lib: add WebGL2 bindings; the webgl example uses WebGL2 and a new
webgl2_particles example demonstrates transform feedback (#1226, #2388)
* Lib: add Crypto (Web Crypto API) bindings (#2380)
* Lib: add Notification and Clipboard bindings (#2379)
* Lib: add Service Worker, MessageChannel/MessagePort and Cache API
bindings (#2381)
* Lib: add FontFace (CSS Font Loading API) bindings (#2255)
Lib: add the Pointer Capture API to Domhtml.element, and
getPredictedEvents, altitudeAngle and azimuthAngle to pointerEvent
(#2403)
* Lib: consolidate the duplicate messageEvent class types into
('target, 'data) Dom_html.messageEvent; the old ones are deprecated
class type aliases (#2382, #2390, #2555)
Lib: add Lwtjs_events.mutation/mutations (MutationObserver) (#250)
Lib: Lwtjs_events.load/error/abort accept any element, not only
images (#2404)
Lib (breaking): Typedarray.float32Array_fromArray and
float64ArrayfromArray take a numbert js_array t, as required by
wasmofocaml (#2416)
Lib (breaking): remove jsofocaml-lwt.logger, as lwtlog is
deprecated (#2378)
* Lib: the native stubs of the JavaScript primitives are weak symbols, so
that they can be overridden (#2435)
Toplevel
* Toplevel: new Wrapped and Async APIs, and protocol, worker and
workerlwtclient sublibraries to run the toplevel in a WebWorker
(#66, #833, #2377)
Bug fixes
Compiler
* Compiler: fix two reference unboxing bugs (#2426, #2489)
* Compiler: fix an invariant violation with recursive inlining
(#2482, #2495)
* Compiler: fix variable coalescing with ES classes (#2462)
* Compiler: fix unsound corner cases of the JavaScript simplification
passes: || fusion of effectful conditions, dropped var declarations
when folding an if, catch-parameter destructuring defaults (#2393)
* Compiler: fix the printing of JavaScript code: parentheses around optional
chains, no ES2021 logical assignments, keep the braces around a single
block-scoped declaration (#2465, #2502)
* Compiler: keep static on the same line as the class element it modifies
(Safari 17 misparsed static class fields) (#2420, #2421)
* Compiler: fix the JavaScript lexer on out-of-range unicode escapes, on
CR, U+2028 and U+2029 inside strings and templates, on numeric separators
in the integer part of a float, and on an HTML close comment --> after a
multi-line comment (#2503, #2524)
Effects
* Compiler: with --effects=cps or double-translation, fix mutable local
variables in try bodies and exception handlers (#2484)
* Compiler: with --effects=double-translation, fix over-applications of
functions that do not perform effects (#2455)
* Compiler/Wasm: with --effects=cps, fix an assertion failure on a try
whose body modifies a local reference, when compiled without -g (#2519)
* Wasm: unhandled effects raise Effect.Unhandled (--effects=native) or
Failure (--effects=disabled) instead of failing with a runtime error;
handlers installed inside assumenoperform work; --effects=cps no
longer runs on a JSPI stack (#2434, #2441)
Wasm
* Compiler/Wasm: x land y was wrongly assumed to fit in 31 bits when only
a negative operand did (#2490)
* Compiler/Wasm: fix specialized Bigarray.Genarray.get/set accesses,
and check the number of indices (#2427, #2505)
* Compiler/Wasm: fix several bugs of the Wasm linker (#2504)
* Compiler/Wasm: fix sourcemaps and toplevels on Windows (#2397, #2418)
* Wasm: emb
6.5.0~beta1预发布2026-10-21
CHANGES:
Features/Changes
OCaml versions
* Compiler/Runtime: support for OCaml 5.6: use the optimization hints
recorded in the bytecode, support the bit counting primitives and
Sys.filepathexists, Weak.getcopy no longer copies
(#1721, #2227, #2469, #2488, #2493, #2494)
* Compiler/Runtime: OxCaml: block index and small-int string-like indexing
primitives; OxCaml-specific primitives are gated on //If: oxcaml
(#2342, #2463)
* Compiler/Runtime: support building with Introcaml (OCaml fork with runtime
introspection), gated by the introspect flag (#2409)
Compiler
* Compiler: require sedlex 3.8.1 (#2503)
* Compiler: faster compilation (about 25% faster than 6.4.1 on large
programs): new Inttrie and Intset data structures,
sharing-preserving Subst and Jstraverse.map, Jstraverse.free as
an iterator, circular-buffer worklists, faster JavaScript printer and
lexer (#2445, #2446, #2447, #2448, #2449, #2452, #2454, #2512)
* Compiler: keep the name of function expressions that do not refer to
themselves; the unused-js-vars warning now reports such names (#2449)
* Compiler: emit large binary string constants as base64 literals, which are
much smaller than \xNN-escaped literals (-14% on the toplevel example)
(#2432)
* Compiler: report JavaScript syntax errors as file:line:col followed by
the offending line; columns start from 1 (#2464, #2471, #2491)
* Compiler: the JavaScript parser accepts source phase imports
(import source x from "m") (#2523)
* Compiler: drop redundant breaks out of labelled blocks, turning the
blocks into if/else statements or conditional expressions; the nesting
this introduces is bounded by --set=breaksinkdepth, and the
mergenodemax parameter is renamed label_depth (#2513)
* Compiler: simplify the generated JavaScript (!x for negated
conditions, no empty if branches) (#2500)
* Compiler: omit the | 0 coercion after an unsigned right shift by a
constant (#2531)
* Compiler: inline pending expressions at the end of a try body, avoiding
temporaries such as try{var c = f(x); return c;} (#2532)
* Compiler: bind identical literals of a bytecode program to a single
variable, which shrinks the generated code and speeds up compilation of
programs with many duplicated constants; identical literals may now be
physically equal (==) (#2547)
* Compiler: fold if (c) return a; return b into return c ? a : b
(#2533)
* Compiler: test integers against 0 by truthiness (!x rather than
0 === x) when the result is only used as a condition (#2538)
* Compiler: simplify !c ? a : b into c ? b : a (#2538)
* Compiler: compare integers directly rather than comparing the result
of compare with 0 (#2529)
* Compiler: faster reading of debug events, used with --pretty and
--debug-info (#2541, #2548)
Effects
* Compiler: with --effects={cps,double-translation}, specialize calls to
known functions before the CPS transformation (#2458)
* Compiler: with --effects=double-translation, only generate a CPS version
of the functions that may run below an effect handler (#2441)
* Compiler/Wasm: with --effects=cps, no longer turn mutually recursive
functions into CPS, since Wasm has proper tail calls (#2441)
* Runtime: specialize one- and two-argument partial applications in
double-translation mode (#2437)
Wasm
* Compiler/Wasm: intern string constants (program-wide with whole-program
compilation, per compilation unit otherwise) (#2436)
* Compiler/Wasm: small code generation improvements (negation, physical
equality on JavaScript values, bigarray dimensions, result types of
runtime primitives, masking of i31 values, range checks in the runtime)
(#2472, #2475, #2529)
Compiler/Wasm: add --setenv, matching jsof_ocaml (#2415)
* Compiler/Wasm: emit a sourcemap mapping at the start of each function, for
the Chrome profiler (#2417)
* Compiler/Wasm: the linker supports the wide arithmetic and custom
descriptor instructions (#2515)
* Compiler/Wasm: store more long-lived toplevel variables in globals; fix a
crash when one of them is assigned in a try body (#2516)
Runtime/Wasm: faster camlhash, compare, lexer engines, Str
searches and outputvalue sharing detection (with WASI, outputvalue
now shares boxed numbers with equal contents); single bound check in
fixed-width Bytes accesses (#2470, #2505)
Libraries
* Lib: add WebGL2 bindings; the webgl example uses WebGL2 and a new
webgl2_particles example demonstrates transform feedback (#1226, #2388)
* Lib: add Crypto (Web Crypto API) bindings (#2380)
* Lib: add Notification and Clipboard bindings (#2379)
* Lib: add Service Worker, MessageChannel/MessagePort and Cache API
bindings (#2381)
* Lib: add FontFace (CSS Font Loading API) bindings (#2255)
Lib: add the Pointer Capture API to Domhtml.element, and
getPredictedEvents, altitudeAngle and azimuthAngle to pointerEvent
(#2403)
* Lib: consolidate the duplicate messageEvent class types into
('target, 'data) Dom_html.messageEvent; the old ones are deprecated
aliases (#2382, #2390)
Lib: add Lwtjs_events.mutation/mutations (MutationObserver) (#250)
Lib: Lwtjs_events.load/error/abort accept any element, not only
images (#2404)
Lib (breaking): Typedarray.float32Array_fromArray and
float64ArrayfromArray take a numbert js_array t, as required by
wasmofocaml (#2416)
Lib (breaking): remove jsofocaml-lwt.logger, as lwtlog is
deprecated (#2378)
* Lib: the native stubs of the JavaScript primitives are weak symbols, so
that they can be overridden (#2435)
Toplevel
* Toplevel: new Wrapped and Async APIs, and protocol, worker and
workerlwtclient sublibraries to run the toplevel in a WebWorker
(#66, #833, #2377)
Bug fixes
Compiler
* Compiler: fix two reference unboxing bugs (#2426, #2489)
* Compiler: fix an invariant violation with recursive inlining
(#2482, #2495)
* Compiler: fix variable coalescing with ES classes (#2462)
* Compiler: fix unsound corner cases of the JavaScript simplification
passes: || fusion of effectful conditions, dropped var declarations
when folding an if, catch-parameter destructuring defaults (#2393)
* Compiler: fix the printing of JavaScript code: parentheses around optional
chains, no ES2021 logical assignments, keep the braces around a single
block-scoped declaration (#2465, #2502)
* Compiler: keep static on the same line as the class element it modifies
(Safari 17 misparsed static class fields) (#2420, #2421)
* Compiler: fix the JavaScript lexer on out-of-range unicode escapes, on
CR, U+2028 and U+2029 inside strings and templates, on numeric separators
in the integer part of a float, and on an HTML close comment --> after a
multi-line comment (#2503, #2524)
Effects
* Compiler: with --effects=cps or double-translation, fix mutable local
variables in try bodies and exception handlers (#2484)
* Compiler: with --effects=double-translation, fix over-applications of
functions that do not perform effects (#2455)
* Compiler/Wasm: with --effects=cps, fix an assertion failure on a try
whose body modifies a local reference, when compiled without -g (#2519)
* Wasm: unhandled effects raise Effect.Unhandled (--effects=native) or
Failure (--effects=disabled) instead of failing with a runtime error;
handlers installed inside assumenoperform work; --effects=cps no
longer runs on a JSPI stack (#2434, #2441)
Wasm
* Compiler/Wasm: x land y was wrongly assumed to fit in 31 bits when only
a negative operand did (#2490)
* Compiler/Wasm: fix specialized Bigarray.Genarray.get/set accesses,
and check the number of indices (#2427, #2505)
* Compiler/Wasm: fix several bugs of the Wasm linker (#2504)
* Compiler/Wasm: fix sourcemaps and toplevels on Windows (#2397, #2418)
* Wasm: embed cmis when build
6.4.12026-07-01
CHANGES:
Bug fixes
* Runtime/wasm: derive the wat-module name from the basename of the input
path in runtime/wasm/args.ml, so dune 3.24's leading-./ path-form
representation (ocaml/dune#15156) keeps producing well-formed
module:path lines for wasmoolinkwasm (#2371)
* Tests: pass file paths as literal arguments (with explicit (deps ...))
instead of %{dep:...} in the md5/md5nat, dumpsourcemap and
check-prim tests, which echo the path verbatim, so dune 3.24's leading-./
path form (ocaml/dune#15156) no longer breaks their expected output (#2384)
6.4.02026-06-21
CHANGES:
Features/Changes
* Compiler: initial support for OCaml 5.5.0 (#2197, #2220)
* Compiler: OxCaml support (#2105, #2225)
* Compiler: new variable coalescing pass, plus faster variable-naming,
free-variable and shape-computation passes (#2166, #2321, #2198)
* Compiler: add the --build-config and --apply-build-config flags (#2177)
* Compiler: put more values into global variables (#2211)
* Compiler: cosmetic minification in compact mode — !0/!1 booleans,
drop the leading 0 in 0.x fractions, normalise exponents
(1e+05 → 1e5), and pick backtick strings when they reduce escapes;
--pretty output is unchanged (#1117)
* Wasm: dynlink and toplevel support (#2186)
* Compiler/wasm: WASI 0.1 support (#1831)
Wasmof_ocaml: alternative effect implementation based on the Stack
Switching proposal (#2189)
* Runtime/wasm: implement the legacy num library nat primitives
(previously no-op stubs), so arbitrary-precision integers and rationals
now work as on the JavaScript runtime (#2263)
* Runtime/wasm: faster string↔ArrayBuffer copies, faster small-string
conversions, and optimized bigstring primitives (#2124, #2144)
* Runtime/wasm: pure-Wasm zstd and BLAKE2b implementations; the runtime
no longer relies on the JavaScript zstd/BLAKE2 shims to unmarshal
compressed values or compute Digest.BLAKE512/256/128. This also makes
both available under the WASI target, which has no JavaScript (#2249)
* Runtime: initial support for quickjs-ng (#2229)
* Lib: add Promise — type-safe bindings to JavaScript promises (even for
'a Promise.t Promise.t), with Lwt interop in Jsofocaml_lwt.Promise
(tolwt/oflwt) and Promise-typed Dom_html bindings
(requestFullscreen, requestPointerLock, exitFullscreen,
mediaElement.play, imageElement.decode, Animation.{finished,ready}).
Breaking: mediaElement.play now returns unit Promise.t (#2031)
* Lib: add Fetch and Abort — Fetch API binding with a typed
AbortController/AbortSignal primitive for cancellation (#596)
Lib: many additional Domhtml bindings and a new Performance module
(#2221, #2248)
* Lib: add Console bindings for table, count, countReset and
timeLog (#2350)
Lib: align Domsvg with SVG 2 — new graphicsElement/geometryElement
parents, style/className/dataset merged into element, SVG 2
members, markerElement and the full SVGFE* filter-primitive family,
every SVG element is now an event target (#519), and prop/readonly_prop
fixes. Breaking: drops the SVG 1.1-only getTransformToElement;
nearestViewportElement/farthestViewportElement are now typed optdef
* Lib: implement the popover API (#1734)
* Lib: add Intl.RelativeTimeFormat (#2070)
* Lib: remove dead legacy-browser code from the DOM bindings (IE
attachEvent/createElement/cancelBubble fallbacks, prefixed
requestAnimationFrame, the Firefox 3.x File.fileName property).
Breaking: drops the obsolete Gecko MouseScrollEvent/_DOMMouseScroll
bindings — the mouseScrollEvent type, the MouseScrollEvent
taggedEvent variant, CoerceTo.mouseScrollEvent and
Event._DOMMouseScroll (#2350)
Bug fixes
* Compiler: don't rewrite x = e + x into x += e for + (not
commutative on strings), which reversed Filename.concat operands and
broke Filename.temp_file in whole-program builds (#2228)
Compiler: fix the dead require() guard in shareconstant (it matched
"requires"), which could replace require string arguments and confuse
bundlers (#2284)
* Compiler: parenthesize in in conditional else-branches, arrow concise
bodies and for-initializer yields when re-printing parsed JavaScript,
which previously emitted output that did not parse (#2282)
* Compiler: emit a flat dispatch loop instead of deeply nested labelled
blocks for many sibling merge targets, avoiding parser "too much
recursion" overflows (#2122)
* Compiler: avoid JS stack overflow on deep mutually-recursive direct-style
calls under --effects=double-translation (#2243)
* Compiler: fix reference unboxing (#2210), a missing conditional
simplification (#2217), Js_assign.simpl (#2218), and UGEINT lowering
* Compiler/wasm: fix the int-division return type (#2197), preserve the
physical identity of empty closures (#2207), and fix a crash on some
function calls (#2208)
* Runtime: hashing is now consistent across backends — JS strings with code
points above U+00FF mix two 16-bit units per word, Hashtbl.hash of float
arrays, bigarray tail zero-extension and float32_hash normalize like
native; ASCII/Latin-1 strings are unchanged (#2263, #2270, #2332)
* Runtime/wasm: bring many primitives in line with the JavaScript runtime —
camlwrapexception only wraps real Errors, camljsmeth_call
decodes method names as UTF-8, the exception formatter grows its buffer,
Sys.isdirectory/fileexists follow symlinks, isatty returns false
in browsers, camlseekin validates the destination, Array.make/
Obj.newblock build proper float arrays, camlunregisternamedvalue
handles non-head bucket entries, the lexer only moves position memory on
memory-action transitions, the bytecode-section accessors raise without
--toplevel, format-string #/%+f/% f corner cases, and
Condition.wait is a no-op with each condition variable having a distinct
identity (#2263)
Runtime: marshalling fixes on both backends — Marshal.tobuffer returns
the byte count; float arrays use CODEDOUBLEARRAY (readable by native
and Wasm); BLOCK32 sizes are decoded with an unsigned shift (≥ 2^21 fields
no longer truncated) and a block with ≥ 2^22 fields raises instead of
truncating; input_value on a bad object raises Failure; bigarray
deserialization rejects bad dimensions; big-endian double arrays are
registered in the object table (#2263, #2270)
* Runtime: filesystem fixes (#2270) — the fake device no longer destroys a
directory renamed into its own subtree, refuses to unlink directories,
honors Open_append (which now implies write access), reports proper Unix
error codes/syscalls/paths, no longer matches mount points as regexes,
raises Sys_error on cross-device renames, keeps file sizes 64-bit on the
node backend, and no longer deletes a file renamed onto itself; flush on
a closed channel no longer raises
Runtime: OAPPEND/Open_append matches native on both backends — the
file offset starts at 0 (so lseek/pos_out report 0 right after opening)
and every write goes to the end of the file, even after seeking backwards
(#2306)
* Runtime: an empty path raises ENOENT on the JavaScript backend like
native (and the Wasm runtime), so Unix.stat "", Unix.opendir "", etc.
raise instead of operating on the cwd, and Sys.file_exists "" is false
(#2354)
Runtime: Unix fixes — Unix.localtime computes tmyday from the date
(was off by one during DST) and reaches Intl safely; Unix.close frees
the fd-table slot; Unix.error_message no longer crashes on unknown codes
or node < 22; chmod raises Unix_error; readdir includes "." and
"..", and add Unix.getegid / fix the Unix.getgrgid export (#2263,
#2270, #2303, #2304)
Runtime: channel fixes — inchannelofdescr/outchannelof_descr
allocate fresh channels (they used to share a record and loop on reads);
refill-hook channels grow their buffer and keep posin/posout
correct; Sys.command returns the child exit status; Sys.getenv raises
on prototype names; Sys.isatty consults the channel's file (#2270, #2330)
* Runtime: Str engine fixes — SIMPLEOPT/STAR/PLUS no longer read past the
end of the string (a trailing negated class could loop forever),
instruction arguments are no longer masked to 8 bits (regexps with > 256
pool entries mis-indexed), and a Str.replace backreference one past the
last group raises instead of trapping (#2263, #2270)
* Runtime:
6.3.22026-02-15
CHANGES:
Changes
* Misc: fix installation of completion files again.
6.3.12026-02-14
CHANGES:
Changes
* Misc: fix installation of completion files in monorepo, working around
bugs in dune
6.3.02026-02-07
CHANGES:
Features/Changes
* Misc: install shell completion script generated by cmdliner (#2140)
* Compiler/wasm: omit code pointer from closures when not used (#2059, #2093)
* Compiler/wasm: number unboxing (#2069, #2101)
* Compiler/wasm: specialization of number comparisons and bigarray operations (#1954)
* Compiler/wasm: make the type of some Wasm primitives more precise (#2100)
* Compiler: reference unboxing (#1958)
* Compiler: js-parser: support import/export with attributes
* Compiler: js-parser: support 'using X = E' for resource management (#2143)
* Compiler: js-parser: support decorators
* Compiler: js-parser: support html-comments
* Compiler: avoid unnecessary boolean-to-integer conversions (#2168)
* Runtime: improved handling of NaNs (#2110)
* Lib: allow to reference values from the runtime (#2086)
Lib: add Domhtml.onload for WASM-safe load handling (#1948)
* Runtime: make eval functions more robust (#2108)
* Compiler: added a constant sinking pass (#2167)
Bug fixes
Compiler: fix Globalflow.do_escape monotonicity
Compiler: fix static eval of camlnativeinttoint
* Compiler: remove invalid conditional simplification
* Lib: fix characterData.substringData method name typo in Dom module
Lib: fix various Domhtml bindings (submitEvent, mediaQueryListEvent, pointerEvent, element, inputElement, tableElement types and deprecations)
Lib: fix numberList type in Domsvg to use number_t
Lib: fix eventSource.url type to use jsstring t
* Lib: fix file.lastModifiedDate type to use Js.date t, add lastModified
Lib: fix Form.getform_elements infinite loop bug
* Lib: fix position.timestamp type in Geolocation module
* Lib: remove non-existent setDay and setUTCDay methods from Js.date
Lib: fix ACTIVETEXTURE type in WebGL to use textureUnit
* Compiler: fix purity of comparison functions (again) (#2092)
* Compiler: fix inlining (#2107)
* Compiler: allow arrow functions in for loops
* Ppx: disable spurious warning for unused "self" in object literal (#2128)
* Ppx: fix labelled arguments for methods (#2126)
* Runtime/wasm: fix Unix.times (#2096)
* Runtime: runtime with target-env=browser should not rely on "require(..)" (#2129)
* Runtime: fix fake filesystem with path containing special regexp chars. (#2132)
* Runtime/wasm: fix unmarshalling of compressed data (#2141)
* Runtime: fix compilation of loops at start of exception handlers (#2151)
* Compiler: fix parallel renaming (#2156)
6.2.02025-07-30
CHANGES:
Features/Changes
* Compiler: exit-loop-early in more cases (#2077)
* Runtime: support rename in fake filesystem (#2080)
* Compiler: remove reserved keyword in ecmascript 3
Bug fixes
* Compiler: Fix inlining. do not inline recursive functions (#2084)
Compiler: fix purity of camlcompare and camllxmnext
* Runtime: fix Sys.rename for directories on windows
6.1.12025-07-07
CHANGES:
Bug fixes
* Compiler: Fix shape loading (#2074)