-
Notifications
You must be signed in to change notification settings - Fork 1
/
Changes
9606 lines (7664 loc) · 387 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.10 maintenance branch
-----------------------------
### Runtime system:
- #9344, #9368: Disable exception backtraces in bytecode programs
built with "-output-complete-exe". At the moment, such programs do
not embed debug information and exception backtraces where causing
them to crash.
(Jérémie Dimino, review by Nicolás Ojeda Bär)
### Build system:
- #9531: fix support for the BFD library on FreeBSD
(Hannes Mehnert, review by Gabriel Scherer and David Allsopp)
### Bug fixes:
- #9068, #9437: ocamlopt -output-complete-obj failure on FreeBSD 12
(Xavier Leroy, report by Hannes Mehnert, review by Sébastien Hinderer)
- #9165: Add missing -function-sections and -O3 flags in Makefiles.
(Greta Yorsh, review by David Allsopp)
- #9495: fix a bug where bytecode binaries compiled with `-output-complete-exe`
would not execute `at_exit` hooks at program termination (in particular,
output channels would not be flushed).
(Nicolás Ojeda Bär, review by David Allsopp)
- #9714, #9724: Use the C++ alignas keyword when compiling in C++ in MSVC.
Fixes a bug with MSVC C++ 2015 onwards.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
- #9736, #9749: Compaction must start in a heap where all free blocks are
blue, which was not the case with the best-fit allocator.
(Damien Doligez, report and review by Leo White)
### Tools:
- #9552: restore ocamloptp build and installation
(Florian Angeletti, review by David Allsopp and Xavier Leroy)
OCaml 4.10.0 (21 February 2020)
-------------------------------
(Changes that can break existing programs are marked with a "*")
### Language features
- #7757, #1726: multi-indices for extended indexing operators:
`a.%{0;1;2}` desugars to `( .%{ ;.. } ) a [|0;1;2|]`
(Florian Angeletti, review by Gabriel Radanne)
* #1859, #9117: enforce safe (immutable) strings by removing
the -unsafe-string option by default. This can be overridden by
a configure-time option (available since 4.04 in 2016):
--disable-force-safe-string since 4.08, -no-force-safe-since
between 4.07 and 4.04.
In the force-safe-string mode (now the default), the return type of the
String_val macro in C stubs is `const char*` instead of
`char*`. This change may break C FFI code.
(Kate Deplaix)
- #6662, #8908: allow writing "module _ = E" to ignore module expressions
(Thomas Refis, review by Gabriel Radanne)
### Runtime system:
- #8809, #9292: Add a best-fit allocator for the major heap; still
experimental, it should be much better than current allocation
policies (first-fit and next-fit) for programs with large heaps,
reducing both GC cost and memory usage.
This new best-fit is not (yet) the default; set it explicitly with
OCAMLRUNPARAM="a=2" (or Gc.set from the program). You may also want
to increase the `space_overhead` parameter of the GC (a percentage,
80 by default), for example OCAMLRUNPARAM="o=85", for optimal
speed.
(Damien Doligez, review by Stephen Dolan, Jacques-Henri Jourdan,
Xavier Leroy, Leo White)
* #8713, #8940, #9115, #9143, #9202, #9251:
Introduce a state table in the runtime to contain the global variables.
(The Multicore runtime will have one such state for each domain.)
This changes the status of some internal variables of the OCaml runtime;
in many cases the header file originally defining the internal variable
provides a compatibility macro with the old name, but programs
re-defining those variables by hand need to be fixed.
(KC Sivaramakrishnan and Stephen Dolan,
compatibility hacking by David Allsopp, Florian Angeletti, Kate Deplaix,
Jacques Garrigue, Guillaume Munch-Maccagnoni and Nicolás Ojeda Bär,
review by David Allsopp, Alain Frisch, Nicolas Ojeda Bar,
Gabriel Scherer, Damien Doligez, and Guillaume Munch-Maccagnoni)
- #8993: New C functions caml_process_pending_actions{,_exn} in
caml/signals.h, intended for executing all pending actions inside
long-running C functions (requested minor and major collections,
signal handlers, finalisers, and memprof callbacks). The function
caml_process_pending_actions_exn returns any exception arising
during their execution, allowing resources to be cleaned-up before
re-raising.
(Guillaume Munch-Maccagnoni, review by Jacques-Henri Jourdan,
Stephen Dolan, and Gabriel Scherer)
* #8691, #8897, #9027: Allocation functions are now guaranteed not to
trigger any OCaml callback when called from C. In long-running C
functions, this can be replaced with calls to
caml_process_pending_actions at safe points.
Side effect of this change: in bytecode mode, polling for
asynchronous callbacks is performed at every minor heap allocation,
in addition to function calls and loops as in previous OCaml
releases.
(Jacques-Henri Jourdan, review by Stephen Dolan, Gabriel Scherer and
Guillaume Munch-Maccagnoni)
* #9037: caml_check_urgent_gc is now guaranteed not to trigger any
finaliser. In long-running C functions, this can be replaced
with calls to caml_process_pending_actions at safe points.
(Guillaume Munch-Maccagnoni, review by Jacques-Henri Jourdan and
Stephen Dolan)
- #8619: Ensure Gc.minor_words remains accurate after a GC.
(Stephen Dolan, Xavier Leroy and David Allsopp,
review by Xavier Leroy and Gabriel Scherer)
- #8667: Limit GC credit to 1.0
(Leo White, review by Damien Doligez)
- #8670: Fix stack overflow detection with systhreads
(Stephen Dolan, review by Xavier Leroy, Anil Madhavapeddy, Gabriel Scherer,
Frédéric Bour and Guillaume Munch-Maccagnoni)
* #8711: The major GC hooks are no longer allowed to interact with the
OCaml heap.
(Jacques-Henri Jourdan, review by Damien Doligez)
- #8630: Use abort() instead of exit(2) in caml_fatal_error, and add
the new hook caml_fatal_error_hook.
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #8641: Better call stacks when a C call is involved in byte code mode
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #8634, #8668, #8684, #9103 (originally #847): Statistical memory profiling.
In OCaml 4.10, support for allocations in the minor heap in native
mode is not available, and callbacks for promotions and
deallocations are not available.
Hence, there is not any public API for this feature yet.
(Jacques-Henri Jourdan, review by Stephen Dolan, Gabriel Scherer
and Damien Doligez)
- #9268, #9271: Fix bytecode backtrace generation with large integers present.
(Stephen Dolan and Mark Shinwell, review by Gabriel Scherer and
Jacques-Henri Jourdan)
### Standard library:
- #8760: List.concat_map : ('a -> 'b list) -> 'a list -> 'b list
(Gabriel Scherer, review by Daniel Bünzli and Thomas Refis)
- #8832: List.find_map : ('a -> 'b option) -> 'a list -> 'b option
(Gabriel Scherer, review by Jeremy Yallop, Nicolás Ojeda Bär
and Daniel Bünzli)
- #7672, #1492: Add `Filename.quote_command` to produce properly-quoted
commands for execution by Sys.command.
(Xavier Leroy, review by David Allsopp and Damien Doligez)
- #8971: Add `Filename.null`, the conventional name of the "null" device.
(Nicolás Ojeda Bär, review by Xavier Leroy and Alain Frisch)
- #8651: add '%#F' modifier in printf to output OCaml float constants
in hexadecimal
(Pierre Roux, review by Gabriel Scherer and Xavier Leroy)
- #8657: Optimization in [Array.make] when initializing with unboxed
or young values.
(Jacques-Henri Jourdan, review by Gabriel Scherer and Stephen Dolan)
- #8716: Optimize [Array.fill] and [Hashtbl.clear] with a new runtime primitive
(Alain Frisch, review by David Allsopp, Stephen Dolan and Damien Doligez)
- #8530: List.sort: avoid duplicate work by chop
(Guillaume Munch-Maccagnoni, review by David Allsopp, Damien Doligez and
Gabriel Scherer)
### Other libraries:
- #1939, #2023: Implement Unix.truncate and Unix.ftruncate on Windows.
(Florent Monnier and Nicolás Ojeda Bär, review by David Allsopp)
### Code generation and optimizations:
- #8806: Add an [@@immediate64] attribute for types that are known to
be immediate only on 64 bit platforms
(Jérémie Dimino, review by Vladimir Keleshev)
- #9028, #9032: Fix miscompilation by no longer assuming that
untag_int (tag_int x) = x in Cmmgen; the compilation of `(n lsl 1) + 1`,
for example, would be incorrect if evaluated with a large value for `n`.
(Stephen Dolan, review by Vincent Laviron and Xavier Leroy)
- #8672: Optimise Switch code generation on booleans.
(Stephen Dolan, review by Pierre Chambart)
- #8990: amd64: Emit 32bit registers for Iconst_int when we can
(Xavier Clerc, Tom Kelly and Mark Shinwell, review by Xavier Leroy)
- #2322: Add pseudo-instruction `Ladjust_trap_depth` to replace
dummy Lpushtrap generated in linearize
(Greta Yorsh and Vincent Laviron, review by Xavier Leroy)
- #8707: Simplif: more regular treatment of Tupled and Curried functions
(Gabriel Scherer, review by Leo White and Alain Frisch)
- #8526: Add compile-time option -function-sections in ocamlopt to emit
each function in a separate named text section on supported targets.
(Greta Yorsh, review by Pierre Chambart)
- #2321: Eliminate dead ICatch handlers
(Greta Yorsh, review by Pierre Chambart and Vincent Laviron)
- #8919: lift mutable lets along with immutable ones
(Leo White, review by Pierre Chambart)
- #8909: Graph coloring register allocator: the weights put on
preference edges should not be divided by 2 in branches of
conditional constructs, because it is not good for performance
and because it leads to ignoring preference edges with 0 weight.
(Eric Stavarache, review by Xavier Leroy)
- #9006: int32 code generation improvements
(Stephen Dolan, designed with Greta Yorsh, review by Xavier Clerc,
Xavier Leroy and Alain Frisch)
- #9041: amd64: Avoid stall in sqrtsd by clearing destination.
(Stephen Dolan, with thanks to Andrew Hunter, Will Hasenplaugh,
Spiros Eliopoulos and Brian Nigito. Review by Xavier Leroy)
- #2165: better unboxing heuristics for let-bound identifiers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)
- #8735: unbox across static handlers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)
### Manual and documentation:
- #8718, #9089: syntactic highlighting for code examples in the manual
(Florian Angeletti, report by Anton Kochkov, review by Gabriel Scherer)
- #9101: add links to section anchor before the section title,
make the name of those anchor explicits.
(Florian Angeletti, review by Daniel Bünzli, Sébastien Hinderer,
and Gabriel Scherer)
- #9257, cautionary guidelines for using the internal runtime API
without too much updating pain.
(Florian Angeletti, review by Daniel Bünzli, Guillaume Munch-Maccagnoni
and KC Sivaramakrishnan)
- #8950: move local opens in pattern out of the extension chapter
(Florian Angeletti, review and suggestion by Gabriel Scherer)
- #9088, #9097: fix operator character classes
(Florian Angelettion, review by Gabriel Scherer,
report by Clément Busschaert)
- #9169: better documentation for the best-fit allocation policy
(Gabriel Scherer, review by Guillaume Munch-Maccagnoni
and Florian Angeletti)
### Compiler user-interface and warnings:
- #8833: Hint for (type) redefinitions in toplevel session
(Florian Angeletti, review by Gabriel Scherer)
- #2127, #9185: Refactor lookup functions
Included observable changes:
- makes the location of usage warnings and alerts for constructors more
precise
- don't warn about a constructor never being used to build values when it
has been defined as private
(Leo White, Hugo Heuzard review by Thomas Refis, Florian Angeletti)
- #8702, #8777: improved error messages for fixed row polymorphic variants
(Florian Angeletti, report by Leo White, review by Thomas Refis)
- #8844: Printing faulty constructors, inline records fields and their types
during type mismatches. Also slightly changed other type mismatches error
output.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White)
- #8885: Warn about unused local modules
(Thomas Refis, review by Alain Frisch)
- #8872: Add ocamlc option "-output-complete-exe" to build a self-contained
binary for bytecode programs, containing the runtime and C stubs.
(Stéphane Glondu, Nicolás Ojeda Bär, review by Jérémie Dimino and Daniel
Bünzli)
- #8874: add tests for typechecking error messages and pack them into
pretty-printing boxes.
(Oxana Kostikova, review by Gabriel Scherer)
- #8891: Warn about unused functor parameters
(Thomas Refis, review by Gabriel Radanne)
- #8903: Improve errors for first-class modules
(Leo White, review by Jacques Garrigue)
- #8914: clarify the warning on unboxable types used in external primitives (61)
(Gabriel Scherer, review by Florian Angeletti, report on the Discourse forum)
- #9046: disable warning 30 by default
This outdated warning complained on label/constructor name conflicts
within a mutually-recursive type declarations; there is now no need
to complain thanks to type-based disambiguation.
(Gabriel Scherer)
### Tools:
* #6792, #8654 ocamldebug now supports programs using Dynlink. This
changes ocamldebug messages, which may break compatibility
with older emacs modes.
(Whitequark and Jacques-Henri Jourdan, review by Gabriel Scherer
and Xavier Clerc)
- #8621: Make ocamlyacc a Windows Unicode application
(David Allsopp, review by Nicolás Ojeda Bär)
* #8834, `ocaml`: adhere to the XDG base directory specification to
locate an `.ocamlinit` file. Reads an `$XDG_CONFIG_HOME/ocaml/init.ml`
file before trying to lookup `~/.ocamlinit`. On Windows the behaviour
is unchanged.
(Daniel C. Bünzli, review by David Allsopp, Armaël Guéneau and
Nicolás Ojeda Bär)
- #9113: ocamldoc: fix the rendering of multi-line code blocks
in the 'man' backend.
(Gabriel Scherer, review by Florian Angeletti)
- #9127, #9130: ocamldoc: fix the formatting of closing brace in record types.
(David Allsopp, report by San Vu Ngoc)
- #9181: make objinfo work on Cygwin and look for the caml_plugin_header
symbol in both the static and the dynamic symbol tables.
(Sébastien Hinderer, review by Gabriel Scherer and David Allsopp)
### Build system:
- #8840: use ocaml{c,opt}.opt when available to build internal tools
On my machine this reduces parallel-build times from 3m30s to 2m50s.
(Gabriel Scherer, review by Xavier Leroy and Sébastien Hinderer)
- #8650: ensure that "make" variables are defined before use;
revise generation of config/util.ml to better quote special characters
(Xavier Leroy, review by David Allsopp)
- #8690, #8696: avoid rebuilding the world when files containing primitives
change.
(Stephen Dolan, review by Gabriel Scherer, Sébastien Hinderer and
Thomas Refis)
- #8835: new configure option --disable-stdlib-manpages to disable building
and installation of the library manpages.
(David Allsopp, review by Florian Angeletti and Gabriel Scherer)
- #8837: build manpages using ocamldoc.opt when available
cuts the manpages build time from 14s to 4s
(Gabriel Scherer, review by David Allsopp and Sébastien Hinderer,
report by David Allsopp)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
- #8947, #9134, #9302, #9311: fix/improve support for the BFD library
(Sébastien Hinderer, review by Damien Doligez and David Allsopp)
- #8951: let make's default target build the compiler
(Sébastien Hinderer, review by David Allsopp)
- #8995: allow developers to specify frequently-used configure options in
Git (ocaml.configure option) and a directory for host-specific, shareable
config.cache files (ocaml.configure-cache option). See HACKING.adoc for
further details.
(David Allsopp, review by Gabriel Scherer)
- #9136: Don't propagate Cygwin-style prefix from configure to
Makefile.config on Windows ports.
(David Allsopp, review by Sébastien Hinderer)
### Internal/compiler-libs changes:
- #8828: Added abstractions for variants, records, constructors, fields and
extension constructor types mismatch.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White and Gabriel Scherer)
- #7927, #8527: Replace long tuples into records in typeclass.ml
(Ulugbek Abdullaev, review by David Allsopp and Gabriel Scherer)
- #1963: split cmmgen into generic Cmm helpers and clambda transformations
(Vincent Laviron, review by Mark Shinwell)
- #1901: Fix lexing of character literals in comments
(Pieter Goetschalckx, review by Damien Doligez)
- #1932: Allow octal escape sequences and identifiers containing apostrophes
in ocamlyacc actions and comments.
(Pieter Goetschalckx, review by Damien Doligez)
- #2288: Move middle end code from [Asmgen] to [Clambda_middle_end] and
[Flambda_middle_end]. Run [Un_anf] from the middle end, not [Cmmgen].
(Mark Shinwell, review by Pierre Chambart)
- #8692: Remove Misc.may_map and similar
(Leo White, review by Gabriel Scherer and Thomas Refis)
- #8677: Use unsigned comparisons in amd64 and i386 emitter of Lcondbranch3.
(Greta Yorsh, review by Xavier Leroy)
- #8766: Parmatch: introduce a type for simplified pattern heads
(Gabriel Scherer and Thomas Refis, review by Stephen Dolan and
Florian Angeletti)
- #8774: New implementation of Env.make_copy_of_types
(Alain Frisch, review by Thomas Refis, Leo White and Jacques Garrigue)
- #7924: Use a variant instead of an int in Bad_variance exception
(Rian Douglas, review by Gabriel Scherer)
- #8890: in -dtimings output, show time spent in C linker clearly
(Valentin Gatien-Baron)
- #8910, #8911: minor improvements to the printing of module types
(Gabriel Scherer, review by Florian Angeletti)
- #8913: ocamltest: improve 'promote' implementation to take
skipped lines/bytes into account
(Gabriel Scherer, review by Sébastien Hinderer)
- #8908: Use an option instead of a string for module names ("_" becomes None),
and a dedicated type for functor parameters: "()" maps to "Unit" (instead of
"*").
(Thomas Refis, review by Gabriel Radanne)
- #8928: Move contains_calls and num_stack_slots from Proc to Mach.fundecl
(Greta Yorsh, review by Florian Angeletti and Vincent Laviron)
- #8959, #8960, #8968, #9023: minor refactorings in the typing of patterns:
+ refactor the {let,pat}_bound_idents* functions
+ minor bugfix in type_pat
+ refactor the generic pattern-traversal functions
in Typecore and Typedtree
+ restrict the use of Need_backtrack
(Gabriel Scherer and Florian Angeletti,
review by Thomas Refis and Gabriel Scherer)
- #9030: clarify and document the parameter space of type_pat
(Gabriel Scherer and Florian Angeletti and Jacques Garrigue,
review by Florian Angeletti and Thomas Refis)
- #8975: "ocamltests" files are no longer required or used by
"ocamltest". Instead, any text file in the testsuite directory containing a
valid "TEST" block will be automatically included in the testsuite.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Sébastien Hinderer)
- #8992: share argument implementations between executables
(Florian Angeletti, review by Gabriel Scherer)
- #9015: fix fatal error in pprint_ast (#8789)
(Damien Doligez, review by ...)
### Bug fixes:
- #5673, #7636: unused type variable causes generalization error
(Jacques Garrigue and Leo White, review by Leo White,
reports by Jean-Louis Giavitto and Christophe Raffalli)
- #6922, #8955: Fix regression with -principal type inference for inherited
methods, allowing to compile ocamldoc with -principal
(Jacques Garrigue, review by Leo White)
- #7925, #8611: fix error highlighting for exceptionally
long toplevel phrases
(Kyle Miller, reported by Armaël Guéneau, review by Armaël Guéneau
and Nicolás Ojeda Bär)
- #8622: Don't generate #! headers over 127 characters.
(David Allsopp, review by Xavier Leroy and Stephen Dolan)
- #8715: minor bugfixes in CamlinternalFormat; removes the unused
and misleading function CamlinternalFormat.string_of_formatting_gen
(Gabriel Scherer and Florian Angeletti,
review by Florian Angeletti and Gabriel Radanne)
- #8792, #9018: Possible (latent) bug in Ctype.normalize_type
removed incrimined Btype.log_type, replaced by Btype.set_type
(Jacques Garrigue, report by Alain Frisch, review by Thomas Refis)
- #8856, #8860: avoid stackoverflow when printing cyclic type expressions
in some error submessages.
(Florian Angeletti, report by Mekhrubon Turaev, review by Leo White)
- #8875: fix missing newlines in the output from MSVC invocation.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #8921, #8924: Fix stack overflow with Flambda
(Vincent Laviron, review by Pierre Chambart and Leo White,
report by Aleksandr Kuzmenko)
- #8892, #8895: fix the definition of Is_young when CAML_INTERNALS is not
defined.
(David Allsopp, review by Xavier Leroy)
- #8896: deprecate addr typedef in misc.h
(David Allsopp, suggestion by Xavier Leroy)
- #8981: Fix check for incompatible -c and -o options.
(Greta Yorsh, review by Damien Doligez)
- #9019, #9154: Unsound exhaustivity of GADTs from incomplete unification
Also fixes bug found by Thomas Refis in #9012
(Jacques Garrigue, report and review by Leo White, Thomas Refis)
- #9031: Unregister Windows stack overflow handler while shutting
the runtime down.
(Dmitry Bely, review by David Allsopp)
- #9051: fix unregistered local root in win32unix/select.c (could result in
`select` returning file_descr-like values which weren't in the original sets)
and correct initialisation of some blocks allocated with caml_alloc_small.
(David Allsopp, review by Xavier Leroy)
- #9073, #9120: fix incorrect GC ratio multiplier when allocating custom blocks
with caml_alloc_custom_mem in runtime/custom.c
(Markus Mottl, review by Gabriel Scherer and Damien Doligez)
- #9209, #9212: fix a development-version regression caused by #2288
(Kate Deplaix and David Allsopp, review by Sébastien Hinderer
and Gabriel Scherer )
- #9218, #9269: avoid a rare wrong module name error with "-annot" and
inline records.
(Florian Angeletti, review by Gabriel Scherer, report by Kate Deplaix)
- #9261: Fix a soundness bug in Rec_check, new in 4.10 (from #8908)
(Vincent Laviron, review by Jeremy Yallop and Gabriel Scherer)
OCaml 4.09 maintenance branch:
------------------------------
### Build system:
- #9383: Don't assume that AWKPATH includes .
(David Allsopp, report by Ian Zimmerman)
OCaml 4.09.1 (16 Mars 2020):
----------------------------
- #8855, #8858: Links for tools not created when installing with
--disable-installing-byecode-programs (e.g. ocamldep.opt installed, but
ocamldep link not created)
(David Allsopp, report by Thomas Leonard)
- #8953, #8954: Fix error submessages in the toplevel: do not display
dummy locations
(Armaël Guéneau, review by Gabriel Scherer)
- #8965, #8979: Alpine build failure caused by check-parser-uptodate-or-warn.sh
(Gabriel Scherer and David Allsopp, report by Anton Kochkov)
- #8985, #8986: fix generation of the primitives when the locale collation is
incompatible with C.
(David Allsopp, review by Nicolás Ojeda Bär, report by Sebastian Rasmussen)
- #9050, #9076: install missing compilerlibs/ocamlmiddleend archives
(Gabriel Scherer, review by Florian Angeletti, report by Olaf Hering)
- #9180: pass -fno-common option to C compiler when available,
so as to detect problematic multiple definitions of global variables
in the C runtime
(Xavier Leroy, review by Mark Shinwell)
- #9144, #9180: multiple definitions of global variables in the C runtime,
causing problems with GCC 10.0 and possibly with other C compilers
(Xavier Leroy, report by Jürgen Reuter, review by Mark Shinwell)
- #9128: Fix a bug in bytecode mode which could lead to a segmentation
fault. The bug was caused by the fact that the atom table shared a
page with some bytecode. The fix makes sure both the atom table and
the minor heap have their own pages.
(Jacques-Henri Jourdan, review by Stephen Dolan, Xavier Leroy and
Gabriel Scherer)
OCaml 4.09.0 (19 September 2019):
---------------------------------
### Runtime system:
* #1725, #2279: Deprecate Obj.set_tag and Obj.truncate
(Stephen Dolan, review by Gabriel Scherer, Damien Doligez and Xavier Leroy)
* #2240: Constify "identifier" in struct custom_operations
(Cedric Cellier, review by Xavier Leroy)
* #2293: Constify "caml_named_value"
(Stephen Dolan, review by Xavier Leroy)
- #8787, #8788: avoid integer overflow in caml_output_value_to_bytes
(Jeremy Yallop, report by Marcello Seri)
- #2075, #7729: rename _T macro used to support Unicode in the (Windows) runtime
in order to avoid compiler warning
(Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
- #2250: Remove extra integer sign-extension in compare functions
(Stefan Muenzel, review by Xavier Leroy)
- #8607: Remove obsolete macros for pre-2002 MSVC support
(Stephen Dolan, review by Nicolás Ojeda Bär and David Allsopp)
- #8656: Fix a bug in [caml_modify_generational_global_root]
(Jacques-Henri Jourdan, review by Gabriel Scherer)
### Standard library:
- #2262: take precision (.<n>) and flags ('+' and ' ') into account
in printf %F
(Pierre Roux, review by Gabriel Scherer)
- #6148, #8596: optimize some buffer operations
(Damien Doligez, reports by John Whitington and Alain Frisch,
review by Jeremy Yallop and Gabriel Scherer)
### Other libraries:
* #2318: Delete the graphics library. This library is now available
as a separate "graphics" package in opam. Its new home is:
https://github.com/ocaml/graphics
(Jérémie Dimino, review by Nicolas Ojeda Bar, Xavier Leroy and
Sébastien Hinderer)
* #2289: Delete the vmthreads library. This library was deprecated in 4.08.0.
(Jérémie Dimino)
- #2112: Fix Thread.yield unfairness with busy threads yielding to each
other.
(Andrew Hunter, review by Jacques-Henri Jourdan, Spiros Eliopoulos, Stephen
Weeks, & Mark Shinwell)
- #7903, #2306: Make Thread.delay interruptible by signals again
(Xavier Leroy, review by Jacques-Henri Jourdan and Edwin Török)
- #2248: Unix alloc_sockaddr: Fix read of uninitialized memory for an
unbound Unix socket. Add support for receiving abstract (Linux) socket paths.
(Tim Cuthbertson, review by Sébastien Hinderer and Jérémie Dimino)
### Compiler user-interface and warnings:
* #2276: Remove support for compiler plugins and hooks (also adds
[Dynlink.unsafe_get_global_value])
(Mark Shinwell, Xavier Clerc, review by Nicolás Ojeda Bär,
Florian Angeletti, David Allsopp and Xavier Leroy)
- #2301: Hint on type error on int literal
(Jules Aguillon, review by Nicolás Ojeda Bär , Florian Angeletti,
Gabriel Scherer and Armaël Guéneau)
* #2314: Remove support for gprof profiling.
(Mark Shinwell, review by Xavier Clerc and Stephen Dolan)
- #2190: fix pretty printing (using Pprintast) of "lazy ..." patterns and
"fun (type t) -> ..." expressions.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #2277: Use newtype names as type variable names
The inferred type of (fun (type t) (x : t) -> x)
is now printed as ('t -> 't) rather than ('a -> 'a).
(Matthew Ryan)
- #2309: New options -with-runtime and -without-runtime in ocamlopt/ocamlc
that control the inclusion of the runtime system in the generated program.
(Lucas Pluvinage, review by Daniel Bünzli, Damien Doligez, David Allsopp
and Florian Angeletti)
- #3819, #8546 more explanations and tests for illegal permutation
(Florian Angeletti, review by Gabriel Scherer)
- #8537: fix the -runtime-variant option for bytecode
(Damien Doligez, review by David Allsopp)
- #8541: Correctly print multi-lines locations
(Louis Roché, review by Gabriel Scherer)
- #8579: Better error message for private constructors
of an extensible variant type
(Guillaume Bury, review by many fine eyes)
### Code generation and optimizations:
- #2278: Remove native code generation support for 32-bit Intel macOS,
iOS and other Darwin targets.
(Mark Shinwell, review by Nicolas Ojeda Bar and Xavier Leroy)
- #8547: Optimize matches that are an affine function of the input.
(Stefan Muenzel, review by Alain Frisch, Gabriel Scherer)
- #1904, #7931: Add FreeBSD/aarch64 support
(Greg V, review by Sébastien Hinderer, Stephen Dolan, Damien Doligez
and Xavier Leroy)
- #8507: Shorten symbol names of anonymous functions in Flambda mode
(the directory portions are now hidden)
(Mark Shinwell, review by Nicolás Ojeda Bär)
- #8681, #8699, #8712: Fix code generation with nested let rec of functions.
(Stephen Dolan, Leo White, Gabriel Scherer and Pierre Chambart,
review by Gabriel Scherer, reports by Alexey Solovyev and Jonathan French)
### Manual and documentation:
- #7584, #8538: Document .cmt* files in the "overview" of ocaml{c,opt}
(Oxana Kostikova, rewiew by Florian Angeletti)
- #8757: Rename Pervasives to Stdlib in core library documentation.
(Ian Zimmerman, review by David Allsopp)
- #8515: manual, precise constraints on reexported types
(Florian Angeletti, review by Gabriel Scherer)
### Tools:
- #2221: ocamldep will now correctly allow a .ml file in an include directory
that appears first in the search order to shadow a .mli appearing in a later
include directory.
(Nicolás Ojeda Bär, review by Florian Angeletti)
### Internal/compiler-libs changes:
- #1579: Add a separate types for clambda primitives
(Pierre Chambart, review by Vincent Laviron and Mark Shinwell)
- #1965: remove loop constructors in Cmm and Mach
(Vincent Laviron)
- #1973: fix compilation of catches with multiple handlers
(Vincent Laviron)
- #2228, #8545: refactoring the handling of .cmi files
by moving the logic from Env to a new module Persistent_env
(Gabriel Scherer, review by Jérémie Dimino and Thomas Refis)
- #2229: Env: remove prefix_idents cache
(Thomas Refis, review by Frédéric Bour and Gabriel Scherer)
- #2237, #8582: Reorder linearisation of Trywith to avoid a call instruction
(Vincent Laviron and Greta Yorsh, additional review by Mark Shinwell;
fix in #8582 by Mark Shinwell, Xavier Leroy and Anil Madhavapeddy)
- #2265: Add bytecomp/opcodes.mli
(Mark Shinwell, review by Nicolas Ojeda Bar)
- #2268: Improve packing mechanism used for building compilerlibs modules
into the Dynlink libraries
(Mark Shinwell, Stephen Dolan, review by David Allsopp)
- #2280: Don't make more Clambda constants after starting Cmmgen
(Mark Shinwell, review by Vincent Laviron)
- #2281: Move some middle-end files around
(Mark Shinwell, review by Pierre Chambart and Vincent Laviron)
- #2283: Add [is_prefix] and [find_and_chop_longest_common_prefix] to
[Misc.Stdlib.List]
(Mark Shinwell, review by Alain Frisch and Stephen Dolan)
- #2284: Add various utility functions to [Misc] and remove functions
from [Misc.Stdlib.Option] that are now in [Stdlib.Option]
(Mark Shinwell, review by Thomas Refis)
- #2286: Functorise [Consistbl]
(Mark Shinwell, review by Gabriel Radanne)
- #2291: Add [Compute_ranges] pass
(Mark Shinwell, review by Vincent Laviron)
- #2292: Add [Proc.frame_required] and [Proc.prologue_required].
Move tail recursion label creation to [Linearize]. Correctly position
[Lprologue] relative to [Iname_for_debugger] operations.
(Mark Shinwell, review by Vincent Laviron)
- #2308: More debugging information on [Cmm] terms
(Mark Shinwell, review by Stephen Dolan)
- #7878, #8542: Replaced TypedtreeIter with tast_iterator
(Isaac "Izzy" Avram, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #8598: Replace "not is_nonexpansive" by "maybe_expansive".
(Thomas Refis, review by David Allsopp, Florian Angeletti, Gabriel Radanne,
Gabriel Scherer and Xavier Leroy)
### Compiler distribution build system:
- #2267: merge generation of header programs, also fixing parallel build on
Cygwin.
(David Allsopp, review by Sébastien Hinderer)
- #8514: Use boot/ocamlc.opt for building, if available.
(Stephen Dolan, review by Gabriel Scherer)
### Bug fixes:
- #8864, #8865: Fix native compilation of left shift by (word_size - 1)
(Vincent Laviron, report by Murilo Giacometti Rocha, review by Xavier Leroy)
- #2296: Fix parsing of hexadecimal floats with underscores in the exponent.
(Hugo Heuzard and Xavier Leroy, review by Gabriel Scherer)
- #8800: Fix soundness bug in extension constructor inclusion
(Leo White, review by Jacques Garrigue)
- #8848: Fix x86 stack probe CFI information in caml_c_call and
caml_call_gc
(Tom Kelly, review by Xavier Leroy)
- #7156, #8594: make top level use custom printers if they are available
(Andrew Litteken, report by Martin Jambon, review by Nicolás Ojeda Bär,
Thomas Refis, Armaël Guéneau, Gabriel Scherer, David Allsopp)
- #3249: ocamlmklib should reject .cmxa files
(Xavier Leroy)
- #7937, #2287: fix uncaught Unify exception when looking for type
declaration
(Florian Angeletti, review by Jacques Garrigue)
- #8610, #8613: toplevel printing, consistent deduplicated name for types
(Florian Angeletti, review by Thomas Refis and Gabriel Scherer,
reported by Xavier Clerc)
- #8635, #8636: Fix a bad side-effect of the -allow-approx option of
ocamldep. It used to turn some errors into successes
(Jérémie Dimino)
- #8701, #8725: Variance of constrained parameters causes principality issues
(Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
- #8777(partial): fix position information in some polymorphic variant
error messages about missing tags
(Florian Angeletti, review by Thomas Refis)
- #8779, more cautious variance computation to avoid missing cmis
(Florian Angeletti, report by Antonio Nuno Monteiro, review by Leo White)
- #8810: Env.lookup_module: don't allow creating loops
(Thomas Refis, report by Leo White, review by Jacques Garrigue)
- #8862, #8871: subst: preserve scopes
(Thomas Refis, report by Leo White, review by Jacques Garrigue)
- #8921, #8924: Fix stack overflow with Flambda
(Vincent Laviron, review by Pierre Chambart and Leo White,
report by Aleksandr Kuzmenko)
- #8944: Fix "open struct .. end" on clambda backend
(Thomas Refis, review by Leo White, report by Damon Wang and Mark Shinwell)
OCaml 4.08.1 (5 August 2019)
----------------------------
### Bug fixes:
- #7887: ensure frame table is 8-aligned on ARM64 and PPC64
(Xavier Leroy, report by Mark Hayden, review by Mark Shinwell
and Gabriel Scherer)
- #8751: fix bug that could result in misaligned data section when compiling to
native-code on amd64. (observed with the mingw64 compiler)
(Nicolás Ojeda Bär, review by David Allsopp)
- #8769, #8770: Fix assertion failure with -pack
(Leo White, review by Gabriel Scherer, report by Fabian @copy)
- #8816, #8818: fix loading of packed modules with Dynlink (regression in
#2176).
(Leo White, report by Andre Maroneze, review by Gabriel Scherer)
- #8830: configure script: fix tool prefix detection and Debian's armhf
detection
(Stéphane Glondu, review by David Allsopp)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
OCaml 4.08.0 (13 June 2019)
---------------------------
### Language features:
- #1947: Introduce binding operators (let*, let+, and* etc.)
(Leo White, review by Thomas Refis)
- #1892: Allow shadowing of items coming from an include
(Thomas Refis, review by Gabriel Radanne)
- #2122: Introduce local substitutions in signatures: "type t := type_expr"
and "module M := Extended(Module).Path"
(Thomas Refis, with help and review from Leo White, and Alain Frisch)
- #1804: New notion of "alerts" that generalizes the deprecated warning
[@@ocaml.alert deprecated "Please use bar instead!"]
[@@ocaml.alert unsafe "Please use safe_foo instead!"]
(Alain Frisch, review by Leo White and Damien Doligez)
- #6422, #7083, #305, #1568: Allow `exception` under or-patterns
(Thomas Refis, with help and review from Alain Frisch, Gabriel Scherer, Jeremy
Yallop, Leo White and Luc Maranget)
- #1705: Allow @@attributes on exception declarations.
(Hugo Heuzard, review by Gabriel Radanne and Thomas Refis)
- #1506, #2147, #2166, #2167: Extended `open` to arbitrary module
expression in structures and to applicative paths in signatures
(Runhang Li, review by Alain Frisch, Florian Angeletti, Jeremy Yallop,
Leo White and Thomas Refis)
* #2106: .~ is now a reserved keyword, and is no longer available
for use in extended indexing operators
(Jeremy Yallop, review by Gabriel Scherer, Florian Angeletti, and
Damien Doligez)
* #7841, #2041, #2235: allow modules from include directories
to shadow other ones, even in the toplevel; for a example, including
a directory that defines its own Result module will shadow the stdlib's.
(Jérémie Dimino, review by Alain Frisch and David Allsopp)
### Type system:
- #2110: Partial support for GADTs inside or-patterns;
The type equalities introduced by the GADT constructor are only
available inside the or-pattern; they cannot be used in the
right-hand-side of the clause, when both sides of the or-pattern
agree on it.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1826: allow expanding a type to a private abbreviation instead of
abstracting when removing references to an identifier.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1942, #2244: simplification of the static check
for recursive definitions
(Alban Reynaud and Gabriel Scherer,
review by Jeremy Yallop, Armaël Guéneau and Damien Doligez)
### Standard library:
- #2128: Add Fun module: `id, const, flip, negate, protect`
(protect is a "try_finally" combinator)
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Fun.html
(Many fine eyes)
- #2010: Add Bool module
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Bool.html
(Many fine eyes)
- #2011: Add Int module
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Int.html
(Many fine eyes)
- #1940: Add Option module and Format.pp_print_option
`none, some, value, get, bind, join, map, fold, iter`, etc.
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Option.html
(Many fine eyes)
- #1956: Add Result module and Format.pp_print_result
`ok, error, value, get_ok, bind, join, map, map_error`, etc.
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Result.html
(Many fine eyes)
- #1855, #2118: Add `Fun.protect ~finally` for enforcing local
invariants whether a function raises or not, similar to
`unwind-protect` in Lisp and `FINALLY` in Modula-2. It is careful
about preserving backtraces and treating exceptions in finally as
errors.
(Marcello Seri and Guillaume Munch-Maccagnoni, review by Daniel
Bünzli, Gabriel Scherer, François Bobot, Nicolás Ojeda Bär, Xavier
Clerc, Boris Yakobowski, Damien Doligez, and Xavier Leroy)