-
Notifications
You must be signed in to change notification settings - Fork 0
/
Changes
5750 lines (4823 loc) · 241 KB
/
Changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
OCaml 4.04.0+copatterns 0.4 :
-----------------------------
### Transformation:
- New syntax for cofunction declarations (let corec, cofunction,..).
- Nested copattern-matching.
- Full copattern-matching.
OCaml 4.04.0+copatterns 0.3 :
-----------------------------
### Transformation:
- New syntax for nested copatterns.
- Verify that a child copattern is an instance of its parent.
(Parser.check_instance)
### Syntactic assertions:
- Delegate verification for indexed colabel declaration to the OCaml type checker.
(delete Parser.check_indexed_cotype)
OCaml 4.04.0+copatterns 0.2 :
-----------------------------
### Transformation:
- Refactoring.
### Improve syntactic assertions:
- In a colabel declaration, the index type constructor's name
corresponds to the one which is bound in the current type declaration.
(Parser.check_indexed_cotype)
- The type annotation in a comatch expression is a cotype.
(Parser.check_ty_in_comatch)
- The hole identifiers for a copattern matching are the same in the full
set of copatterns and correspond to the one bound by the comatch.
(Parser.check_id_in_cocases)
- At least a type annotation is declared in nested copatterns.
(MNTSA.Error.Missing_type_annotation)
### Playground:
- Add a playground folder for examples.
- A complete example for streams.
(playground/qstream.ml)
OCaml 4.04.0+copatterns 0.1 :
-----------------------------
### Init
Next version (4.04.1):
----------------------
### Standard library:
- PR#7403, GPR#894: fix a bug in Set.map as introduced in 4.04.0
(Gabriel Scherer, report by Thomas Leonard)
### Bug fixes
- PR#7405, GPR#903: s390x: Fix address of caml_raise_exn in native dynlink modules
(Richard Jones, review by Xavier Leroy)
- MPR#7417, GPR#930: ensure 16 byte stack alignment inside caml_allocN on x86-64
for ocaml build with WITH_FRAME_POINTERS defined
(Christoph Cullmann)
- GPR#912: Fix segfault in Unix.create_process on Windows caused by wrong header
configuration.
(David Allsopp)
- GPR#980: add dynlink options to ocamlbytecomp.cmxa to allow ocamlopt.opt
to load plugins. See https://github.com/OCamlPro/ocamlc-plugins for examples.
(Fabrice Le Fessant)
- GPR#992: caml-types.el: Fix missing format argument, so that it can show kind
of call at point correctly.
(Chunhui He)
OCaml 4.04.0 (4 Nov 2016):
--------------------------
(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 single
field, 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, this
limitation 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 any
files, changes (improves) the semantics of repeated -o options or -o
combined with -c see the super-detailed commit message at
https://github.com/ocaml/ocaml/commit/da56cf6dfdc13c09905c2e07f1d4849c8346eec8
(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 ppx rewriters.
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 objects
files 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 extend
the compilers at runtime.
(Fabrice Le Fessant)
- GPR#684: Detect unused module declarations
(Alain Frisch)
- GPR#706: Add a settable Env.Persistent_signature.load function so
that cmi files can be loaded from other sources. This can be used to
create self-contained toplevels.
(Jérémie Dimino)
### Standard library:
- GPR#473: Provide `Sys.backend_type` so that user can write backend-specific
code 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 of
allocated 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 Bunzli
and Damien Doligez)
- GPR#674: support unknown Sys.os_type in Filename, defaulting to Unix
(Filename would previously fail at initialization time for
Sys.os_type values other than "Unix", "Win32" and "Cygwin";
mirage-os uses "xen")
(Anil Madhavapeddy)
### Other libraries
- MPR#4834, GPR#592: Add a Biggarray.Genarray.change_layout function
to switch bigarrays between C and fortran layouts.
(Guillaume Hennequin, review by Florian Angeletti)
### Code generation and optimizations:
- PR#4747, GPR#328: Optimize Hashtbl by using in-place updates of its
internal bucket lists. All operations run in constant stack size
and are usually faster, except Hashtbl.copy which can be much
slower
(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 memory
to compile large array literal expressions
(Pierre Chambart, review by Mark Shinwell)
- PR#7291, GPR#780: Handle specialisation of recursive function that does
not 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 a
C 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 and
avoid 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 array
and 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 are
called only when a value will never be reachable anymore. The
drawbacks compared to the existing one is that the finalisation
function is not called with the value as argument. These finalisers
are 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 than expected
(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 an
array of floats
(Thomas Braibant)
### Manual and documentation:
- PR#7007, PR#7311: document the existence of OCAMLPARAM and
ocaml_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 documentation
of Warning 52 (fragile constant pattern)
(Gabriel Scherer, William, Adrien Nader, Jacques Garrigue)
- #PR7265, GPR#769: Restore 4.02.3 behaviour of Unix.fstat, if the
file 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 populate
arrays of values declared using [CAMLlocalN] (Mark Shinwell)
### Build system:
- GPR#324: Compiler developers: Adding new primitives to the
standard runtime doesn't require anymore to run `make bootstrap`
(François Bobot)
- GPR#384: Fix compilation using old Microsoft C Compilers not
supporting secure CRT functions (SDK Visual Studio 2005 compiler and
earlier) and standard 64-bit integer literals (Visual Studio .NET
2002 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` are
now the native-code versions of the tools, if those versions were
built.
(Demi Obenour)
- GPR#687: "./configure -safe-string" to get a system where
"-unsafe-string" is not allowed, thus giving stronger non-local
guarantees 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 annotations
to 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' emulation
of 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 on Windows
(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 it
converts back the signal number returned by [sigwait] to an
OS-independent number
(Jérémie Dimino)
- GPR#600: (similar to GPR#555) ensure that register typing constraints are
respected 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 Flambda
mode
(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 bootstrapping
FlexDLL 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, and
propagate updated record type information
(Pierre Chambart, review by Alain Frisch)
- GPR#678: Graphics.close_graph crashes 64-bit Windows ports (re-implementation
of 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)
OCaml 4.03.0 (25 Apr 2016):
---------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- PR#5528: inline records for constructor arguments
(Alain Frisch)
- PR#6220, PR#6403, PR#6437, PR#6801:
Improved redundancy and exhaustiveness checks for GADTs.
Namely, the redundancy checker now checks whether the uncovered pattern
of the pattern is actually inhabited, exploding at most one wild card.
This is also done for exhaustiveness when there is only one case.
Additionally, one can now write unreachable cases, of the form
"pat -> .", which are treated by the redundancy check.
(Jacques Garrigue)
- PR#6374: allow "_ t" as a short-hand for "(_, _, ..) t" for n-ary type
constructors
(Alain Frisch)
- PR#6714: allow [@@ocaml.warning] on most structure and signature items:
values, modules, module types
(whitequark)
- PR#6806: Syntax shortcut for putting a type annotation on a record field:
{ f1 : typ = e } is sugar for { f1 = (e : typ) }
{ f1 : typ } is sugar for { f1 = (f1 : typ) }
(Valentin Gatien-Baron, review by Jérémie Dimino)
- PR#6806: Allow type annotations before the "->" in "fun <args> -> <expr>"
fun x y : (int * int) -> (x, y)
(Valentin Gatien-Baron, review by Jérémie Dimino)
- GPR#26: support for "(type a b)" as syntactic sugar for "(type a) (type b)"
(Gabriel Scherer)
- GPR#42: short functor type syntax: "S -> T" for "functor (_ : S) -> T"
(Leo White)
- GPR#88: allow field punning in object copying expressions:
{< x; y; >} is sugar for {< x = x; y = y; >}
(Jeremy Yallop)
- GPR#112: octal escape sequences for char and string literals
"Make it \o033[1mBOLD\o033[0m"
(Rafaël Bocquet, request by John Whitingthon)
- GPR#167: allow to annotate externals' arguments and result types so
they can be unboxed or untagged: [@unboxed], [@untagged]. Supports
untagging int and unboxing int32, int64, nativeint and float.
(Jérémie Dimino, Mark Shinwell)
- GPR#173: [@inline] and [@inlined] attributes (for function declarations
and call sites respectively) to control inlining
(Pierre Chambart, Mark Shinwell)
- GPR#188: accept [@@immediate] attribute on type declarations to mark types
that are represented at runtime by an integer
(Will Crichton, reviewed by Leo White)
* GPR#234: allow "[]" as a user-defined constructor. Demand parenthesis
around "::" when using "::" as user-defined constructor:
code using "| :: of ..." must change to "| (::) of ...".
(Runhang Li, review by Damien Doligez)
- GPR#240: replace special annotations on externals by attributes:
* "float" is generalized to [@@unboxed]
* "noalloc" becomes [@@noalloc]
Deprecate "float" and "noalloc".
(Jérémie Dimino)
- GPR#254: @ocaml.warn_on_literal_pattern attribute on constructors to
warn when the argument is matches against a constant pattern. This
attribute is applied on predefined exception constructors which
carry purely informational (with no stability guarantee) messages.
(Alain Frisch)
- GPR#268: hexadecimal notation for floating-point literals: -0x1.ffffp+987
In OCaml source code, FP literals can be written using the hexadecimal
notation 0x<mantissa in hex>p<exponent> from ISO C99.
(Xavier Leroy)
- GPR#273: allow to get the extension slot of an extension constructor
by writing [%extension_constructor <path>]
(Jérémie Dimino)
- GPR#282: change short-paths penalty heuristic to assign the same cost to
idents containing double underscores as to idents starting with an underscore
(Thomas Refis, Leo White)
- PR#6681 GPR#326: signature items are now accepted as payloads for
extension and attributes, using the syntax [%foo: SIG ] or [@foo: SIG ].
Examples: "[%%client: val foo : int]" or "val%client foo : int".
(Alain Frisch and Gabriel Radanne)
* GPR#342: Allow shortcuts for extension and attributes on all keywords:
module%foo, class[@foo], etc.
The attribute in "let[@foo] .. in .." is now attached to the value binding,
not to the expression.
(Gabriel Radanne)
### Compilers:
* PR#4231, PR#5461: warning 31 is now fatal by default
(Warning 31: A module is linked twice in the same executable.)
This is an interim solution; double-linking of modules has dangerous
semantics, eg. exception constructors end up with two distinct declarations.
(Alain Frisch)
- PR#4800: better compilation of tuple assignment
(Gabriel Scherer and Alain Frisch)
- PR#5995: keep -for-pack into account to name exceptions;
-for-pack should now be used during bytecode compilation as well
(Alain Frisch, report by Christophe Troestler)
- PR#6400: better error message for '_' used as an expression
(Alain Frisch, report by whitequark)
- PR#6501: harden the native-code generator against certain uses of "%identity"
(Xavier Leroy, report by Antoine Miné)
- PR#6636: add --version option
(whitequark)
- PR#6679: fix pprintast printing of constraints in type declarations
(Alain Frisch, report by Jun Furuse)
- PR#6737: fix Typedtree attributes on (fun x -> body) expressions
(Alain Frisch, report by Oleg Kiselyov)
* PR#6865: remove special case for parsing "let _ = expr" in structures
(Jérémie Dimino, Alain Frisch)
* PR#6438, PR#7059, GPR#315: Pattern guard disables exhaustiveness check
(function Some x when x = 0 -> ()) will now raise warning 8 (non-exhaustive)
instead of warning 25 (all clauses are guarded). 25 isn't raised anymore.
Projects that set warning 8 as an error may fail to compile (presumably
this is the semantics they wanted).
(Alain Frisch, request by Martin Jambon and John Whitington)
- PR#6920: fix debug informations around uses of %apply or %revapply
(Jérémie Dimino, report by Daniel Bünzli)
- PR#6939: Segfault with improper use of let-rec
(Alain Frisch)
- PR#6943: native-code generator for POWER/PowerPC 64 bits, both in
big-endian (ppc64) and little-endian (ppc64le) configuration.
(Xavier Leroy, with inspiration from RedHat's unofficial ppc64 and ppc64le
ports)
- PR#6979: better code generation in x86-32 backend for copying floats to
the stack
(Marc Lasson, review by Xavier Leroy)
- PR#7018: fix missing identifier renaming during inlining
(Alain Frisch, review by Xavier Leroy)
- PR#7022, GPR#259: unbox float and boxed ints earlier, avoid second pass
(Alain Frisch)
- PR#7026, GPR#288: remove write barrier for polymorphic variants without
arguments
(Simon Cruanes)
- PR#7031: new warning 57, ambiguous guarded or-patterns
(Luc Maranget, Gabriel Scherer, report by Martin Clochard and Claude Marché)
- PR#7064, GPR#316: allowing to mark compilation units and sub-modules as
deprecated
(Alain Frisch)
- PR#7067: fix performance regression (wrt. 4.01) in the native compiler
for long nested structures
(Alain Frisch, report by Daniel Bünzli, review by Jacques Garrigue)
- PR#7097: fix strange syntax error message around illegal packaged module
signature constraints
(Alain Frisch, report by Jun Furuse)
- PR#7118, PR#7120, GPR#408, GPR#476: Bug fixed in stack unwinding
metadata generation. Was a cause of crashes in GUI programs on OS X.
(Bart Jacobs, review by Mark Shinwell)
- PR#7168: Exceeding stack limit in bytecode can lead to a crash.
(Jacques-Henri Jourdan)
- PR#7232: Strange Pprintast output with ppx_deriving
(Damien Doligez, report by Anton Bachin)
- GPR#17: some cmm optimizations of integer operations with constants
(Stephen Dolan, review by Pierre Chambart)
- GPR#89: improve type-specialization of unapplied primitives:
unapplied annotations (compare : int -> _),
type propagation (List.sort compare [1;2;3])
and propagation from module signatures now lead to specialization
(Frédéric Bour, review by Gabriel Scherer)
- GPR#107: Prevent more unnecessary float boxing, especially in `if` and `match`
(Vladimir Brankov, review by Alain Frisch)
- GPR#109: new (lazy) unboxing strategy for float and int references
(Vladimir Brankov, review by Alain Frisch)
- GPR#115: More precise typing of values at the C-- and Mach level.
(Xavier Leroy, review by Pierre Chambart)
- GPR#132: Flambda: new intermediate language and "middle-end" optimizers
(Pierre Chambart, Mark Shinwell, Leo White)
- GPR#212, PR#7226, GPR#542: emit column position in gas assembly `.loc`
(Frédéric Bour, Anton Bachin)
- GPR#207: Colors in compiler messages (warnings, errors)
configure with -color {auto|always|never} or TERM=dumb
(Simon Cruanes, review by Gabriel Scherer)
- GPR#258: more precise information on PowerPC instruction sizes
(Pierre Chambart, Xavier Leroy)
- GPR#263: improve code generation for if-equivalents of (&&) and (||)
(Pierre Chambart)
- GPR#270: Make [transl_exception_constructor] generate [Immutable] blocks
(Mark Shinwell)
- GPR#271: Fix incorrect mutability flag when records are built using "with"
(Mark Shinwell)
- GPR#275: native-code generator for IBM z System running Linux.
In memoriam Gene Amdahl, 1922-2015.
(Bill O'Farrell, Tristan Amini, Xavier Leroy)
- GPR#282: relax short-paths safety check in presence of module aliases, take
penalty into account while building the printing map.
(Thomas Refis, Leo White)
- GPR#306: Instrument the compiler to debug performance regressions
(Pierre Chambart)
- GPR#319: add warning 58 for missing cmx files, and
extend -opaque option to mli files: a missing .cmx does not warn
if the corresponding .cmi is compiled -opaque.
(Leo White)
- GPR#388: OCAML_FLEXLINK environment variable allows overriding flexlink
command (David Allsopp)
- GPR#392: put all parsetree invariants in a new module Ast_invariants
(Jérémie Dimino)
- GPR#407: don't display the name of compiled .c files when calling the
Microsoft C Compiler (same as the assembler).
(David Allsopp)
- GPR#431: permit constant float arrays to be eligible for pattern match
branch merging
(Pierre Chambart)
- GPR#455: provide more debugging information to Js_of_ocaml
(Jérôme Vouillon)
- GPR#514, GPR#554: Added several command-line flags to explicitly enable
settings that are currently the default:
`-alias-deps`, `-app-funct`, `-no-keep-docs`, `-no-keep-locs`,
`-no-principal`, `-no-rectypes`, `-no-strict-formats`
(Demi Obenour)
- GPR#545: use reraise to preserve backtrace on
`match .. with exception e -> raise e`
(Nicolas Ojeda Bar, review by Gabriel Scherer)
### Runtime system:
* GPR#596: make string/bytes distinguishable in the underlying
compiler implementation; caml_fill_string and caml_create_string are
deprecated and will be removed in the future, please use
caml_fill_bytes and caml_create_bytes for migration
(Hongbo Zhang, review by Damien Doligez, Alain Frisch, and Hugo Heuzard)
- GPR#772 %string_safe_set and %string_unsafe_set are deprecated aliases
for %bytes_safe_set and %bytes_unsafe_set.
(Hongbo Zhang and Damien Doligez)
- PR#3612, PR#92: allow allocating custom block with finalizers
in the minor heap.
(Pierre Chambart)
* PR#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown
types {,u}int{32,64}.
C stubs may have to be updated as {,u}int{32,64}_t are not defined anymore.
(Xavier Leroy)
- PR#6760: closures evaluated in the toplevel can now be marshalled
(whitequark, review by Jacques-Henri Jourdan)
- PR#6902, GPR#210: emit a runtime warning on stderr
when finalizing an I/O channel which is still open:
"channel opened on file '...' dies without being closed"
this is controlled by OCAMLRUNPARAM=W=1 or with Sys.enable_runtime_warnings.
The behavior of affected program is not changed,
but they should still be fixed.
(Alain Frisch, review by Damien Doligez)
- Signal handling: for read-and-clear, use GCC/Clang atomic builtins
if available.
(Xavier Leroy)
- PR#6910, GPR#224: marshaling (output_value, input_value, et al)
now support marshaled data bigger than 4 Gb.
(Xavier Leroy)
* GPR#226: select higher levels of optimization for GCC >= 3.4 and Clang
when compiling the run-time system and C stub code.
"-std=gnu99 -O2 -fno-strict-aliasing -fwrapv" is used by default.
This also affects default flags for user stubs compiled with "ocamlc -c foo.c"
and may uncover bugs in them.
(Xavier Leroy)
- GPR#262: Multiple GC roots per compilation unit
(Pierre Chambart, Mark Shinwell, review by Damien Doligez)
* GPR#297: Several changes to improve the worst-case GC pause time.
Changes Gc.control and Gc.major_slice and adds functions to the Gc module.
(Damien Doligez, with help from Francois Bobot, Thomas Braibant, Leo White)
- GPR#325: Add v=0x400 flag to OCAMLRUNPARAM to display GC stats on exit
(Louis Gesbert, review by Alain Frisch)
### Standard library:
- PR#1460, GPR#230: Array.map2, Array.iter2
(John Christopher McAlpine)
- PR#5197, GPR#63: Arg: allow flags such as --flag=arg as well as --flag arg
(Richard Jones)
- PR#6017, PR#7034, GPR#267: More efficient ifprintf implementation
(Jeremy Yallop, review by Gabriel Scherer)
- PR#6296: Some documentation on the floating-point representations
recognized by Pervasives.float_of_string
(Xavier Leroy)
- PR#6316: Scanf.scanf failure on %u formats when reading big integers
(Xavier Leroy, Benoît Vaugon)
- PR#6321: guarantee that "hypot infinity nan = infinity"
(for conformance with ISO C99)
(Xavier Leroy)
- PR#6390, GPR#36: expose Sys.{int_size,max_wosize} for js_of_ocaml portability
(Hugo Heuzard)
- PR#6449: Add Map.union
(Alain Frisch)
* PR#6494: Add 'equal' functions in modules
Bytes, Char, Digest, Int32, Int64, Nativeint, and String
Users defining their own modules with signature 'module type of Int32'
have to extend their implementation.
(Romain Calascibetta)
* PR#6524, GPR#79: Filename: Optional ?perms argument to open_temp_file
May break partial applications of the function (fix by passing ?perms:None)
(Daniel Bünzli, review by Jacques-Pascal Deplaix)
* PR#6525, GPR#80: Add Uchar module to the standard library
May introduce module name conflicts with existing projects.
(Daniel Bünzli, review by Yoriyuki Yamagata and Damien Doligez)
- PR#6577: improve performance of %L, %l, %n, %S, %C format specifiers
(Alain Frisch)
- PR#6585: fix memory leak in win32unix/createprocess.c
(Alain Frisch, report by user 'aha')
- PR#6645, GPR#174: Guarantee that Set.add, Set.remove, Set.filter
return the original set if no change is required
(Alain Frisch, Mohamed Iguernlala)
- PR#6649, GPR#222: accept (int_of_string "+3")
(John Christopher McAlpine)
- PR#6694, PR#6695, GPR#124: deprecate functions using ISO-8859-1 character set
in Char, Bytes, String and provide alternatives *_acii using US-ASCII.
Affected functions:
{Char,String,Bytes}.{uppercase,lowercase},
{String,Bytes}.{capitalize,uncaptialize}
(whitequark, review by Damien Doligez)
- GPR#22: Add the Ephemeron module that implements ephemerons and weak
hash table
(François Bobot, review by Damien Doligez, Daniel Bünzli,
Alain Frisch, Pierre Chambart)
- GPR#164: more efficient (branchless) implementation of Pervasives.compare
specialized at type 'float'.
(Vladimir Brankov)
- GPR#175: Guarantee that Map.add, Map.remove, Map.filter
return the original map if no change is required.
(Mohamed Iguernlala)
- GPR#201: generalize types of Printf.{ifprintf,ikfprintf}
(Maxence Guesdon)
- GPR#216: add the missing POSIX.1-2001 signals in Sys
(Guillaume Bury)
- GPR#239: remove type-unsafe code from Stream
(Pierre Chambart, review by Gabriel Scherer and Jeremy Yallop)
- GPR#250: Check for negative start element in Array.sub
(Jeremy Yallop)
- GPR#265: new implementation of Queue avoiding Obj.magic
(Jérémie Dimino)
- GPR#268, GPR#303: '%h' and '%H' modifiers for printf and scanf to
support floating-point numbers in hexadecimal notation
(Xavier Leroy, Benoît Vaugon)
- GPR#272: Switch classify_float to [@@unboxed]
(Alain Frisch)
- Improve speed of classify_float by not going through fpclassify()
(Alain Frisch, Xavier Leroy)
- GPR#277: Switch the following externals to [@@unboxed]:
* {Nativeint,Int32,Int64}.{of,to}_float
* Int{32,64}.float_of_bits
* Int{32,64}.bits_of_float
(Jérémie Dimino)
- GPR#281: Switch the following externals to [@@unboxed]:
* Sys.time (and [@@noalloc])
* Pervasives.ldexp (and [@@noalloc])
* Pervasives.compare for float, nativeint, int32, int64.
(François Bobot)
- PR#3622, GPR#195: add function Stack.fold
(Simon Cruanes)
- GPR#329: Add exists, for_all, mem and memq functions in Array
(Bernhard Schommer)
- GPR#337: Add [Hashtbl.filter_map_inplace]
(Alain Frisch)
- GPR#356: Add [Format.kasprintf]
(Jérémie Dimino, Mark Shinwell)
### Type system:
- PR#5545: Type annotations on methods cannot control the choice of abbreviation
(Jacques Garrigue)
* PR#6465: allow incremental weakening of module aliases.
This is done by adding equations to submodules when expanding aliases.
In theory this may be incompatible is some corner cases defining a module
type through inference, but no breakage known on published code.
(Jacques Garrigue)
- PR#6593: Functor application in tests/basic-modules fails after commit 15405
(Jacques Garrigue)
### Toplevel and debugger:
- PR#6113: Add descriptions to directives, and display them via #help
(Nick Giannarakis, Berke Durak, Francis Southern and Gabriel Scherer)
- PR#6396: Warnings-as-errors not properly flushed in the toplevel
(Alain Frisch)
- PR#6401: use proper error reporting for toplevel environment initialization:
no more Env.Error(_) at start time
(Gabriel Scherer, Alain Frisch)
- PR#6468: toplevel now supports backtraces if invoked with OCAMLRUNPARAM=b
(whitequark and Jake Donham,
review by Gabriel Scherer and Jacques-Henri Jourdan)
- PR#6906: wrong error location for unmatched paren with #use in toplevel
(Damien Doligez, report by Kenichi Asai)
- PR#6935, GPR#298: crash in debugger when load_printer is given a directory
(Junsong Li, review by Gabriel Scherer)
- PR#7081: report preprocessor warnings in the toplevel
(Valentin Gatien-Baron, review by Jérémie Dimino)
- PR#7098: Loss of ppx context in toplevel after an exception
(Alain Frisch, report by whitequark)
- PR#7101: The toplevel does not close in_channel for libraries specified on