[ANN] Js_of_ocaml / Wasm_of_ocaml 6.3

I’m pleased to announce the joint release of js_of_ocaml and wasm_of_ocaml 6.3.

Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it possible to run pure OCaml programs in JavaScript environment like browsers and Node.js.

Wasm_of_ocaml is a compiler from OCaml bytecode to WebAssembly. It is highly compatible with Js_of_ocaml, so you can compile your programs with wasm_of_ocaml instead of js_of_ocaml and experience overall better performance.

Most significant changes (since 6.1):

  • Number unboxing for wasm_of_ocaml: a type analysis pass now tracks which values are floats, integers, or nativeints, enabling the compiler to unbox them and use native Wasm instructions directly. This also enables specialisation of number comparisons and bigarray operations, avoiding costly generic runtime calls.
  • Constant sinking for js_of_ocaml: a new optimisation pass moves constants closer to their use sites, reducing register pressure. Many constants end up inlined, resulting in smaller code size.
  • JS parser improvements: support for import/export attributes, decorators, using declarations (resource management), and HTML comments.
  • Many bug fixes across the compiler, runtime, library bindings, and PPX.

See the Changelog for the full list of changes.

17 Likes