# OCaml: what changed from 4 to 5 - Product: OCaml (https://whatsnew.fyi/product/ocaml) - Vendor: OCaml - Range: changelog entries numbered after 4.14.4 up to and including 5.5.1, stable releases only - Entries below: 8 releases (newest first) - Resolved: 4 is 4.14.4 and 5 is 5.5.1, the newest stable release of each major we track - Carrying security changes: 1 · CVEs mentioned: 0 · Mentioning breaking changes: 1 · Removing or deprecating something: 1 - Page: https://whatsnew.fyi/product/ocaml/compare/4...5 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. ## What changed (45 changes, grouped by kind) ### Added #### 5.5.0 (2026-06-19) - Module-dependent functions - Polymorphic functions as function arguments - Relocatable compiler - Generalized local definitions - Search and replace substring functions - External types - Around 60 new functions in the standard library #### 5.4.0 (2025-10-09) - Labelled tuples - Immutable arrays - Array literal syntax support for immutable arrays and floatarrays through type-directed disambiguation - Atomic record fields - Four new standard library modules: Pair, Pqueue, Repr, and Iarray - More than thirty new standard library functions - New chapter in the manual on profiling OCaml programs on Linux and macOS #### 5.3.0 (2025-01-08) - Syntax for deep effect handlers - Statistical memory profiling (statmemprof) - UTF-8 encoded Unicode source files and support for Unicode identifiers - Around 20 new functions in the standard library (also in 5.2.0) #### 5.2.0 (2024-05-13) - Re-introduced GC compaction - Restored native backend for POWER 64 bits - Thread sanitizer support - New Dynarray module - New -H flag for hidden include directories - Project-wide occurence metadata support for developer tools - Raw identifiers - Local open in type expressions ### Changed #### 5.5.0 (2026-06-19) - Garbage collector improvements #### 5.4.0 (2025-10-09) - Restored memory cleanup upon exit mode - Many runtime and code generation improvements - Nearly a dozen improved error messages #### 5.3.0 (2025-01-08) - More space-efficient implementation of Dynarray - Improved metadata on pairs of declarations and definitions for merlin - Improved error messages for first-class modules, functors, labeled arguments, and type clashes #### 5.2.0 (2024-05-13) - Many fixes and improvements in the runtime ### Fixed #### 5.5.1 (2026-09-04) - Type system bug fix for module-dependent functions - Various runtime fixes - Restore cloning support on macOS #### 5.4.0 (2025-10-09) - Around fifty bug fixes #### 5.3.0 (2025-01-08) - Restored MSVC port - Many fixes and improvements in the runtime - Numerous bug fixes #### 5.2.0 (2024-05-13) - Many bug fixes ### Removed #### 5.1.1 (2023-12-07) - Remove Marshal.Compression module, compressed marshaling has been moved to an internal compiler library ### Security #### 5.5.1 (2026-09-04) - Fix overflow in Marshal - Fix overflow in bytecode loading _2 releases carry no categorized changes yet: 5.4.1, 5.2.1._ ## Release notes ### 5.5.1 — OCaml 5.5.1 - Date: 2026-09-04 - Version: 5.5.1 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.5.1 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.5.1 - **fixed** — Type system bug fix for module-dependent functions - **security** — Fix overflow in Marshal - **security** — Fix overflow in bytecode loading - **fixed** — Various runtime fixes - **fixed** — Restore cloning support on macOS - Type system bug fix for module-dependent functions - Security fix: overflow in Marshal - Security fix: overflow in bytecode loading - Various runtime fixes - Restore cloning support on macOS See [detailed list of changes](https://github.com/ocaml/ocaml/blob/5.5/Changes#7). ### 5.5.0 — OCaml 5.5.0 - Date: 2026-06-19 - Version: 5.5.0 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.5.0 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.5.0 - **added** — Module-dependent functions - **added** — Polymorphic functions as function arguments - **added** — Relocatable compiler - **added** — Generalized local definitions - **added** — Search and replace substring functions - **added** — External types - **changed** — Garbage collector improvements - **added** — Around 60 new functions in the standard library Some of the highlights of OCaml 5.5.0 are: - Module-dependent functions - Polymorphic functions as function arguments - Relocatable compiler - Generalized local definitions - Search and replace substring functions - External types - Garbage collector improvements - Around 60 new functions in the standard library ### 5.4.1 — OCaml 5.4.1 - Date: 2026-02-17 - Version: 5.4.1 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.4.1 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.4.1 Bug fixes. See [detailed list of changes](https://github.com/ocaml/ocaml/blob/5.4/Changes). ### 5.4.0 — OCaml 5.4.0 - Date: 2025-10-09 - Version: 5.4.0 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.4.0 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.4.0 - **added** — Labelled tuples - **added** — Immutable arrays - **added** — Array literal syntax support for immutable arrays and floatarrays through type-directed disambiguation - **added** — Atomic record fields - **added** — Four new standard library modules: Pair, Pqueue, Repr, and Iarray - **added** — More than thirty new standard library functions - **added** — New chapter in the manual on profiling OCaml programs on Linux and macOS - **changed** — Restored memory cleanup upon exit mode - **changed** — Many runtime and code generation improvements - **changed** — Nearly a dozen improved error messages - **fixed** — Around fifty bug fixes Some of the highlights of OCaml 5.4.0 are: - Labelled tuples - Immutable arrays - Array literal syntax support for immutable arrays and `floatarray`s (through type-directed disambiguation) - Atomic record fields - Four new standard library modules: Pair, Pqueue, Repr, and Iarray - Restored "memory cleanup upon exit" mode - New chapter in the manual on profiling OCaml programs on Linux and macOS And a lot of incremental changes: - Many runtime and code generation improvements - More than thirty new standard library functions - Nearly a dozen improved error messages - Around fifty bug fixes ### 5.3.0 — OCaml 5.3.0 - Date: 2025-01-08 - Version: 5.3.0 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.3.0 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.3.0 - **added** — Syntax for deep effect handlers - **added** — Statistical memory profiling (statmemprof) - **added** — UTF-8 encoded Unicode source files and support for Unicode identifiers - **added** — Around 20 new functions in the standard library - **changed** — More space-efficient implementation of Dynarray - **changed** — Improved metadata on pairs of declarations and definitions for merlin - **changed** — Improved error messages for first-class modules, functors, labeled arguments, and type clashes - **fixed** — Restored MSVC port - **fixed** — Many fixes and improvements in the runtime - **fixed** — Numerous bug fixes Some of the highlights in OCaml 5.3.0 are: - Syntax for deep effect handlers - Restored MSVC port - Re-introduced statistical memory profiling (statmemprof) - utf-8 encoded Unicode source files and modest support of Unicode identifiers - More space-efficient implementation of Dynarray - Improved metadata on the pairs of declarations and definitions for merlin. And a lot of incremental changes: - Around 20 new functions in the standard library - Many fixes and improvements in the runtime - Improved error messages for first-class modules, functors, labeled arguments, type clashes. - Numerous bug fixes ### 5.2.1 — OCaml 5.2.1 - Date: 2024-11-18 - Version: 5.2.1 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.2.1 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.2.1 Bug fixes. See [detailed list of changes](https://github.com/ocaml/ocaml/blob/5.2/Changes). ### 5.2.0 — OCaml 5.2.0 - Date: 2024-05-13 - Version: 5.2.0 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.2.0 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.2.0 - **added** — Re-introduced GC compaction - **added** — Restored native backend for POWER 64 bits - **added** — Thread sanitizer support - **added** — New Dynarray module - **added** — New -H flag for hidden include directories - **added** — Project-wide occurence metadata support for developer tools - **added** — Raw identifiers - **added** — Local open in type expressions - **added** — Around 20 new functions in the standard library - **changed** — Many fixes and improvements in the runtime - **fixed** — Many bug fixes OCaml 5.2.0 is still a somewhat experimental release compared to the OCaml 4.14 branch. Some of the highlights in OCaml 5.2.0 are: - Re-introduced GC compaction - Restored native backend for POWER 64 bits - Thread sanitizer support - New Dynarray module - New -H flag for hidden include directories - Project-wide occurence metadata support for developer tools - Raw identifiers - Local open in type expressions And a lot of incremental changes: - Around 20 new functions in the standard library - Many fixes and improvements in the runtime - Many bug fixes ### 5.1.1 — OCaml 5.1.1 - Date: 2023-12-07 - Version: 5.1.1 - Original notes: https://github.com/ocaml/ocaml/releases/tag/5.1.1 - Permalink: https://whatsnew.fyi/product/ocaml/releases/5.1.1 - **removed** — Remove Marshal.Compression module, compressed marshaling has been moved to an internal compiler library - Breaking change: `Marshal.Compression` has been removed, compressed marshaling has been moved to an internal compiler library - Bug fixes. See [detailed list of changes](https://github.com/ocaml/ocaml/blob/5.1/Changes).