From : Damien Doligez <damien.doligez AT inria.fr>

: Damien Doligez <damien.doligez AT inria.fr> To : caml users <caml-list AT inria.fr>, caml announce <caml-announce AT inria.fr>

: caml users <caml-list AT inria.fr>, caml announce <caml-announce AT inria.fr> Subject : [Caml-list] OCaml version 4.04.0 is released.

: [Caml-list] OCaml version 4.04.0 is released. Date: Fri, 4 Nov 2016 18:29:58 +0100

Dear OCaml users,We have the pleasure of celebrating the discovery of Tutankhamun'stomb by announcing the release of OCaml version 4.04.0.This is a major release with several new features (most notably,Spacetime). See the list of changes below.It is (or soon will be) available as an OPAM switch, or as a sourcedownload here: < http://caml.inria.fr/distrib/ocaml-4.04/ Happy hacking,-- Damien Doligez for the OCaml team.OCaml 4.04.0:-------------(Changes that can break existing programs are marked with a "*")### Language features:- PR#7233: Support GADT equations on non-local abstract types(Jacques Garrigue)- GPR#187, GPR#578: Local opening of modules in a pattern.Syntax: "M.(p)", "M.[p]","M.[| p |]", "M.{p}"(Florian Angeletti, Jacques Garrigue, review by Alain Frisch)- GPR#301: local exception declarations "let exception ... in"(Alain Frisch)- GPR#508: Allow shortcut for extension on semicolons: ;%foo(Jeremie Dimino)- GPR#606: optimized representation for immutable records with a singlefield, and concrete types with a single constructor with a single argument.This is triggered with a [@@unboxed] attribute on the type definition.Currently mutually recursive datatypes are not well supported, thislimitation should be lifted in the future (see MPR#7364).(Damien Doligez)### Compiler user-interface and warnings:* PR#6475, GPR#464: interpret all command-line options before compiling anyfiles, changes (improves) the semantics of repeated -o options or -ocombined with -c see the super-detailed commit message at(whitequark)- PR#7139: clarify the wording of Warning 38(Unused exception or extension constructor)(Gabriel Scherer)* PR#7147, GPR#475: add colors when reporting errors generated by ppxrewriters.Remove the `Location.errorf_prefixed` function which is no longer relevant(Simon Cruanes, Jérémie Dimino)- PR#7169, GPR#501: clarify the wording of Warning 8(Non-exhaustivity warning for pattern matching)(Florian Angeletti, review and report by Gabriel Scherer)* GPR#591: Improve support for OCAMLPARAM: (i) do not use objectsfiles with -a, -pack, -shared; (ii) use "before" objects in the toplevel(but not "after" objects); (iii) use -I dirs in the toplevel,(iv) fix bug where -I dirs were ignored when using threads(Marc Lasson, review by Damien Doligez and Alain Frisch)- GPR#648: New -plugin option for ocamlc and ocamlopt, to dynamically extendthe compilers at runtime.(Fabrice Le Fessant)- GPR#684: Detect unused module declarations(Alain Frisch)- GPR#706: Add a settable Env.Persistent_signature.load function sothat cmi files can be loaded from other sources. This can be used tocreate self-contained toplevels.(Jérémie Dimino)### Standard library:- GPR#473: Provide `Sys.backend_type` so that user can write backend-specificcode in some cases (for example, code generator).(Hongbo Zhang)- PR#6279, GPR#553: implement Set.map(Gabriel Scherer)- PR#6820, GPR#560: Add Obj.reachable_words to compute the"transitive" heap size of a value(Alain Frisch, review by Mark Shinwell and Damien Doligez)- GPR#589: Add a non-allocating function to recover the number ofallocated minor words.(Pierre Chambart, review by Damien Doligez and Gabriel Scherer)- GPR#626: String.split_on_char(Alain Frisch)- GPR#669: Filename.extension and Filename.remove_extension(Alain Frisch, request by Edgar Aroutiounian, review by Daniel Bunzliand Damien Doligez)### Code generation and optimizations:- PR#4747, GPR#328: Optimize Hashtbl by using in-place updates of itsinternal bucket lists. All operations run in constant stack sizeand are usually faster, except Hashtbl.copy which can be muchslower(Alain Frisch)* PR#6217, GPR#538: Optimize performance of record update:no more performance cliff when { foo with t1 = ..; t2 = ...; ... }hits 6 updated fields(Olivier Nicole, review by Thomas Braibant and Pierre Chambart)- PR#7023, GPR#336: Better unboxing strategy(Alain Frisch, Pierre Chambart)- PR#7244, GPR#840: Ocamlopt + flambda requires a lot of memoryto compile large array literal expressions(Pierre Chambart, review by Mark Shinwell)- PR#7291, GPR#780: Handle specialisation of recursive function that doesnot always preserve the arguments(Pierre Chambart, Mark Shinwell, report by Simon Cruanes)- GPR#427: Obj.is_block is now an inlined OCaml function instead of aC external. This should be faster.(Demi Obenour)- GPR#580: Optimize immutable float records(Pierre Chambart, review by Mark Shinwell)- GPR#602: Do not generate dummy code to force module linking(Pierre Chambart, reviewed by Jacques Garrigue)- PR#7328, GPR#702: Do not eliminate boxed int divisions by zero andavoid checking twice if divisor is zero with flambda.(Pierre Chambart, report by Jeremy Yallop)- GPR#703: Optimize some constant string operations when the "-safe-string"configure time option is enabled.(Pierre Chambart)- GPR#707: Load cross module information during a meet(Pierre Chambart, report by Leo White, review by Mark Shinwell)- GPR#709: Share a few more equal switch branches(Pierre Chambart, review by Gabriel Scherer)- GPR#712: Small improvements to type-based optimizations for arrayand lazy(Alain Frisch, review by Pierre Chambart)- GPR#714: Prevent warning 59 from triggering on Lazy of constants(Pierre Chambart, review by Leo White)- GPR#723 Sort emitted functions according to source location(Pierre Chambart, review by Mark Shinwell)- Lack of type normalization lead to missing simple compilation for "lazy x"(Alain Frisch)### Runtime system:- PR#7210, GPR#562: Allows to register finalisation function that arecalled only when a value will never be reachable anymore. Thedrawbacks compared to the existing one is that the finalisationfunction is not called with the value as argument. These finalisersare registered with `GC.finalise_last`(François Bobot reviewed by Damien Doligez and Leo White)- GPR#590: Do not perform compaction if the real overhead is less thanexpected(Thomas Braibant)### Tools:- PR#7189: toplevel #show, follow chains of module aliases(Gabriel Scherer, report by Daniel Bünzli, review by Thomas Refis)- PR#7248: have ocamldep interpret -open arguments in left-to-right order(Gabriel Scherer, report by Anton Bachin)- PR#7272, GPR#798: ocamldoc, missing line breaks in type_*.html files(Florian Angeletti)- PR#7290: ocamldoc, improved support for inline records(Florian Angeletti)- PR#7323, GPR#750: ensure "ocamllex -ml" works with -safe-string(Hongbo Zhang)- PR#7350, GPR#806: ocamldoc, add viewport metadata to generated html pages(Florian Angeletti, request by Daniel Bünzli)- GPR#452: Make the output of ocamldep more stable(Alain Frisch)- GPR#548: empty documentation comments(Florian Angeletti)- GPR#575: Add the -no-version option to the toplevel(Sébastien Hinderer)- GPR#598: Add a --strict option to ocamlyacc treat conflicts as errors(this option is now used for the compiler's parser)(Jeremy Yallop)- GPR#613: make ocamldoc use -open arguments(Florian Angeletti)- GPR#718: ocamldoc, fix order of extensible variant constructors(Florian Angeletti)### Debugging and profiling:- GPR#585: Spacetime, a new memory profiler (Mark Shinwell, Leo White)### Runtime system:- PR#7203, GPR#534: Add a new primitive caml_alloc_float_array to allocate anarray of floats(Thomas Braibant)### Manual and documentation:- PR#7007, PR#7311: document the existence of OCAMLPARAM andocaml_compiler_internal_params(Damien Doligez, reports by Wim Lewis and Gabriel Scherer)- PR#7243: warn users against using WinZip to unpack the source archive(Damien Doligez, report by Shayne Fletcher)- PR#7245, GPR#565: clarification to the wording and documentationof Warning 52 (fragile constant pattern)(Gabriel Scherer, William, Adrien Nader, Jacques Garrigue)- #PR7265, GPR#769: Restore 4.02.3 behaviour of Unix.fstat, if thefile descriptor doesn't wrap a regular file (win32unix only)(Andreas Hauptmann, review by David Allsopp)- PR#7288: flatten : Avoid confusion(Damien Doligez, report by user 'tormen')- PR#7355: Gc.finalise and lazy values(Jeremy Yallop)- GPR#841: Document that [Store_field] must not be used to populatearrays of values declared using [CAMLlocalN] (Mark Shinwell)### Build system:- GPR#324: Compiler developers: Adding new primitives to thestandard runtime doesn't require anymore to run `make bootstrap`(François Bobot)- GPR#384: Fix compilation using old Microsoft C Compilers notsupporting secure CRT functions (SDK Visual Studio 2005 compiler andearlier) and standard 64-bit integer literals (Visual Studio .NET2002 and earlier)(David Allsopp)- GPR#507: More sharing between Unix and Windows makefiles(whitequark, review by Alain Frisch)* GPR#512, GPR#587: Installed `ocamlc`, `ocamlopt`, and `ocamllex` arenow the native-code versions of the tools, if those versions werebuilt.(Demi Obenour)- GPR#687: "./configure -safe-string" to get a system where"-unsafe-string" is not allowed, thus giving stronger non-localguarantees about immutability of strings(Alain Frisch, review by Hezekiah M. Carty)### Bug fixes:* PR#6505: Missed Type-error leads to a segfault upon record access.(Jacques Garrigue, extra report by Stephen Dolan)Proper fix required a more restrictive approach to recursive types:mutually recursive types are seen as abstract types (i.e. non-contractive)when checking the well-foundedness of the recursion.* PR#6752: Nominal types and scope escaping.Revert to strict scope for non-generalizable type variables, cf. Mantis.Note that this is actually stricter than the behavior before 4.03,cf. PR#7313, meaning that you may sometimes need to add type annotationsto explicitly instantiate non-generalizable type variables.(Jacques Garrigue, following discussion with Jeremy Yallop,Nicolas Ojeda Bar and Alain Frisch)- PR#7112: Aliased arguments ignored for equality of module types(Jacques Garrigue, report by Leo White)- PR#7134: compiler forcing aliases it shouldn't while reporting type errors(Jacques Garrigue, report and suggestion by sliquister)- PR#7153: document that Unix.SOCK_SEQPACKET is not really usable.- PR#7165, GPR#494: uncaught exception on invalid lexer directive(Gabriel Scherer, report by KC Sivaramakrishnan using afl-fuzz)- PR#7257, GPR#583: revert a 4.03 change of behavior on (Unix.sleep 0.),it now calls (nano)sleep for 0 seconds as in (< 4.03) versions.(Hannes Mehnert, review by Damien Doligez)- PR#7260: GADT + subtyping compile time crash(Jacques Garrigue, report by Nicolas Ojeda Bar)- PR#7269: Segfault from conjunctive constraints in GADT(Jacques Garrigue, report by Stephen Dolan)- PR#7276: Support more than FD_SETSIZE sockets in Windows' emulationof select(David Scott, review by Alain Frisch)* PR#7278: Prevent private inline records from being mutated(Alain Frisch, report by Pierre Chambart)- PR#7284: Bug in mcomp_fields leads to segfault(Jacques Garrigue, report by Leo White)- PR#7285: Relaxed value restriction broken with principal(Jacques Garrigue, report by Leo White)- PR#7297: -strict-sequence turns off Warning 21(Jacques Garrigue, report by Valentin Gatien-Baron)- PR#7299: remove access to OCaml heap inside blocking section in win32unix(David Allsopp, report by Andreas Hauptmann)- PR#7300: remove access to OCaml heap inside blocking in Unix.sleep onWindows(David Allsopp)- PR#7305: -principal causes loop in type checker when compiling(Jacques Garrigue, report by Anil Madhavapeddy, analysis by Leo White)- PR#7330: Missing exhaustivity check for extensible variant(Jacques Garrigue, report by Elarnon *)- PR#7374: Contractiveness check unsound with constraints(Jacques Garrigue, report by Leo White)- PR#7378: GADT constructors can be re-exposed with an incompatible type(Jacques Garrigue, report by Alain Frisch)- PR#7389: Unsoundness in GADT exhaustiveness with existential variables(Jacques Garrigue, report by Stephen Dolan)* GPR#533: Thread library: fixed [Thread.wait_signal] so that itconverts back the signal number returned by [sigwait] to anOS-independent number(Jérémie Dimino)- GPR#600: (similar to GPR#555) ensure that register typing constraints arerespected at N-way join points in the control flow graph(Mark Shinwell)- GPR#672: Fix float_of_hex parser to correctly reject some invalid forms(Bogdan Tătăroiu, review by Thomas Braibant and Alain Frisch)- GPR#700: Fix maximum weak bucket size(Nicolas Ojeda Bar, review by François Bobot)- GPR#708 Allow more module aliases in strengthening (Leo White)- GPR#713, PR#7301: Fix wrong code generation involving lazy values in Flambdamode(Mark Shinwell, review by Pierre Chambart and Alain Frisch)- GPR#721: Fix infinite loop in flambda due to [@@specialise] annotations- GPR#779: Building native runtime on Windows could fail when bootstrappingFlexDLL if there was also a system-installed flexlink(David Allsopp, report Michael Soegtrop)- GPR#805, GPR#815, GPR#833: check for integer overflow in String.concat(Jeremy Yallop,review by Damien Doligez, Alain Frisch, Daniel Bünzli, Fabrice Le Fessant)- GPR#810: check for integer overflow in Array.concat(Jeremy Yallop)- GPR#814: fix the Buffer.add_substring bounds check to handle overflow(Jeremy Yallop)- GPR#880: Fix [@@inline] with default parameters in flambda (Leo White)- GPR#525: fix build on OpenIndiana(Sergey Avseyev, review by Damien Doligez)### Internal/compiler-libs changes:- PR#7200, GPR#539: Improve, fix, and add test for parsing/pprintast.ml(Runhang Li, David Sheets, Alain Frisch)- GPR#351: make driver/pparse.ml functions type-safe(Gabriel Scherer, Dmitrii Kosarev, review by Jérémie Dimino)- GPR#516: Improve Texp_record constructor representation, andpropagate updated record type information(Pierre Chambart, review by Alain Frisch)- GPR#678: Graphics.close_graph crashes 64-bit Windows ports(re-implementationof PR#3963)(David Allsopp)- GPR#679: delay registration of docstring after the mapper is applied(Hugo Heuzard, review by Leo White)- GPR#872: don't attach (**/**) comments to any particular node(Thomas Refis, review by Leo White)