OCaml4.06.0の変更点
このページは最後に更新されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。
last mod. 2017-11-05 (日) 09:58:25
http://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes を元にしています。
既存のプログラムを壊す可能性のある変更点には * をつけてある。
Language features:
- GPR#792: fix limitations of destructive substitutions, by
allowing "S with type t := type-expr",
"S with type M.t := type-expr", "S with module M.N := path"
(Valentin Gatien-Baron, review by Jacques Garrigue and Leo White)
- * GPR#1064, GPR#1392: extended indexing operators, add a new class of
user-defined indexing operators, obtained by adding at least
one operator character after the dot symbol to the standard indexing
operators: e,g ".%()", ".?[]", ".@{}<-":
let ( .%() ) = List.nth in [0; 1; 2].%(1)
After this change, functions or methods with an explicit polymorphic type
annotation and of which the first argument is optional now requires a space
between the dot and the question mark,
e.g. "<f:'a.?opt:int->unit>" must now be written "<f:'a. ?opt:int->unit>".
(Florian Angeletti, review by Damien Doligez and Gabriel Radanne)
- GPR#1118: Support inherited field in object type expression
type t = < m : int >
type u = < n : int; t; k : int >
(Runhang Li, reivew by Jeremy Yallop, Leo White, Jacques Garrigue,
and Florian Angeletti)
- * GPR#1232: Support Unicode character escape sequences in string
literals via the \u{X+} syntax. These escapes are substituted by the
UTF-8 encoding of the Unicode character.
(Daniel Bünzli, review by Damien Doligez, Alain Frisch, Xavier
Leroy and Leo White)
- * GPR#1253: Private extensible variants
This change breaks code relying on the undocumented ability to export
extension constructors for abstract type in signature. Briefly,
module type S = sig
type t
type t += A
end
must now be written
module type S = sig
type t = private ..
type t += A
end
(Leo White, review by Alain Frisch)
Type system
- MPR#248, GPR#1225: unique names for weak type variables
# ref [];;
- : '_weak1 list ref = {contents = []}
(Florian Angeletti, review by Frédéric Bour, Jacques Garrigue,
Gabriel Radanne and Gabriel Scherer)
- * MPR#6738, MPR#7215, MPR#7231, GPR#556: Add a new check that 'let rec'
bindings are well formed.
(Jeremy Yallop, reviews by Stephen Dolan, Gabriel Scherer, Leo
White, and Damien Doligez)
Standard library:
- MPR#1771, MPR#7309, GPR#1026: Add update to maps. Allows to update a
binding in a map or create a new binding if the key had no binding
val update: key -> ('a option -> 'a option) -> 'a t -> 'a t
(Sébastien Briais, review by Daniel Buenzli, Alain Frisch and
Gabriel Scherer)
- MPR#7515, GPR#1147: Arg.align now optionally uses the tab character '\t' to
separate the "unaligned" and "aligned" parts of the documentation string. If
tab is not present, then space is used as a fallback. Allows to have spaces in
the unaligned part, which is useful for Tuple options.
(Nicolas Ojeda Bar, review by Alain Frisch and Gabriel Scherer)
- * GPR#615: Format, add symbolic formatters that output symbolic
pretty-printing items. New fields have been added to the
formatter_out_functions record, thus this change will break any code building
such record from scratch.
When building Format.formatter_out_functions values redefinining the out_spaces field,
"{ fmt_out_funs with out_spaces = f; }" should be replaced by
"{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old behavior.
(Richard Bonichon and Pierre Weis, review by Alain Frisch, original request by
Spiros Eliopoulos in [[GPR#506:https://github.com/ocaml/ocaml/pull/506]])
- * GPR#943: Fixed the divergence of the Pervasives module between the stdlib
and threads implementations. In rare circumstances this can change the
behavior of existing applications: the implementation of Pervasives.close_out
used when compiling with thread support was inconsistent with the manual.
It will now not suppress exceptions escaping Pervasives.flush anymore.
Developers who want the old behavior should use Pervasives.close_out_noerr
instead. The stdlib implementation, used by applications not compiled
with thread support, will now only suppress Sys_error exceptions in
Pervasives.flush_all. This should allow exceedingly unlikely assertion
exceptions to escape, which could help reveal bugs in the standard library.
(Markus Mottl, review by Hezekiah M. Carty, Jeremie Dimino, Damien Doligez,
Alain Frisch, Xavier Leroy, Gabriel Scherer and Mark Shinwell)
- GPR#1034: List.init : int -> (int -> 'a) -> 'a list
(Richard Degenne, review by David Allsopp, Thomas Braibant, Florian
Angeletti, Gabriel Scherer, Nathan Moreau, Alain Frisch)
Other libraries:
- * MPR#7640, GPR#1414: reimplementation of Unix.execvpe to fix issues
with the 4.05 implementation. The main issue is that the current
directory was always searched (last), even if the current directory
is not listed in the PATH.
(Xavier Leroy, report by Louis Gesbert and Arseniy Alekseyev,
review by Ivan Gotovchits)
- GPR#1217: Restrict Unix.environment in privileged contexts; add
Unix.unsafe_environment.
(Jeremy Yallop, review by Mark Shinwell, Nicolas Ojeda Bar,
Damien Doligez and Hannes Mehnert)
Compiler user-interface and warnings:
- GPR#896: "-compat-32" is now taken into account when building .cmo/.cma
(Hugo Heuzard)
- GPR#1114, GPR#1393, GPR#1429: refine the (ocamlc -config) information
on C compilers: the variables `{bytecode,native}_c_compiler` are deprecated
(the distinction is now mostly meaningless) in favor of a single
`c_compiler` variable combined with `ocaml{c,opt}_cflags`
and `ocaml{c,opt}_cppflags`.
(Sébastien Hinderer, Jeremy Yallop, Gabriel Scherer, review by
Adrien Nader and David Allsopp)
- * GPR#1189: allow MSVC ports to use -l option in ocamlmklib
(David Allsopp)
- GPR#1332: fix ocamlc handling of "-output-complete-obj"
(François Bobot)
Code generation and optimizations:
- MPR#5324, GPR#375: An alternative Linear Scan register allocator for
ocamlopt, activated with the -linscan command-line flag. This
allocator represents a trade-off between worse generated code
performance for higher compilation speed (especially interesting in
some cases graph coloring is necessarily quadratic).
(Marcell Fischbach and Benedikt Meurer, adapted by Nicolas Ojeda
Bar, review by Nicolas Ojeda Bar and Alain Frisch)
- MPR#7531, GPR#1162: Erroneous code transformation at partial applications
(Mark Shinwell)
- MPR#7614, GPR#1313: Ensure that inlining does not depend on the order
of symbols (flambda)
(Leo White, Xavier Clerc, report by Alex, review by Gabriel Scherer
and Pierre Chambart)
- MPR#7642, GPR#1411: ARM port: wrong register allocation for integer
multiply on ARMv4 and ARMv5; possible wrong register allocation for
floating-point multiply and add on VFP and for floating-point
negation and absolute value on soft FP emulation.
(Xavier Leroy, report by Stéphane Glondu and Ximin Luo,
review and additional sightings by Mark Shinwell)
- * GPR#659: Remove support for SPARC native code generation
(Mark Shinwell)
- GPR#1143: tweaked several allocation functions in the runtime by
checking for likely conditions before unlikely ones and eliminating
some redundant checks.
(Markus Mottl, review by Alain Frisch, Xavier Leroy, Gabriel Scherer,
Mark Shinwell and Leo White)
- GPR#1323: make sure that frame tables are generated in the data
section and not in the read-only data section, as was the case
before in the PPC and System-Z ports. This avoids relocations in
the text segment of shared libraries and position-independent
executables generated by ocamlopt.
(Xavier Leroy, review by Mark Shinwell)
Tools:
- * MPR#7478, GPR#1037: ocamldoc, do not use as a module preamble documentation
comments that occur after the first module element. This change may break
existing documenation. In particular, module preambles must now come before
any `open` statement.
(Florian Angeletti, review by David Allsopp and report by Daniel Bünzli)
- MPR#7521, GPR#1159: ocamldoc, end generated latex file with a new line
(Florian Angeletti)
- MPR#7575, GPR#1219: Switch compilers from -no-keep-locs
to -keep-locs by default: produced .cmi files will contain locations.
This provides better error messages. Note that, as a consequence,
.cmi digests now depend on the file path as given to the compiler.
(Daniel Bünzli)
- GPR#1036: ocamlcmt (tools/read_cmt) is installed, converts .cmt to .annot
(Fabrice Le Fessant)
Toplevel:
- MPR#7570: remove unusable -plugin option from the toplevel
(Florian Angeletti)
Runtime system:
- * MPR#3771, GPR#153, GPR#1200, GPR#1357, GPR#1362, GPR#1363, GPR#1369, GPR#1398,
[[GPR#1446:https://github.com/ocaml/ocaml/pull/1446]], [[GPR#1448:https://github.com/ocaml/ocaml/pull/1448]]: Unicode support for the Windows runtime.
(ygrek, Nicolas Ojeda Bar, review by Alain Frisch, David Allsopp, Damien
Doligez)
- GPR#71: The runtime can now be shut down gracefully by means of the new
caml_shutdown and caml_startup_pooled functions. The new 'c' flag in
OCAMLRUNPARAM enables shutting the runtime properly on process exit.
(Max Mouratov, review and discussion by Damien Doligez, Gabriel Scherer,
Mark Shinwell, Thomas Braibant, Stephen Dolan, Pierre Chambart,
François Bobot, Jacques Garrigue, David Allsopp, and Alain Frisch)
- GPR#1073: Remove statically allocated compare stack.
(Stephen Dolan)
- GPR#1326: Enable use of CFI directives in AArch64 and ARM runtime
systems' assembly code (asmrun/arm64.S). Add CFI directives to enable
unwinding through [caml_c_call] and [caml_call_gc] with correct termination
of unwinding at [main].
(Mark Shinwell, review by Xavier Leroy and Gabriel Scherer, with thanks
to Daniel Bünzli and Fu Yong Quah for testing)
- GPR#1338: Add "-g" for bytecode runtime system compilation
(Mark Shinwell)
Manual and documentation:
- GPR#594: New chapter on polymorphism troubles:
weakly polymorphic types, polymorphic recursion,and higher-ranked
polymorphism.
(Florian Angeletti, review by Damien Doligez, Gabriel Scherer,
and Gerd Stolpmann)
- GPR#1187: Minimal documentation for compiler plugins
(Florian Angeletti)
- GPR#1202: Fix Typos in comments as well as basic grammar errors.
(JP Rodi, review and suggestions by David Allsopp, Max Mouratov,
Florian Angeletti, Xavier Leroy, Mark Shinwell and Damien Doligez)
- GPR#1220: Fix "-keep-docs" option in ocamlopt manpage
(Etienne Millon)
Compiler distribution build system:
- MPR#6373, GPR#1093: Suppress trigraph warnings from macOS assembler
(Mark Shinwell)
- * GPR#1104: remove support for the NeXTStep platform
(Sébastien Hinderer)
- GPR#1130: enable detection of IBM XL C compiler (one need to run configure
with "-cc <path to xlc compiler>"). Enable shared library support for
bytecode executables on AIX/xlc (tested on AIX 7.1, XL C 12).
To enable 64-bit, run both "configure" and "make world" with OBJECT_MODE=64.
(Konstantin Romanov, Enrique Naudon)
- * GPR#1242: disable C plugins loading by default
(Alexey Egorov)
- GPR#1275: correct configure test for Spacetime availability
(Mark Shinwell)
- GPR#1278: discover presence of <sys/shm.h> during configure for afl runtime
(Hannes Mehnert)
The previous configure option -safe-string is now
renamed -force-safe-string.
At configure-time, -force-safe-string forces all module to use
immutable strings (this disables the per-file, compile-time
-unsafe-string option). The new default-(un)safe-string options
let you set the default choice for the per-file compile-time
option. (The new [[GPR#1252:https://github.com/ocaml/ocaml/pull/1252]] behavior corresponds to having
-default-safe-string, while 4.05 and older had
-default-unsafe-string).
(Gabriel Scherer, review by Jacques-Pascal Deplaix and Damien Doligez)
- GPR#1409: Fix to enable NetBSD/powerpc to work.
(Håvard Eidnes)
Internal/compiler-libs changes:
- GPR#406: remove polymorphic comparison for Types.constructor_tag in compiler
(Dwight Guth, review by Gabriel Radanne, Damien Doligez, Gabriel Scherer,
Pierre Chambart, Mark Shinwell)
- GRP#1119: Change Set (private) type to inline records.
(Albin Coquereau)
- * GPR#1127: move config/{m,s}.h to byterun/caml and install them.
User code should not have to include them directly since they are
included by other header files.
Previously {m,s}.h were not installed but they were substituted into
caml/config.h; they are now just #include-d by this file. This may
break some scripts relying on the (unspecified) presence of certain
#define in config.h instead of m.h and s.h -- they can be rewritten
to try to grep those files if they exist.
(Sébastien Hinderer)
Bug fixes
- MPR#7070, GPR#1139: Unexported values can cause non-generalisable variables
error
(Leo White)
- MPR#7543: short-paths printtyp can fail on packed type error messages
(Florian Angeletti)
- GPR#1199: Pretty-printing formatting cleanup in pprintast
(Ethan Aubin, suggestion by Gabriel Scherer, review by David Allsopp,
Florian Angeletti, and Gabriel Scherer)
- GPR#1324: ensure that flambda warning are printed only once
(Xavier Clerc)
|