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

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

: caml users <caml-list AT inria.fr> Subject : [Caml-list] Beta release of OCaml 4.00.0

: [Caml-list] Beta release of OCaml 4.00.0 Date: Wed, 6 Jun 2012 11:50:58 +0200

Dear OCaml users,The release of OCaml version 4.00.0 is approaching. We havecreated a beta version for your testing pleasure. Pleasedownload the sources, compile, install, and test your favouritesoftware with it. Then let me know what happened, one way orthe other.We are especially interested in testing done on exoticarchitectures (i.e. non-Linux and non-Mac, or 32-bit processors).This beta version is available as source code at thisaddress: < http://caml.inria.fr/pub/distrib/ocaml-4.00/ The version number is 4.00.0+beta2, note that beta1 was notreleased.Happy hacking,-- Damien Doligez for the OCaml team.OCaml 4.00.0:-------------(Changes that can break existing programs are marked with a "*")- The official name of the language is now OCaml.Language features:- Added Generalized Abstract Data Types (GADTs) to the language.See chapter "Language extensions" of the reference manual for documentation.- It is now possible to omit type annotations when packing and unpackingfirst-class modules. The type-checker attempts to infer it from the context.Using the -principal option guarantees forward compatibility.- New (module M) and (module M : S) syntax in patterns, for immediateunpacking of a first-class module.Compilers:- Revised simplification of let-alias (PR#5205, PR#5288)- Better reporting of compiler version mismatch in .cmi files* Warning 28 is now enabled by default.- New option -absname to use absolute paths in error messages- Optimize away compile-time beta-redexes, e.g. (fun x y -> e) a b.- Added option -bin-annot to dump the AST with type annotations.- Added lots of new warnings about unused variables, opens, fields,constructors, etc.* New meaning for warning 7: it is now triggered when a method is overriddenwith the "method" keyword. Use "method!" to avoid the warning.Native-code compiler:- Optimized handling of partially-applied functions (PR#5287)- Small improvements in code generated for array bounds checks (PR#5345,PR#5360).* New ARM backend (PR#5433):. Supports both Linux/EABI (armel) and Linux/EABI+VFPv3 (armhf).. Added support for the Thumb-2 instruction set with average code sizesavings of 28%.. Added support for position-independent code, natdynlink, profiling andexception backtraces.- In -g mode, generation of CFI information and a few filename/linenumber debugging annotations, enabling in particular precise stackbacktraces with the gdb debugger. Currently supported for x86 32-bitsand 64-bits only. (PR#5487)- New tool: ocamloptp, the equivalent of ocamlcp for the native-code compiler.OCamldoc:- PR#5544: improve HTML output (less formatting in html code)- PR#5522: allow refering to record fields and variant constructors- fix PR#5419 (error message in french)- fix PR#5535 (no cross ref to class after dump+load)* Use first class modules for custom generators, to be able toload various plugins incrementally adding features to the currentgenerator* PR#5507: Use Location.t structures for locations.- fix: do not keep code when not told to keep code.Standard library:- Added float functions "hypot" and "copysign" (PR#3806, PR#4752, PR#5246)* Arg: options with empty doc strings are no longer included in the usagestring(PR#5437)- Array: faster implementations of "blit", "copy", "sub", "append" and"concat"(PR#2395, PR#2787, PR#4591)* Hashtbl:. Statistically-better generic hash function based on Murmur 3 (PR#5225). Fixed behavior of generic hash function w.r.t. -0.0 and NaN (PR#5222). Added optional "random" parameter to Hashtbl.create to randomizecollision patterns and improve security (PR#5572, CVE-2012-0839). Added "randomize" function and "R" parameter to OCAMLRUNPARAMSto turn randomization on by default (PR#5572, CVE-2012-0839). Added new functorial interface "MakeSeeded" to support randomizationwith user-provided seeded hash functions.. Install new header for C code.- Filename: on-demand (lazy) initialization of the PRNG used by "temp_file".- Marshal: marshalling of function values (flag Marshal.Closures) nowalso works for functions that come from dynamically-loaded modules (PR#5215)- Random:. More random initialization (Random.self_init()), using /dev/urandomwhen available (e.g. Linux, FreeBSD, MacOS X, Solaris). Faster implementation of Random.float- Scanf: new function "unescaped" (PR#3888)- Set and Map: more efficient implementation of "filter" and "partition"- String: new function "map" (PR#3888)Installation procedure:- Compiler internals are now installed in `ocamlc -where`/compiler-libs.The files available there include the .cmi interfaces for all compilermodules, plus the following libraries:ocamlcommon.cma/.cmxa modules common to ocamlc, ocamlopt, ocamlocamlbytecomp.cma/.cmxa modules for ocamlc and ocamlocamloptcomp.cma/.cmxa modules specific to ocamloptocamltoplevel.cma modules specific to ocaml(PR#1804, PR#4653, frequently-asked feature).* Some .cmi for toplevel internals that used to be installed in`ocamlc -where` are now to be found in `ocamlc -where`/compiler-libs.Add "-I +compiler-libs" where needed.* toplevellib.cma is no longer installed because subsumed byocamlcommon.cma ocamlbytecomp.cma ocamltoplevel.cma- Added a configuration option (-with-debug-runtime) to compile and installa debug version of the runtime system, and a compiler option(-runtime-variant) to select the debug runtime.Bug Fixes:- PR#1643: functions of the Lazy module whose named started with 'lazy_' havebeen deprecated, and new ones without the prefix added- PR#3571: in Bigarrays, call msync() before unmapping to commit changes- PR#4292: various documentation problems- PR#4511, PR#4838: local modules remove polymorphism- PR#4549: Filename.dirname is not handling multiple / on Unix- PR#4688: (Windows) special floating-point values aren't converted to stringscorrectly- PR#4697: Unix.putenv leaks memory on failure- PR#4705: camlp4 does not allow to define types with `True or `False- PR#4746: wrong detection of stack overflows in native code under Linux- PR#4869: rare collisions between assembly labels for code and data- PR#4880: "assert" constructs now show up in the exception stack backtrace- PR#4892: Array.set could raise "out of bounds" before evaluating 3rd arg- PR#4937: camlp4 incorrectly handles optional arguments if 'option' isredefined- PR#5024: camlp4r now handles underscores in irrefutable patern matching ofrecords- PR#5064, PR#5485: try to ensure that 4K words of stack are availablebefore calling into C functions, raising a Stack_overflow exceptionotherwise. This reduces (but does not eliminate) the risk ofsegmentation faults due to stack overflow in C code- PR#5084: sub-sub-module building fails for native code compilation- PR#5120: fix the output function of Camlp4.Debug.formatter- PR#5159: better documentation of type Lexing.position- PR#5171: Map.join does more comparisons than needed- PR#5176: emacs mode: stack overflow in regexp matcher- PR#5179: port OCaml to mingw-w64- PR#5211: updated Genlex documentation to state that camlp4 is mandatory for'parser' keyword and associated notation- PR#5224: confusing error message in non-regular type definition- PR#5231: camlp4: fix parsing of >- PR#5238, PR#5277: Sys_error when getting error location- PR#5261, PR#5497: Ocaml source-code examples are not "copy-paste-able"- PR#5290: added hash functions for channels, nats, mutexes, conditions- PR#5295: OS threads: problem with caml_c_thread_unregister()- PR#5301: camlp4r and exception equal to another one with parameters- PR#5305: prevent ocamlbuild from complaining about links to _build/- PR#5306: comparing to Thread.self() raises exception at runtime- PR#5309: Queue.add is not thread/signal safe- PR#5310: Ratio.create_ratio/create_normalized_ratio have misleading names- PR#5311: better message for warning 23- PR#5313: ocamlopt -g misses optimizations- PR#5316: objinfo now shows ccopts/ccobjs/force_link when applicable- PR#5318: segfault on stack overflow when reading marshaled data- PR#5319: %r11 clobbered by Lswitch in Windows AMD64 native-code compilation- PR#5322: type abbreviations expanding to a universal type variable- PR#5325: (Windows) blocked Unix.recv in one thread blocks Unix.send inanother thread- PR#5328: under Windows, Unix.select leaves sockets in non-blocking mode- PR#5330: thread tag with '.top' and '.inferred.mli' targets- PR#5331: ocamlmktop is not always a shell script- PR#5335: Unix.environment segfaults after a call to clearenv- PR#5338: sanitize.sh has windows style end-of-lines (mingw)- PR#5343: ocaml -rectypes is unsound wrt module subtyping- PR#5344: some predefined exceptions need special printing- PR#5349: Hashtbl.replace uses new key instead of reusing old key- PR#5356: ocamlbuild handling of 'predicates' for ocamlfind- PR#5364: wrong compilation of "((val m : SIG1) : SIG2)"- PR#5370: ocamldep omits filename in syntax error message- PR#5374: camlp4 creates wrong location for type definitions- PR#5380: strange sscanf input segfault- PR#5382: EOPNOTSUPP and ENOTSUPP different on exotic platforms- PR#5383: build failure in Win32/MSVC- PR#5387: camlp4: str_item and other syntactic elements with Nils arenot very usable- PR#5389: compaction sometimes leaves a very large heap- PR#5393: fails to build from source on GNU/kFreeBSD because of -R linkoption- PR#5394: documentation for -dtypes is missing in manpage- PR#5397: Filename.temp_dir_name should be mutable- PR#5410: fix printing of class application with Camlp4- PR#5416: (Windows) Unix.(set|clear)_close_on_exec now preserves blockingmode- PR#5435: ocamlbuild does not find .opt executables on Windows- PR#5436: update object ids on unmarshaling- PR#5442: camlp4: quotation issue with strings- PR#5453: configure doesn't find X11 under Ubuntu/MultiarchSpec- PR#5461: Double linking of bytecode modules- PR#5463: Bigarray.*.map_file fail if empty array is requested- PR#5465: increase stack size of ocamlopt.opt for windows- PR#5469: private record type generated by functor loses abbreviation- PR#5475: Wrapper script for interpreted LablTk wrongly handles command lineparameters- PR#5476: bug in native code compilation of let rec on float arrays- PR#5477: use pkg-config to configure graphics on linux- PR#5481: update camlp4 magic numbers- PR#5482: remove bashism in test suite scripts- PR#5495: camlp4o dies on infix definition (or)- PR#5498: Unification with an empty object only checks the absence ofthe first method- PR#5503: error when ocamlbuild is passed an absolute path as build directory- PR#5509: misclassification of statically-allocated empty array thatfalls exactly at beginning of an otherwise unused data page.- PR#5510: ocamldep has duplicate -ml{,i}-synonym options- PR#5511: in Bigarray.reshape, unwarranted limitation on new arraydimensions.- PR#5513: Int64.div causes floating point exception (ocamlopt, x86)- PR#5516: in Bigarray C stubs, use C99 flexible array types if possible- PR#5518: segfault with lazy empty array- PR#5531: Allow ocamlbuild to add ocamldoc flags through -docflagand -docflags switches- PR#5543: in Bigarray.map_file, try to avoid using lseek() when growing file- PR#5538: combining -i and -annot in ocamlc- PR#5551: repeated calls to find_in_path degrade performance- PR#5552: Mac OS X: unrecognized gcc option "-no-cpp-precomp"- PR#5555: add Hashtbl.reset to resize the bucket table to its initial size- PR#5560: incompatible type for tuple pattern with -principal- PR#5575: Random states are not marshallable across architectures- PR#5579: camlp4: when a plugin is loaded in the toplevel,Token.Filter.define_filter has no effect before the first syntax error- PR#5585: typo: "explicitely"- PR#5587: documentation: "allows to" is not correct English- PR#5593: remove C file when -output-obj fails- PR#5598: add backslash-space support in strings in ocamllex- PR#5603: wrong .file debug info generated by ocamlopt -g- PR#5604: fix permissions of files created by ocamlbuild itself- PR#5610: new unmarshaler (from PR#5318) fails to freshen object identifiers- PR#5614: add missing -linkall flag when compiling ocamldoc.opt- PR#5616: move ocamlbuild documentation to the reference manual- PR#5619: Uncaught CType.Unify exception in the compiler- PR#5620: invalid printing of type manifest (camlp4 revised syntax)- problem with printing of string literals in camlp4 (reported on caml-list)- emacs mode: colorization of comments and strings now works correctly- problem with forall and method (reported on caml-list on 2011-07-26)Feature wishes:- PR#352: new option "-stdin" to make ocaml read stdin as a script- PR#1164: better error message when mixing -a and .cmxa- PR#1284: documentation: remove restriction on mixed streams- PR#1496: allow configuring LIBDIR, BINDIR, and MANDIR relative to $(PREFIX)- PR#1835: add Digest.from_hex- PR#1898: toplevel: add option to suppress continuation prompts- PR#4278: configure: option to disable "graph" library- PR#4444: new String.trim function, removing leading and trailing whistespace- PR#4549: make Filename.dirname/basename POSIX compliant- PR#4830: add option -v to expunge.ml- PR#4898: new Sys.big_endian boolean for machine endianness- PR#4963, PR#5467: no extern "C" into ocaml C-stub headers- PR#5199: tests are run only for bytecode if either native support ismissing,or a non-empty value is set to "BYTECODE_ONLY" Makefile variable- PR#5215: marshalling of dynlinked closure- PR#5236: new '%revapply' primitive with the semantics 'revapply x f = f x',and '%apply' with semantics 'apply f x = f x'.- PR#5295: OS threads: problem with caml_c_thread_unregister()- PR#5297: compiler now checks existence of builtin primitives- PR#5329: (Windows) more efficient Unix.select if all fd's are sockets- PR#5358: first class modules don't allow "with type" declarations for typesin sub-modules- PR#5385: configure: emit a warning when MACOSX_DEPLOYMENT_TARGET is set- PR#5396: ocamldep: add options -sort, -all, and -one-line- PR#5397: Filename.temp_dir_name should be mutable- PR#5403: give better error message when emacs is not found in PATH- PR#5411: new directive for the toplevel: #load_rec- PR#5420: Unix.openfile share mode (Windows)- PR#5421: Unix: do not leak fds in various open_proc* functions- PR#5434: implement Unix.times in win32unix (partially)- PR#5437: warning for useless open statements- PR#5438: new warnings for unused declarations- PR#5439: upgrade config.guess and config.sub- PR#5445 and others: better printing of types with user-provided names- PR#5454: Digest.compare is missing and md5 doc update- PR#5455: .emacs instructions, add lines to recognize ocaml scripts- PR#5456: pa_macro: replace __LOCATION__ after macro expansion; addLOCATION_OF- PR#5461: bytecode: emit warning when linking two modules with the same name- PR#5478: ocamlopt assumes ar command exists- PR#5479: Num.num_of_string may raise an exception, not reflected in thedocumentation.- PR#5501: increase IO_BUFFER_SIZE to 64KiB- PR#5532: improve error message when bytecode file is wrong- PR#5555: add function Hashtbl.reset to resize the bucket table toits initial size.- PR#5586: increase UNIX_BUFFER_SIZE to 64KiB- PR#5599: Add warn() tag in ocamlbuild to control -w compiler switch- ocamldebug: ability to inspect values that contain code pointers- ocamldebug: new 'environment' directive to set environment variablesfor debuggee- configure: add -no-camlp4 optionShedding weight:* Removed the obsolete native-code generators for Alpha, HPPA, IA64 and MIPS.* The "DBM" library (interface with Unix DBM key-value stores) is nolonger part of this distribution. It now lives its own life at* The "OCamlWin" toplevel user interface for MS Windows is no longerpart of this distribution. It now lives its own life atOther changes:- Copy VERSION file to library directory when installing.