OCaml 4.14.1 (20 December 2022) ------------------------------ ### Compiler user-interface and warnings: - #11184, #11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same) ### Build system: - #11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer) - #11487: Thwart FMA test optimization during configure (William Hu, review by David Allsopp and Sébastien Hinderer) ### Bug fixes: - #10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan) - #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White) - #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined before using it to ensure that the headers can always be used in code which turns on -Wundef (or equivalent). (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Sébastien Hinderer) - #11314, #11416: fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer) - #11358, #11379: Refactor the initialization of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) - #11387, module type with constraints no longer crash the compiler in presence of both shadowing warnings and the `-bin-annot` compiler flag. (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer) - #11392, #11392: assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) - #11417: Fix regression allowing virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti) - #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) - #11489, #11496: More prudent deallocation of alternate signal stack (Xavier Leroy, report by @rajdakin, review by Florian Angeletti) - #11516, #11524: Fix the `deprecated_mutable` attribute. (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti) - #11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer) - #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer) - #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue) - #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp) - #11776: Extend environment with functor parameters in `strengthen_lazy`. (Chris Casinghino and Luke Maurer, review by Gabriel Scherer) - #11533, #11534: follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky) - #11768, #11788: Fix crash at start-up of bytecode programs in no-naked-pointers mode caused by wrong initialization of caml_global_data (Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer) - #11803, #11808: on x86, the destination of an integer comparison must be a register, it cannot be a stack slot. (Vincent Laviron, review by Xavier Leroy, report by Emilio Jesús Gallego Arias) OCaml 4.14.0 (28 March 2022) ---------------------------- ### Language features (highlights): - #10437: Allow explicit binders for type variables. (Stephen Dolan, review by Leo White) - #181, #9760, #10740: opt-in tail-modulo-cons (TMC) transformation let[@tail_mod_cons] rec map f li = ... (Frédéric Bour, Gabriel Scherer, Basile Clément, review by Basile Clément and Pierre Chambart, tested by Konstantin Romanov) ### Runtime system (highlights): - #10195, #10680: Speed up GC by prefetching during marking (Stephen Dolan, review by Xavier Leroy, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan, Damien Doligez and Leo White) ### Code generation and optimizations (highlights): - #10595: Tail calls with up to 64 arguments are guaranteed to be compiled as tail calls. To this end, memory locations in the domain state are used for passing arguments that do not fit in registers. (Xavier Leroy, review by Vincent Laviron) ### Standard library (highlights): * #10710: Add UTF tools, codecs and validations to the Uchar, Bytes and String modules. (Daniel Bünzli, review by Florian Angeletti, Nicolás Ojeda Bär, Alain Frisch and Gabriel Scherer) * #10482: mark the Stream and Genlex modules as deprecated, in preparation for a future removal. These modules (without deprecation alert) are now provided by the camlp-streams library. (Xavier Leroy, review by Nicolás Ojeda Bär) - #10545: Add In_channel and Out_channel modules. (Nicolás Ojeda Bär, review by Daniel Bünzli, Simon Cruanes, Gabriel Scherer, Guillaume Munch-Maccagnoni, Alain Frisch and Xavier Leroy) ### Compiler user-interface and warnings (highlights) - #10328, #10780: Give more precise error when disambiguation could not possibly work. (Leo White, review by Gabriel Scherer and Florian Angeletti) - #10361: Improve error messages for mismatched record and variant definitions. (Florian Angeletti, review by Gabriel Radanne and Gabriel Scherer) - #10407: Produce more detailed error messages that contain full error traces when module inclusion fails. (Antal Spector-Zabusky, review by Florian Angeletti) ### Internal/compiler-libs changes (highlights): - #10718, #11012: Add "Shape" information to the cmt files. Shapes are an abstraction of modules that can be used by external tooling to perform definition-aware operations. (Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti) ### Language features: - #10462: Add attribute to produce a compiler error for polls. (Sadiq Jaffer, review by Mark Shinwell, Stephen Dolan and Guillaume Munch-Maccagnoni) - #10441: Remove unnecessary parentheses surrounding immediate objects. Allow 'object ... end # f', 'f object ... end', etc. (Yan Dong, review by Nicolás Ojeda Bär, Florian Angeletti and Gabriel Scherer) ### Runtime system: * #9391, #9424: Fix failed assertion in runtime due to ephemerons *set_* and *blit_* function during Mark phase (François Bobot, reported by Stephen Dolan, reviewed by Damien Doligez) - #10549: Stack overflow detection and naked pointers checking for ARM64 (Xavier Leroy, review by Stephen Dolan) * #10675, #10937: Emit deprecation warnings when old C runtime function names are used. This will break C stub code that uses these old names and treats warnings as errors. The workaround is to use the new names. (Xavier Leroy and David Allsopp, review by Sébastien Hinderer and Damien Doligez) - #10698, #10726, #10891: Free the alternate signal stack when the main OCaml code or an OCaml thread stops (Xavier Leroy, review by David Allsopp and Damien Doligez) - #10730, 10731: Fix bug in `Obj.reachable_words` causing a slowdown when called multiple time (Alain Frisch, report by ygrek, review by Xavier Leroy) ### Code generation and optimizations: - #10578: Increase the number of integer registers used for parameter passing on PowerPC (16 registers) and on s390x (8 registers). (Xavier Leroy, review by Mark Shinwell) - #10591, #10615: Tune the heuristic for CSE of integer constants so as to avoid excessive CSE on compiler-generated constants and long register allocation times. (Xavier Leroy, report by Edwin Török, review by Nicolás Ojeda Bär) - #10681: Enforce boolean conditions for the native backend (Vincent Laviron, review by Gabriel Scherer) - #10719: Ensure that build_apply respects Lambda.max_arity (Stephen Dolan, review by Xavier Leroy) - #10728: Ensure that functions are evaluated after their arguments (Stephen Dolan, review by Mark Shinwell) - #10732: Ensure right-to-left evaluation of arguments in cmm_helpers (Greta Yorsh, review by Xavier Leroy) ### Standard library: * #10622: Annotate `Uchar.t` with immediate attribute (Hongbo Zhang, reivew by Gabriel Scherer and Nicolás Ojeda Bär) * #7812, #10475: `Filename.chop_suffix name suff` now checks that `suff` is actually a suffix of `name` and raises Invalid_argument otherwise. (Xavier Leroy, report by whitequark, review by David Allsopp) - #10526: add Random.bits32, Random.bits64, Random.nativebits (Xavier Leroy, review by Gabriel Scherer and François Bobot) * #10568: remove Obj.marshal and Obj.unmarshal (these functions have been deprecated for a while and are superseded by the functions from module Marshal) (François Pottier, review by Gabriel Scherer and Kate Deplaix) - #10538: add Out_channel.set_buffered and Out_channel.is_buffered to control the buffering mode of output channels. (Nicolás Ojeda Bär, review by John Whitington, Daniel Bünzli, David Allsopp and Xavier Leroy) * #10583, #10998: Add over 40 new functions in Seq. (François Pottier and Simon Cruanes, review by Nicolás Ojeda Bär, Daniel Bünzli, Naëla Courant, Craig Ferguson, Wiktor Kuchta, Xavier Leroy, Guillaume Munch-Maccagnoni, Raphaël Proust, Gabriel Scherer and Thierry Martinez) - #10596, #10978: Add with_open_bin, with_open_text and with_open_gen to In_channel and Out_channel. Also, add In_channel.input_all. (Nicolás Ojeda Bär, review by Daniel Bünzli, Jérémie Dimino, Damien Doligez and Xavier Leroy) - #10658: add detailed information about the current version of OCaml to the Sys module of the standard library. (Sébastien Hinderer, review by Damien Doligez, Gabriel Scherer, David Allsopp, Nicolás Ojeda Bär, Vincent Laviron) - #10642: On Windows, Sys.remove and Unix.unlink now remove symlinks to directories instead of raising EACCES. Introduce caml/winsupport.h to hold more common code between the runtime, lib-sys, and win32unix. (Antonin Décimo, review by David Allsopp and Xavier Leroy) - #10737: add new ephemeron API for forward compatibility with Multicore OCaml. (Damien Doligez, review by Stephen Dolan) * #10922: Add deprecation warnings on {Int32,Int64,Nativeint}.format. (Nicolás Ojeda Bär, review by Xavier Leroy and Florian Angeletti) ### Other libraries: - #10192: Add support for Unix domain sockets on Windows and use them to emulate Unix.socketpair (only available on Windows 1803+) (Antonin Décimo, review by David Allsopp) - #10469: Add Thread.set_uncaught_exception_handler and Thread.default_uncaught_exception_handler. (Enguerrand Decorne, review by David Allsopp) - #10697: Bindings of dup and dup2 in win32unix now correctly call WSADuplicateSocket on sockets instead of DuplicateHandle. (Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär) - #10951: Introduce the Thread.Exit exception as an alternative way to terminate threads prematurely. This alternative way will become the standard way in 5.00. (Xavier Leroy, review by Florian Angeletti) ### Tools: - #10839: Fix regression of #show when printing class type (Élie Brami, review by Florian Angeletti) - #3959, #7202, #10476: ocaml, in script mode, directive errors (`#use "missing_file";;`) use stderr and exit with an error. (Florian Angeletti, review by Gabriel Scherer) - #10438: add a new toplevel cli argument `-e