OCaml 5.4.0
What's New
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 section in the manual on native code profiling 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 For a comprehensive list of changes and details on all new features, bug fixes, optimisations, etc., please consult the changelog.
Installation Instructions
The base compiler can be installed as an opam switch with the following commands:
opam update
opam switch create 5.4.0
The source code for OCaml 5.4.0 is also directly available on:
Configuration Options
The configuration of the installed opam switch can be tuned with the following options:
ocaml-option-afl
: Set OCaml to be compiled withafl-fuzz
instrumentationocaml-option-bytecode-only
: Compile OCaml without the native-code compilerocaml-option-flambda
: Set OCaml to be compiled withflambda
activatedocaml-option-musl
: Set OCaml to be compiled withmusl-gcc
ocaml-option-no-flat-float-array
: Set OCaml to be compiled with--disable-flat-float-array
ocaml-option-static
: Set OCaml to be compiled withmusl-gcc -static
ocaml-option-tsan
: Set OCaml to be compiled with thread sanitiser supportocaml-option-address-sanitizer
: Set OCaml to be compiled with address sanitiserocaml-option-leak-sanitizer
: Set OCaml to be compiled with leak sanitiserocaml-option-fp
: Set OCaml to be compiled with frame pointers
For instance, one can install a switch with both flambda
and the --disable-flat-float-array
option with
opam switch create 5.4.0+flambda+nffa ocaml-variants.5.4.0+options ocaml-option-flambda ocaml-option-no-flat-float-array
Source Distribution
- Source
tarball
(
.tar.gz
) for compilation under Unix (including Linux and macOS X) and Microsoft Windows (including Cygwin) - Also available in
.zip
format - Opam is a source-based distribution of OCaml and many companion libraries and tools. Compilation and installation are automated by powerful package managers.
- The official development repo is hosted on GitHub.
The INSTALL file of the distribution provides detailed compilation and installation instructions. See also the Windows release notes for instructions on how to build under Windows.
Alternative Compilers
Additionally, the following projects allow you to compile OCaml code to targets traditionally associated with other languages:
- Js_of_ocaml is a stable OCaml to JavaScript compiler.
- wasm_of_ocaml is a stable OCaml to WebAssembly compiler.
User Manual
The user manual for OCaml can be:
- Browsed online
- Downloaded as a single PDF or plain text document
- Downloaded as a single TAR or ZIP archive of HTML files
- Downloaded as a single tarball of Emacs info files
Changes
Language features
-
#13097: added immutable arrays (
'a iarray
type, Iarray stdlib module) (Antal Spector-Zabusky and Olivier Nicole, review by Gabriel Scherer, Jeremy Yallop and Vincent Laviron) -
#13340: Array literal syntax [| e1; ...; en |] can now be used to denote values of type
'a array
and'a iarray
andfloatarray
, both in expressions and patterns. The compiler disambiguates each case by using contextual type information (assuming'a array
by default). (Nicolás Ojeda Bär, review by Richard Eisenberg, Jeremy Yallop, Jacques Garrigue, and Gabriel Scherer) -
#13498: Tuple fields are now optionally labeled:
(x:42, y:0)
andlet (~x, ~y) = ... in ...
. (Ryan Tjoa and Chris Casinghino, review by Gabriel Scherer, Chris Casinghino, and Leo White) -
RFCs#39, #13404: atomic record fields
{ ...; mutable readers : int [@atomic]; ... }
Atomic.Loc.fetch_and_add [%atomic.loc data.readers] 1
(Clément Allain and Gabriel Scherer, review by KC Sivaramakrishnan, Basile Clément and Olivier Nicole)
Standard library
-
(breaking change) #14124: Do not raise Invalid_argument on negative List.{drop,take}. (Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär)
-
#13696: Add Result.product and Result.Syntax:
let open Result.Syntax in let* x = ... in ...
(Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär) -
#12871: Add the Pqueue module to the stdlib. It implements priority queues. (Jean-Christophe Filliâtre, review by Daniel Bünzli, Léo Andrès and Gabriel Scherer)
-
#13760: Add String.{edit_distance,spellcheck} (Daniel Bünzli, review by wikku, Nicolás Ojeda Bär, Gabriel Scherer and Florian Angeletti)
-
#13753, #13755: Add Stdlib.Repr: Repr.phys_equal and Repr.compare are more explicit than (==) and
compare
. (Kate Deplaix, Thomas Blanc and Léo Andrès, review by Gabriel Scherer, Florian Angeletti, Nicolás Ojeda Bär, Daniel Bünzli and Jeremy Yallop) -
#13695: Add Stdlib.Char.Ascii (Daniel Bünzli, review by by Nicolás Ojeda Bär and Jeremy Yallop)
-
#13720: Add Result.{get_ok',error_to_failure} (Daniel Bünzli, review by wikku, Gabriel Scherer, Nicolás Ojeda Bär, Vincent Laviron and hirrolot)
-
#13885: Add Dynarray.{exists2, for_all2}. (T. Kinsart, review by Daniel Bünzli, Gabriel Scherer, and Nicolás Ojeda Bär)
-
(breaking change) #13862: Make List.sort_uniq keep the first occurrences of duplicates. (Benoît Jubin, review by Nicolás Ojeda Bär, Gabriel Scherer)
-
#13836: Add [Float.]Array.{equal,compare}. (Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)
-
#13796: Add Uchar.utf_8_decode_length_of_byte and Uchar.max_utf_8_decode_length. (Daniel Bünzli, review by Nicolás Ojeda Bär and Florian Angeletti)
-
#13768: Add Either.get_left and Either.get_right (T. Kinsart, review by Nicolás Ojeda Bär and Florian Angeletti)
-
(breaking change) #13570, #13794: Format, add an out_width function to Format device for approximating unicode width. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Gabriel Scherer)
-
#13731: Add Either.retract (Daniel Bünzli, review by Nicolás Ojeda Bär and David Allsopp)
-
#13729: Add Seq.filteri (T. Kinsart, review by Nicolás Ojeda Bär and Daniel Bünzli)
-
#13721: Add Result.retract (Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär and David Allsopp)
-
#13310: Add Stdlib.Pair (Victoire Noizet, review by Nicolás Ojeda Bär, Daniel Bünzli, Xavier Van de Woestyne, Jeremy Yallop and Florian Angeletti)
-
#13662: Add eager boolean operations Bool.logand, Bool.logor, Bool.logxor (Jeremy Yallop, review by Nicolás Ojeda Bär)
-
#13463, #13572: Avoid raising Queue.empty in Format when it is used concurrently, raise a specific exception instead. (Chritophe Raffalli, review by Gabriel Scherer and Daniel Bünzli)
-
#13620: Avoid copying the string in String.concat, String.sub and String.split_on_char when the full string is returned. (Christophe Raffalli, review by Nicolás Ojeda Bär and Gabriel Scherer and Hugo Heuzard)
-
#13727: Reimplement Sys.getenv_opt not to use exceptions internally, meaning that the current backtrace is preserved when Sys.getenv_opt returns None. (David Allsopp, review by Nicolás Ojeda Bär, Josh Berdine and Gabriel Scherer)
-
#13737: Avoid closure allocations in Weak.Make.add when resizing the table (Vincent Laviron, review by Gabriel Scherer and Daniel Bünzli)
-
#13740: Improve performance of Weak.find_aux (Josh Berdine, review by Gabriel Scherer)
-
#13782: Improve performance and type safety of Type.Id by using [%extension_constructor] instead of Obj.Extension_constructor.of_val. (Basile Clément, review by Vincent Laviron and Nicolás Ojeda Bär)
-
#13589: Expose Sys.io_buffer_size, the size of internal buffers used by the runtime system and the
unix
library. (Yves Ndiaye and Nicolás Ojeda Bär, review by Daniel Bünzli and Nicolás Ojeda Bär) -
#13569: add a
Format.format_text
which adds break hints to format literals. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Gabriel Scherer) -
#13578: On Windows, use the OS CSPRNG to seed the Stdlib.Random generator. (Antonin Décimo, review by Miod Vallat, Nicolás Ojeda Bär, and Xavier Leroy)
-
#13859: Fix Weak.get_copy not darkening custom blocks (Josh Berdine, review by Stephen Dolan)
-
#13909: Add
Dynarray.unsafe_to_iarray
(Olivier Nicole, review by Daniel Bünzli, Stefan Muenzel and Gabriel Scherer, request by Daniel Bünzli) -
#13932: Add List.singleton and Seq.singleton (David Allsopp, tariffs applied by Nicolás Ojeda Bär and Gabriel Scherer)
-
(breaking change) #13843: Add signal definitions for SIGIO and SIGWINCH. Introduces a type alias for signal int, signal_to_string to convert OCaml signal numbers to their POSIX equivalent names, and signal_of_int/signal_to_int for converting between OCaml and platform signal numbers. (Reported in #13825) (Tim McGilchrist, review by David Allsopp, Nicolás Ojeda Bär, Daniel Bünzli Jan Midtgaard and Miod Vallat)
Runtime system
-
#13500: Add frame pointers support for ARM64 on Linux and macOS. (Tim McGilchrist, review by KC Sivaramakrishnan, Fabrice Buoro and Miod Vallat)
-
#12964: Reintroduce "memory cleanup upon exit" mode. The cleanup will however be incomplete if not all domains have been joined when the main domain terminates. (Miod Vallat, review by KC Sivaramakrishnan, feedback from Nick Barnes and Gabriel Scherer)
-
#13582: Enable software prefetching support for ARM64, s390x, PPC64 and RiscV. Used during GC marking and sweeping to speed up both operations by prefetching data. (Tim McGilchrist, review by Nick Barnes, Antonin Décimo, Stephen Dolan and Miod Vallat)
-
#13675: Make Unix.map_file memory show up in Gc.Memprof. (Stephen Dolan, review by Guillaume Munch-Maccagnoni and Gabriel Scherer)
-
#13785: Add
Runtime_events.Timestamp.get_current
. (Simon Cruanes) -
#13774: Fix for inaccurate live blocks/words stats in compaction. (Sadiq Jaffer, report by KC Sivaramakrishnan and Jan Midtgaard, review by Gabriel Scherer)
-
#13773: Ensure that shared pool owners are correctly set on pool adoption. (Stephen Dolan, review by Sadiq Jaffer and Gabriel Scherer)
-
(breaking change) #11449, #13497: Add caml_stat_char_array_{to,of}_os functions allowing conversion of string data which may contain NUL characters. Correct implementation of caml_stat_strdup_to_utf16 to raise Out_of_memory instead of returning of NULL (the behaviour of caml_stat_strdup_to_os was inconsistent between Unix/Windows). (David Allsopp, review by Nick Barnes, Antonin Décimo and Miod Vallat)
-
#13352: Concurrency refactors and cleanups. (Antonin Décimo, review by Gabriel Scherer, David Allsopp, and Miod Vallat)
-
#13437: Stop using GetProcAddress to load functions that were not available in older, now unsupported Windows versions. (Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp)
-
#13470: Constify some function parameters, flags tables, and some pointers in C code (take 3). (Antonin Décimo, review by Stephen Dolan and Miod Vallat)
-
#13492: Parse the CAML_LD_LIBRARY_PATH environment variable for the shared_libs_path item in
ocamlrun -config
in addition to displaying the entries found in ld.conf. (David Allsopp, review by Stephen Dolan) -
#13496: Add missing .type and .size directives to main frametable to silence warnings from the linker when using libasmrun_shared on amd64 and power. The other backends already carried these directives. (David Allsopp, review by Tim McGilchrist and Miod Vallat)
-
#13354: Use C99 flexible array member syntax everywhere. (Antonin Décimo, review by Miod Vallat, Gabriel Scherer, and Xavier Leroy)
-
#11865, #13584: Fix a deadlock triggered by deleting C roots from C finalisers (Stephen Dolan, report by Timothy Bourke, review by Mark Shinwell and Damien Doligez)
-
#13613: Functions from caml/skiplist.h and caml/lf_skiplist.h no longer raise Out_of_memory exceptions that the runtime could not handle. (Guillaume Munch-Maccagnoni, review by Stephen Dolan)
-
#13575, #13635: Maintain OCaml frame pointers correctly even when using C libraries that do not support them. (Stephen Dolan and David Allsopp, report by Thomas Leonard, review by Tim McGilchrist and Fabrice Buoro)
-
#13643: Allow values reachable from ephemeron keys to be collected by minor GC (Stephen Dolan, review by François Bobot)
-
#13701: optimize
caml_continuation_use
based on #12735 (Hugo Heuzard, review by KC Sivaramakrishnan) -
#13227, #13714: Review of locking in the multicore runtime. Fix deadlocks in runtime events and potential deadlocks with named values. (Guillaume Munch-Maccagnoni, review by Gabriel Scherer, tests by Jan Midtgaard)
-
#13736: Fix major GC pacing bug triggered by synchronous collections. (Nick Barnes, review by Damien Doligez and Tim McGilchrist)
-
#13827: Avoid re-marking ephemerons with trivial data. (Stephen Dolan, review by Nick Barnes and Josh Berdine, benchmarking by Nicolás Ojeda Bär)
-
#13300, #13861: introduce
Gc.ramp_up
to explicitly mark ramp-up phases of memory consumption and avoid GC overwork. Ramp-up behaviors are worse with OCaml 5 than with OCaml 4 due to higher sensitivity to excessive pacing computations. Indicating ramp-up explicitly eliminates the main known slowdown of OCaml 5 (relative to OCaml 4) for Coq/Rocq. (Gabriel Scherer, review by Damien Doligez and Guillaume Munch-Maccagnoni, report by Emilio Jesús Gallego Arias and Olivier Nicole) -
#14057: Don't update memprof too early at the end of a minor GC. (Nick Barnes, review by Damien Doligez).
Code generation and optimizations
-
#13262, #14074: fix performance issue on Apple Silicon macOS by emitting
stlr
instead ofdmb ishld; str
. (KC Sivaramakrishnan, report by François Pottier, analysis by Frédéric Bour, Xavier Leroy, Miod Vallat, Gabriel Scherer and Stephen Dolan, review by Miod Vallat, Vincent Laviron and Xavier Leroy) -
(breaking change) #13050, #14104, #14143: Use '$' instead of '.' to separate module names in symbol names on macOS and Windows (including the Cygwin backend). This changes mangling of OCaml identifiers on those operating systems from
camlModule.name_NNN
tocamlModule$name_NNN
. Additionally it changes the encoding of special characters from $xx (two hex digits) to $$xx (two dollar signs followed by two hex digits). (Tim McGilchrist, with contributions from Xavier Leroy, reviewed by Xavier Leroy, Miod Vallat, Gabriel Scherer, Nick Barnes and Hugo Heuzard) -
#13807: Allow unaligned memory accesses on ARM64. (Matthew Else, review by Xavier Leroy)
-
#13565: less tagging in switches compiled to affine transformations by ocamlopt. (Gabriel Scherer and Clément Allain, review by Vincent Laviron, report by Vesa Karvonen)
-
#13672 Avoid register stall on conversion instructions on amd64. (Pierre Chambart, review by Gabriel Scherer and Xavier Leroy, report by Patrick Nicodemus)
-
#13667: (originally #11162) Fix instr_size computation on arm64. (Stephen Dolan and Tim McGilchrist, review by Xavier Leroy and David Allsopp)
-
#13758: Propagate more value kinds in Flambda to allow more unboxing (Vincent Laviron, review by Pierre Chambart)
-
#13759: Propagate more type information from clambda to cmm. (Pierre Chambart, review by Gabriel Scherer)
-
#13735: Follow the behaviour of the C compiler to decide whether to emit the
.size
and.type
directives and the.note.GNU-stack
section (Samuel Hym, review by Miod Vallat, Antonin Décimo and Gabriel Scherer)
Other libraries
-
(breaking change) #13435: On Windows, use system calls for
Filename.get_temp_dir_name
instead of directly reading the environment, which in particular improves the security of OCaml processes running in the SYSTEM security context by mitigating privileged file operation attacks. For all other processes running with the default environment (whereTEMP
is set), there is no discernible change. (Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp) -
#13504, #13625, #14223: Add
Thread.set_current_thread_name
. (Romain Beauxis, review by Gabriel Scherer and Antonin Décimo) -
(breaking change) #13376: Allow Dynlink.loadfile_private to load bytecode libraries with internal dependencies (Vincent Laviron, report by Stéphane Glondu, review by Nicolás Ojeda Bär and Xavier Leroy)
-
#13429: add
Unix.sigwait
, a binding to thesigwait
system call; implementThread.wait_signal
usingUnix.sigwait
, andThread.sigmask
usingUnix.sigprocmask
. (Xavier Leroy, review by Antonin Décimo, Gabriel Scherer, Miod Vallat) -
#13442, #13452: Fix Unix.getgroups for users belonging to more than 32 groups when using musl (Kate Deplaix, review by Gabriel Scherer, Antonin Décimo, Anil Madhavapeddy)
-
#13576: Introduce internal helpers to convert between time representations. On Windows, prevent erroneously waiting for an unbounded time in Unix.select if more than 64 file descriptors per lists are watched, or if watching non-socket file descriptors, and a timeout longer than $2^{32}$ milliseconds is used. Cap the timeout to $2^{32}$ milliseconds. (Antonin Décimo, review by Gabriel Scherer and Miod Vallat)
-
#13921: Set cloexec correctly on CRT file descriptors created by the Unix library on Windows. The inheritance on the underlying Win32 handles was correctly set, but the book-keeping for the CRT was leaking the value of non-inherited handles which combined with re-use of HANDLE values within processes could appear to make a CRT file descriptor "re-open". (David Allsopp, review by Nicolás Ojeda Bär)
Tools
-
#13686: Fix Python debugger extensions (for LLDB and GDB) to restore functionality broken by #13272 in 5.3. (Nick Barnes, review by Tim McGilchrist Gabriel Scherer)
-
#12019: ocamlc: add
align_double
andalign_int64
toocamlc -config
output. (Romain Beauxis, review by David Allsopp) -
#12642, #13536, #14184, #14192: in the toplevel, print shorter paths for constructors and labels when only some modules along their path are open. (Gabriel Scherer, review by Florian Angeletti)
-
#13199, #13485, #13665, #13762, #13965: Support running native debuggers in ocamltest. (Tim McGilchrist, Sebastien Hinderer, David Allsopp, Antonin Décimo, review by Sebastien Hinderer, Gabriel Scherer, Antonin Décimo, and Tim McGilchrist)
-
#13764, #13779: add missing "-keywords" flag to ocamldep and ocamlprof (Florian Angeletti, report by Prashanth Mundkur, review by Gabriel Scherer)
-
#13877: ocamldoc, add a
-latex-escape-underscore
flag to control the escaping of_
underscore in latex references (in order to be able to match odoc behaviour). (Florian Angeletti, review by Gabriel Scherer) -
#13906: Add support for a
multicore
tag in ocamltest and use it for tests that fail on mono-core systems. (Stéphane Glondu, review by Nicolás Ojeda Bär)
Manual and documentation
-
#13751: Document support for profiling with Linux perf and frame pointers. (Tim McGilchrist, review by Gabriel Scherer and Miod Vallat)
-
#12452: Add examples to Stdlib.Fun documentation. (Hazem ElMasry, review by Florian Angeletti and Gabriel Scherer)
-
#13924: Document how to put [@deprecated] on let bindings, constructors, etc in the manual (Valentin Gatien-Baron, review by Florian Angeletti)
-
#13694: Fix name for caml_hash_variant in the C interface. (Michael Hendricks)
-
#13732: Document that custom finalizers must not access the OCaml heap, etc. (Josh Berdine, review by Stephen Dolan and Guillaume Munch-Maccagnoni)
Type system
- (breaking change) #13830: fail rather than silently create abstract module types when avoiding (i.e. hiding) signature items, as in:
module N = struct
open (struct type t = A | B end)
module type T = sig type u = t * int end
end
Before, it was succeeding with module N : sig module type T end
, now it
fails. Similarly for anonymous functor calls (of the form `F(struct ... end))
(Clement Blaudeau, review by Gabriel Scherer)
Compiler user-interface and warnings
-
#13817: align spellchecking hints with the possibly misspelled identifier/ Error: Unbound type constructor "aray" Hint: Did you mean "array"? (Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer)
-
#13587: Enable native backend on x86_64 GNU/Hurd. (Samuel Thibault, review by Antonin Décimo, Sébastien Hinderer and Miod Vallat)
-
#13663: Improve the error message when GADT parameter variance cannot be checked. (Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)
-
#13646: Improve the error messages when a recursive module type references another recursive module type. (Stefan Muenzel, review by Florian Angeletti and Gabriel Scherer)
-
#13702, #13865: Specialized error messages for functors appearing in contexts where non-functors were expected
module A: sig ... end = Set.Make
(and the reverse) (Florian Angeletti, report by Jeremy Yallop, review by Gabriel Scherer) -
#13788, #13813: Keep the module context in spellchecking hints.
Fun.protact
now promptsDid you mean "Fun.protect?"
rather thanDid you mean "protect?"
. (Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer) -
#13428: support dump=[source | parsetree | lambda | ... | cmm | ...] in OCAMLRUNPARAM (Gabriel Scherer, review by Vincent Laviron)
-
#13493: Clearer error message in ocamlc for conflicting link options for C stubs when shared libraries are not available. (David Allsopp, review by Gabriel Scherer)
-
#13563, lighter inline code styling for output without bold support: inline code is no longer printed as "..." to avoid confusion with OCaml strings. (Florian Angeletti, review by Richard Eisenberg)
-
#13568, composable formatting for warning and alert messages (Florian Angeletti, review by Richard Eisenberg)
-
#13601: Enable natdynlink on x86_64 GNU/Hurd (Samuel Thibault, review by Sébastien Hinderer)
-
#13809: Distinguish
(module M : S)
and(module M) : (module S)
and change locations of error messages whenS
is ill-typed in(module S)
(Samuel Vivien, review by Florian Angeletti and Gabriel Scherer) -
#13814, 13898: Add an
unused-type-declaration
warning when using at as 'a
with no other occurences of'a
(Samuel Vivien, review by Florian Angeletti, Kate Deplaix) -
#13818: better delimited hints in error message (Florian Angeletti, review by Gabriel Scherer)
Internal/compiler-libs changes
-
#13539, #13776: Use nanosleep instead of usleep or select, if available. (Antonin Décimo, review by Miod Vallat and Gabriel Scherer)
-
#13748: Add a .editorconfig file for basic editor auto-configuration. (Antonin Décimo, review by Gabriel Scherer and David Allsopp)
-
#13302, #14236: Store locations of longidents components (Ulysse Gérard and Jules Aguillon, review by Jules Aguillon and Florian Angeletti)
-
#13314: Comment the code of Translclass (Vincent Laviron and Nathanaëlle Courant, review by Olivier Nicole)
-
#13362: reimplement Floatarray.concat in C (
caml_floatarray_concat
), matching the implementation of Array.concat. (Gabriel Scherer, review by Nicolás Ojeda Bär) -
#13624: Added location to exception definitions and type extensions (Samuel Vivien, review by Gabriel Scherer)
-
#13425: undocumented -dmatchcomp flag for the debug output of the pattern-matching compiler (Gabriel Scherer, review by Vincent Laviron and Nicolás Ojeda Bär)
-
#13460: introduce a variant of all predefined types (Gabriel Scherer, review by Ulysse Gérard and Florian Angeletti)
-
#13457, #13537: Annotate alloc/free open/close pairs of functions with compiler attributes for static analysis. (Antonin Décimo, review by Gabriel Scherer and Florian Angeletti)
-
#13464: Use generic types in call to
subtype
. This improves inference of type-directed disambiguation in principal mode. (Richard Eisenberg, review by Jacques Garrigue) -
#13606: Fix Numbers.Int_base.compare (Mark Shinwell, review by Vincent Laviron)
-
#13612: Refactor
type_application
(Ulysse Gérard, Leo White, review by Antonin Décimo, Gabriel Scherer, Samuel Vivien, Florian Angeletti and Jacques Garrigue) -
#13744: Refactor in
collect_apply_args
(Samuel Vivien, review by Florian Angeletti and Gabriel Scherer) -
#13787: a new -dcanonical-ids option to show canonicalized identifier stamps in -d{lambda,cmm,...} outputs. (Gabriel Scherer, review by Vincent Laviron and David Allsopp, suggested by David Allsopp)
-
#13820: Add a new option -i-variance to print the variance of every type parameter; bivariance is printed as
+-
, and for consistency, parser is modified too to accept+-
and-+
astype_variance
. (Takafumi Saikawa and Jacques Garrigue, review by Florian Angeletti) -
#13828: Apply BUILD_PATH_PREFIX_MAP to Sys.argv.(0) before storing it in .cmt and .cmti files. (David Allsopp, review by Daniel Bünzli and Gabriel Scherer)
-
#13848: Add all paths components to the cmt files indexes (Ulysse Gérard, review by Florian Angeletti)
-
#13854: Make the parser set loc_ghost more correctly, for
keyword%extension
syntax (Valentin Gatien-Baron, review by Florian Angeletti) -
#13856: Add a new indirection in types AST called
package
that stores the content of aTpackage
node (Samuel Vivien, review by Florian Angeletti) -
#13866: Modified occurence check that prevents recursive types for it to see the checked type as a graph rather than a tree (Samuel Vivien, report by Didier Remy, review by Florian Angeletti and Jacques Garrigue)
-
#13884 Correctly index modules in constructors and labels paths (Ulysse Gérard, review by Florian Angeletti)
-
#13946: refactor the #install_printer code in the debugger and toplevel (Pierre Boutillier, review by Gabriel Scherer and Florian Angeletti)
-
#13952: check and document the correctness of
caml_domain_alone ()
. (Gabriel Scherer, review by KC Sivaramakrishnan, report by Olivier Nicole) -
#13971: Keep generalized structure from patterns when typing
let
(Leo White, review by Samuel Vivien and Florian Angeletti) -
(breaking change) #13972: Renamed the
-no-alias-deps
flag internal representation tono_alias_deps
instead oftransparent_modules
. (Clement Blaudeau, review by Gabriel Scherer)
Build system
-
(breaking change) #13526, #13789, #13804: Simplify the build of cross compilers This replaces the configure
--with-target-bindir
option by an equivalentTARGET_BINDIR
variable (Samuel Hym, review by Miod Vallat, Xavier Leroy, Antonin Décimo and Sébastien Hinderer) -
#13431: Simplify github action responsible for flagging PRs with the
parsetree-changes
label and extend it to mention the @ppxlib-dev team. (Nathan Rebours, review by Florian Angeletti) -
#13494: Use native symlinks on Windows for the OCaml installation, reducing disk usage considerably. (David Allsopp, review by Nicolás Ojeda Bär and Gabriel Scherer)
-
#13789: Strictly validate the host and target triplets when building for the Windows ports to be --cygwin, -w64-mingw32 or *-pc-windows. Other Cygwin variants used to be rejected - other MSVC and mingw-w64 variants are now rejected too. (David Allsopp, review by Antonin Décimo and Gabriel Scherer)
Bug fixes
-
#13819: Fix field initialisation bug in runtime events subsystem. (Nick Barnes, review by Gabriel Scherer).
-
#13977: Pass
-fPIC
when compiling C files usingocamlopt
. This was a regression in OCaml 5.3. (Nicolás Ojeda Bär, review by Daniel Bünzli and Gabriel Scherer) -
#13957: Allow 'effect' as attribute id. (Pieter Goetschalckx, review by Nicolás Ojeda Bär and Florian Angeletti)
-
#13691 #13895: Make four globals underlying Gc.control atomic to avoid C data races against them. (Jan Midtgaard, review by Miod Vallat, Sadiq Jaffer and Antonin Décimo)
-
#13454: Output a correct trace of the C_CALLN bytecode. (Miod Vallat, review by Antonin Décimo)
-
#13595: Use x19 as Canonical Frame Address (CFA) register. This would cause backtraces to be truncated when calling no alloc C code. (Tim McGilchrist, report by Nick Barnes, review by Nick Barnes)
-
(breaking change) #13605: Fix ungenerated constraints when they where impossible due to polyvars issues (Samuel Vivien, review by Florian Angeletti, Richard Eisenberg and Jacques Garrigue)
-
#13677, #13679: domain.c: remove backup_thread_running to simplify concurrent state updates to the backup thread status. (Gabriel Scherer, review by Jan Midtgaard and Miod Vallat, report by Jan Midtgaard)
-
#13896, #14098: ocamldoc, do not wrap module description in a paragraph tag inside the table of modules (Florian Angeletti, report by John Whitington, review by Gabriel Scherer)
-
#13703: wrong explanation for some polymorphic-variant subtyping errors (Gabriel Scherer, review by Jacques Garrigue, report by Wiktor Kuchta and Richard Eisenberg)
-
#13710: Support unicode identifiers in comments. (Pieter Goetschalckx, review by Florian Angeletti and Gabriel Scherer)
-
#13763: Track type of variables bound by as-patterns (Leo White, review by Gabriel Scherer, port by Vincent Laviron)
-
#13778, #13811: do not warn for unused type declarations when the type is used in a first-class module type (
module S with type t = int)
. (Florian Angeletti, report by Nicolás Ojeda Bär, review by Gabriel Scherer) -
#13790: Fix bytecode-only build of Cygwin when flexlink is being bootstrapped with the compiler. (David Allsopp, review by Antonin Décimo and Miod Vallat)
-
#13812: Add forgotten check about the validity of the type variable name on the right-hand side of
_ as _
. (Samuel Vivien, review by Gabriel Scherer) -
#13845: Fix bug in untypeast/pprintast for value bindings with polymorphic type annotations. (Chris Casinghino, review by Florian Angeletti and Gabriel Scherer)
-
#13930, #13933: Fix bugs in recursive values definitions involving lazy values that have already been evaluated. (Gabriel Scherer, review by Vincent Laviron, report by Vincent Laviron)
-
#13867: Fix bug with some recursive bindings of lazy values. (Guillaume Bury and Vincent Laviron, review by Stefan Muenzel and Gabriel Scherer)
-
#13931: fix bugs in nested recursive value definitions. (Gabriel Scherer, review by Vincent Laviron, report by Vincent Laviron)
-
#13875, #13878: Add dedicated constructor for mutable variable access in Cmm to prevent bugs linked to incorrect handling of coeffects. (Vincent Laviron, review by Gabriel Scherer)
-
#13880: Make object stat counters atomic (Dimitris Mostrous, review by Gabriel Scherer and Nicolás Ojeda Bär)
-
#13172, #13829: Fix a missing check of illegal recursive module-type definitions (Clement Blaudeau, review by Florian Angeletti)
-
#13541, #13777: Using C++11
thread_local
causes name-mangling issues when linking with flexlink on Cygwin. (Antonin Décimo and David Allsopp, report by Kate Deplaix) -
(breaking change) #13874, #13882: Make evaluation order consistent for applications when using the non-flambda native compiler (Vincent Laviron, report by Jean-Marie Madiot, review by Gabriel Scherer)
-
#13942: Fix assertion on empty array case (Olivier Nicole, review by Gabriel Scherer)
-
#13950: Avoid tearing in
Array.sub
(Gabriel Scherer and Olivier Nicole, report by Jan Midtgaard, review by Gabriel Scherer) -
#13928, #13944: Fix handling of excessively nested unboxed types (Vincent Laviron, review by Gabriel Scherer)
-
#13987: Remove a spurious TSan report in case of benign data race between major GC read and write from the mutator (fixes #13427) (Olivier Nicole, report by Thomas Leonard, review by Gabriel Scherer)
-
#14007, #14015: Fix memory corruption when an exception is raised during demarshaling. (Benoît Vaugon, review by David Allsopp and Gabriel Scherer)
-
#14025: fix data race between compaction and domain termination (Gabriel Scherer, review by Jan Midtgaard, report by Jan Midtgaard)
-
#13956 Fix a regression introduced in #13308 triggering wrong unused warnings. (Ulysse Gérard, review by Florian Angeletti)
-
#14070: also point to label mismatches in error messages for labelled tuples (Florian Angeletti, review by Gabriel Scherer)
-
#14088, #14091: fix non-deterministic code generation in matching.ml (backport of rescript-lang/rescript#7557) (Christiano Calgano, review by Gabriel Scherer and Vincent Laviron)
-
#14105: Fix a loop in Pprintast that could result in a hang when printing constructor
(::)
in isolation. (Ulysse Gérard, review by Nicolás Ojeda Bär and Florian Angeletti) -
#14108: toplevel, fix a typo in directive type mismatch (Florian Angeletti, review by Gabriel Scherer)
-
#13586, #14093: Fix closing an out_channel during flush (Stephen Dolan, report by Jan Midtgaard, investigation by Nick Roberts, review by Antonin Décimo and Miod Vallat)
-
#14101, #14139: define atomic helper types inside
caml/misc.h
to improve header compatibility with C++ (Florian Angeletti, report by Kate Deplaix, review by Gabriel Scherer) -
#14135: Fix a rare internal typechecker error when combining recursive modules, polymorphic fields or methods, and constrained type parameters. (Florian Angeletti, review by Gabriel Scherer)
-
#14169: runtime, fix cache miss within the stack fragments cache (Florian Angeletti, review by Gabriel Scherer)
-
#14196, #14197: ocamlprof: do not instrument unreachable clauses (Gabriel Scherer, review by Nicolás Ojeda Bär, report by Ali Caglayan)
-
#14200, #14202 : bad variance check with private aliases (Jacques Garrigue, report and review by Stephen Dolan)
-
#14061, #14209: fix a memory-ordering bug in Weak.set that could result in uninitialized memory seen by Weak.get on another domain. (Damien Doligez, review by Gabriel Scherer)
-
#14214, #14221: fix a confused error message for module inclusions, functor error messages were missing some type equalities potentially leading to nonsensical "type t is not compatible with type t" submessage (Florian Angeletti, report by Basile Clément, review by Gabriel Scherer)
-
#14238: Fix certain variadic macros in misc.h which could trigger C warnings under certain conditions in prerelease versions of OCaml 5.4. (Antonin Décimo, review by Nicolás Ojeda Bär)