forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChanges
13866 lines (10829 loc) · 563 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
Working version
---------------
### Restored backends:
- #12276: native-code compilation for POWER (64 bits, little-endian)
(Xavier Leroy, review by KC Sivaramakrishnan and Anil Madhavapeddy)
### Language features:
- #12295: Give `while true' a polymorphic type, similarly to `assert false'
(Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer,
suggestion by Rodolphe Lepigre and John Whitington)
- #12315: Use type annotations from arguments in let rec
(Stephen Dolan, review by Gabriel Scherer)
- #11252, RFC 27: Support raw identifier syntax \#foo
(Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole)
- #12044: Add local module open syntax for types.
```
module A = struct
type t = int
type r = unit
type s = string
end
type example = A.(t * r * s)
```
(Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär
and Florian Angeletti)
- #12456: Document the incompatibility between effects on the one
hand, and `caml_callback` and asynchronous callbacks (signal
handlers, finalisers, memprof callbacks...) on the other hand.
(Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan)
### Type system:
- #12313, #11799: Do not re-build as-pattern type when a ground type annotation
is given. This allows to work around problems with GADTs in as-patterns.
(Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
### Runtime system:
- #10111: Increase the detail of location information for debugging events to
allow the end line number and character offset to be reported.
(David Allsopp, review by Nick Barnes, Enguerrand Decorne and Stephen Dolan)
- #10403, #12202: introduce `caml_ext_table_add_noexc` that does not
raise `Out_of_memory` exceptions and use it inside the blocking sections
of `caml_read_directory`. Also, check for overflows in ext table sizes.
(Xavier Leroy, report by Arseniy Alekseyev, review by Gabriel Scherer)
- #12223: Constify constructors and flags tables in C code. Now these
tables will go in the readonly segment, where they belong.
(Antonin Décimo, review by Gabriel Scherer and Xavier Leroy)
- #12234: make instrumented time calculation more thread-safe on macOS.
(Anil Madhavapeddy, review by Daniel Bünzli and Xavier Leroy)
- #12235: introduce and use the `CAMLnoret` macro as a lighter alternative
to `CAMLnoreturn_start` / `CAMLnoreturn_end`
(Xavier Leroy, with help from Antonin Décimo, review by
Gabriel Scherer and David Allsopp)
- #12275: caml/stack.h: more abstract macros to describe OCaml stacks and
how to traverse them, supporting more stack layouts.
(Xavier Leroy, review by KC Sivaramakrishnan and Fabrice Buoro)
- #12268: deliver `Out_of_memory` exception if domain creation fails
due to memory resource exhaustion. It was previous always a `Failure`.
(Anil Madhavapeddy, review by David Allsopp)
- #12300, #12314: Discard out_channel buffered data on permanent I/O error
(Xavier Leroy, report by Török Edwin, review by Anil Madhavapeddy
and Nicolás Ojeda Bär)
- #11386: Simplifications and fixes to multicore systhreads implementation.
(Guillaume Munch-Maccagnoni, review by Anil Madhavapeddy and KC
Sivaramakrishnan)
- #12408: `Domain.spawn` no longer leaks its functional argument for
the whole duration of the children domain lifetime.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
- #12409: Fix unsafety and deadlocks should an asynchronous exception
arise at specific locations during domain creation and shutdown.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
- #12114: Add ThreadSanitizer support
(Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo,
review by Damien Doligez, Sebastien Hinderer, Jacques-Henri Jourdan, Luc
Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer)
- #11911, #12381: Restore statmemprof functionality in part
(API changes in Gc.Memprof). (Nick Barnes)
### Code generation and optimizations:
- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8.
This reduces stack usage. It's only C stacks that require 16-alignment.
(Xavier Leroy, review by Gabriel Scherer and Stephen Dolan)
- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays)
were not correctly rounded sometimes.
(Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist)
### Standard library:
* #10775: Half-precision floating-point elements in Bigarray.
(Anton Yabchinskiy, review by Xavier Leroy and Nicolás Ojeda Bär)
- #12217: Add `Array.shuffle`.
(Daniel Bünzli, review by Nicolás Ojeda Bär, David Allsopp and Alain Frisch)
- #12212: Add cache-aligned constructor for atomics. The patch ensures that
all allocations (of the right size) in the shared heap are aligned.
(Bartosz Modelski with Gabriel Scherer, Guillaume Munch-Maccagnoni,
Xavier Leroy, review by Alain Frisch, Anil Madhavapeddy, Gabriel Scherer,
Guillaume Munch-Maccagnoni, KC Sivaramakrishnan, Stefan Muenzel,
Xavier Leroy)
### Other libraries:
- #12213: Dynlink library, improve legibility of error messages
(Samuel Hym, review by Gabriel Scherer and Nicolás Ojeda Bär)
### Tools:
- #12340: testsuite: collect known issues with current -short-paths
implementation for existential types
(Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis)
- #12147: ocamllex: Allow carriage returns at the end of line directives.
(SeungCheol Jung, review by Nicolás Ojeda Bär)
- #12260: Fix invalid_argument on some external or module aliases in ocamlnat
(Fabian Hemmer, review by Vincent Laviron)
- #12185: New script language for ocamltest.
(Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer,
review by Sébastien Hinderer and Gabriel Scherer)
- #12371: ocamltest: fix recursive expansion of variables.
(Antonin Décimo, Damien Doligez, review by Sébastien Hinderer,
Damien Doligez, Gabriel Scherer, and Xavier Leroy)
### Manual and documentation:
- #12338: clarification of the documentation of process related function in
the unix module regarding the first element of args and shell's pid.
(Christophe Raffalli, review by Florian Angeletti)
- #12352: Fix a typo in the documentation of Arg.write_arg
(Christophe Raffalli, review by Florian Angeletti)
### Compiler user-interface and warnings:
- #12247: configure: --disable-ocamldebug can now be used instead
of --disable-debugger (which remains available for compatibility)
(Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer)
- #12210: uniform style for inline code in compiler messages
(Florian Angeletti, review by Gabriel Scherer)
* #12278, #:12325: Remove the OCAML_FLEXLINK environment variable from the
compiler drivers. This environment variable was previously used as part of the
FlexDLL bootstrap procedure and existed solely for that purpose. Its removal
greatly simplifies both the build system and testsuite machinery.
(David Allsopp, review by Sébastien Hinderer)
- #12347: error messages: always report missing polyvariant tags
(Florian Angeletti, report by Tianbo Hao, review by Gabriel Scherer)
- #12224, specialized error message when trying to apply non-functor
module (e.g `module M = Int(Int)`)
(Florian Angeletti, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #12216, #12248: Prevent reordering of atomic loads during instruction
scheduling. This is for reference, as instruction scheduling is currently
unused in OCaml 5.
(Xavier Leroy, report by Luc Maranget and KC Sivaramakrishnan,
review by Nicolás Ojeda Bär)
- #12025: Split Typecore.unify_pat_types into two
to avoid unnecessary references to the environment in type_pat
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #12031: Use dedicated types to represent names of compilation units
and predefined exceptions in CMO files.
(Sébastien Hinderer, review by Florian Angeletti, Thomas Refis,
Gabriel Scherer, Vincent Laviron, Pierre Chambart, Luke Maurer,
Hugo Heuzard, Xavier Leroy and Damien Doligez)
- #12109: Pack parameters to unification in unification_environment
(Takafumi Saikawa and Jacques Garrigue, review by Richard Eisenberg)
- #12331, #12361: Pack the unification data for pattern checking in Typecore
(Takafumi Saikawa and Jacques Garrigue,
review by Gabriel Scherer, Thomas Refis and Florian Angeletti)
- #12229: Remove global mutable state for typechecking patterns
in Typecore in favor of local mutable state.
(Nick Roberts, review by Takafumi Saikawa)
- #12236, #12386, #12391: Use syntax as the sole determiner of function arity
This changes function arity to be based solely on the source program's
parsetree. Previously, the heuristic for arity had more subtle heuristics
that involved type information about patterns. Function arity is important
because it determines when a pattern match's effects run and is an input
into the fast path for function application.
This change affects tooling: it changes the function constructs in parsetree
and typedtree.
See https://github.com/ocaml/RFCs/pull/32 for the original RFC.
(Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer;
RFC by Stephen Dolan)
- #12442: document jump summaries in the pattern-matching compiler
(Gabriel Scherer and Thomas Refis, review by Florian Angeletti
and Vincent Laviron)
### Build system:
- #12198: continue the merge of the sub-makefiles into the root Makefile
started with #11243, #11248, #11268, #11420 and #11675.
(Sébastien Hinderer, review by David Allsopp and Florian Angeletti)
### Bug fixes:
- #11931: Fix tricky typing bug with type substitutions
(Stephen Dolan, review by Leo White and Jacques Garrigue)
- #12037: get_extern_state potential NULL dereference.
(Alexander Skvortsov, report by Török Edwin,
design by Gabriel Scherer, Xavier Leroy)
- #12032, #12059: Bug fixes related to compilation of recursive definitions
(Vincent Laviron, report by Victoire Noizet, review by Gabriel Scherer)
* #12145: Loopy constraints cause ocamlc to loop.
Fixed by completely removing the call to `update_type` in
`Typedecl.transl_type_decl`, as the expansion is already checked by
`check_regularity`. As a result, recursion is more polymorphic,
which may cause some (essentialy wrong) type declarations to have
unbound type variables, and some constraints unrelated to the concrete
type to be ignored (see tests/typing-misc/constraints.ml).
(Jacques Garrigue, report by Richard Eisenberg, review by Leo White)
- #12207, #12222: Make closure computation linear in the number of recursive
functions instead of quadratic
(Vincent Laviron, report by François Pottier, review by Nathanaëlle Courant
and Gabriel Scherer)
- #12334, #12368: Bad error message with mutually recursive abbreviations
(Jacques Garrigue, report by Richard Eisenberg, review by Gabriel Scherer
and Richard Eisenberg)
- #12401: `seek_in` and `seek_out` sometimes returned normally when given
negative offsets, instead of failing. Now both functions should consistently
raise `Sys_error` in this case.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #12267: Fix stack alignment computation
(Miod Vallat, report by Jan Midtgaard, review by Gabriel Scherer)
OCaml 5.1.0 release branch
--------------------------
### Restored backends
- #11418, #11708: RISC-V multicore support.
(Nicolás Ojeda Bär, review by KC Sivaramakrishnan)
- #11712, #12258, #12261: s390x / IBM Z multicore support:
OCaml & C stack separation; dynamic stack size checks; fiber and
effects support.
(Aleksei Nikiforov, with help from Vincent Laviron and Xavier Leroy,
additional suggestions by Luc Maranget,
review by the same and KC Sivaramakrishnan)
- #11642: Restore Cygwin port. Add GC messages for address space reservations
when OCAMLRUNPARAM option v includes 0x1000.
(David Allsopp, review by Xavier Leroy, Guillaume Munch-Maccagnoni
and Gabriel Scherer)
### Standard library:
- #12006, #12064: Add `Marshal.Compression` flag to `Marshal.to_*` functions.
When this flag is explicitly set, marshaled data is compressed using ZSTD.
On some practical examples, the marshalled output became three times smaller
at no noticeable cost on the marshalling time.
(Xavier Leroy, review by Edwin Török and Gabriel Scherer, fix by Damien
Doligez)
- #11848: Add `List.find_mapi`,
`List.find_index: ('a -> bool) -> 'a list -> int option`,
`Seq.find_mapi`, `Seq.find_index`, `Array.find_mapi`, `Array.find_index`,
`Float.Array.find_opt`, `Float.Array.find_index`, `Float.Array.find_map`,
`Float.Array.find_mapi`.
(Sima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär)
- #11410: Add Set.to_list, Map.to_list, Map.of_list,
`Map.add_to_list: key -> 'a -> 'a list t -> 'a list t`.
(Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #11836, #11837: Add `Array.map_inplace`, `Array.mapi_inplace`,
`Float.Array.mapi_inplace` and `Float.Array.mapi_inplace`.
(Léo Andrès, review by Gabriel Scherer, KC Sivaramakrishnan and
Nicolás Ojeda Bär)
- #10967: Add Filename.temp_dir.
(David Turner, review by Anil Madhavapeddy, Valentin Gatien-Baron, Nicolás
Ojeda Bär, Gabriel Scherer, and Daniel Bünzli)
- #11246: Add "hash" and "seeded_hash" functions to Bool, Int, Char, Float,
Int32, Int64, and Nativeint.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)
- #11488: Add `Mutex.protect: Mutex.t -> (unit -> 'a) -> 'a`
for resource-safe critical sections protected by a mutex.
(Simon Cruanes, review by Gabriel Scherer, Xavier Leroy,
Guillaume Munch-Maccagnoni)
- #11581: Add type equality witness
`type (_, _) eq = Equal: ('a, 'a) eq`
in a new module Stdlib.Type.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Jacques Garrigue, Florian
Angeletti, Alain Frisch, Gabriel Scherer, Jeremy Yallop and Xavier Leroy)
- #11843: Add `In_channel.input_lines` and `In_channel.fold_lines`.
(Xavier Leroy, review by Nicolás Ojeda Bär and Wiktor Kuchta).
- #11856, #11859: Using TRMC, the following `Stdlib` functions are now
tail-recursive:
Stdlib.(@), List.append,
List.concat_map.
(Jeremy Yallop, review by Daniel Bünzli, Anil Madhavapeddy, Nicolás Ojeda Bär,
Gabriel Scherer, and Bannerets)
- #11362, #11402: Using TRMC, the following `Stdlib` functions are now
tail-recursive:
List.map, List.mapi, List.map2,
List.filter, List.filteri, List.filter_map,
List.init,
List.of_seq.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)
- #11878, #11965: Prevent seek_in from marking buffer data as valid after
closing the channel. This could lead to inputting uninitialized bytes.
(Samuel Hym, review by Xavier Leroy and Olivier Nicole)
- #11128: Add In_channel.isatty, Out_channel.isatty.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Florian Angeletti)
- #10859: Add `Format.pp_print_iter` and `Format.pp_print_array`.
(Léo Andrès and Daniel Bünzli, review by David Allsopp and Hugo Heuzard)
- #10789: Add `Stack.drop`
(Léo Andrès, review by Gabriel Scherer)
* #10899: Change Stdlib.nan from signaling NaN to quiet NaN.
(Greta Yorsh, review by Xavier Leroy, Guillaume Melquiond and
Gabriel Scherer)
- #11026, #11667, #11858: Rename the type of the accumulator
of fold functions to 'acc:
fold_left : ('acc -> 'a -> 'acc) -> 'acc -> 'a list -> 'acc
fold_right : ('a -> 'acc -> 'acc) -> 'a list -> 'acc -> 'acc
fold_left_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a list -> 'acc * 'b list
...
(Valentin Gatien-Baron and Francois Berenger,
review by Gabriel Scherer and Nicolás Ojeda Bär)
- #11354: Hashtbl.find_all is now tail-recursive.
(Fermín Reig, review by Gabriel Scherer)
- #11500: Make Hashtbl.mem non-allocating.
(Simmo Saan, review by Nicolás Ojeda Bär)
- #11412: Add Sys.is_regular_file
(Xavier Leroy, review by Anil Madhavapeddy, Nicolás Ojeda Bär, David Allsopp)
- #11322, #11329: serialization functions Random.State.{of,to}_binary_string
between Random.State.t and string
(Gabriel Scherer, report by Yotam Barnoy,
review by Daniel Bünzli, Damien Doligez, Hugo Heuzard and Xavier Leroy)
- #11830: Add Type.Id with
`val provably_equal : 'a Type.Id.t -> 'b Type.Id.t -> ('a, 'b) Type.eq option`
(Daniel Bünzli, review by Jeremy Yallop, Gabriel Scherer, Wiktor Kuchta,
Nicolás Ojeda Bär)
- #12184, #12320: Sys.rename Windows fixes on directory corner cases.
(Jan Midtgaard, review by Anil Madhavapeddy)
* #11565: Enable -strict-formats by default. Some incorrect format
specifications (for `printf`) where silently ignored and now fail.
Those new failures occur at compile-time, except if you use advanced
format features like `%(...%)` that parse format strings dynamically.
Pass -no-strict-formats to revert to the previous lenient behavior.
(Nicolás Ojeda Bär, review by David Allsopp)
### Installation size
Specific efforts have been made during this release to reduce the filesystem
size of installed artifacts of the compiler distribution.
The installation size of 5.1 is 272 MiB compared to 521 MiB for 5.0.
Some of those changes will benefit all OCaml packages.
- ocaml/RFCs#23, #12006: use compressed marshaled format from #12006 for .cmi,
.cmt, .cmti files, and for debug info in .cmo and .cma files, resulting in
major reduction in size.
(Xavier Leroy, review by Edwin Török and Gabriel Scherer,
RFC by Simon Cruanes)
- #11981: Reduce size of OCaml installations by removing debugging information
from installed bytecode executables. It is no longer possible to
run ocamldebug over these installed bytecode executables, nor to get
exception backtraces for them.
(Xavier Leroy, review by David Allsopp, report by Fabrice Le Fessant)
* #11993: install only bytecode executables for the `ocamlmklib`, `ocamlcmt`,
`ocamlprof`, `ocamlcp`, `ocamloptp`, and `ocamlmktop` tools, but no
native-code executables. A tool like `ocamlmklib` for example is now
installed directly to `$BINDIR/ocamlmklib`; `ocamlmklib.byte` and
`ocamlmklib.opt` are no longer installed to `$BINDIR`.
(Xavier Leroy, review by Gabriel Scherer)
### Runtime system:
- #11589, #11903: Modify the GC pacing code to make sure the GC keeps
up with allocations in the presence of idle domains.
(Damien Doligez and Stephen Dolan, report by Florian Angeletti,
review by KC Sivaramakrishnan and Sadiq Jaffer)
- #11743: Speed up weak array operations
(KC Sivaramakrishnan, review by François Bobot and Sadiq Jaffer)
- #12131: Simplify implementation of weak hash sets, fixing a
performance regression. (Nick Barnes, review by François Bobot,
Alain Frisch and Damien Doligez).
- #11474, #11998, #12065: Add support for user-defined events in the runtime
event tracing system.
(Lucas Pluvinage, review by Sadiq Jaffer, Guillaume Munch-Maccagnoni,
Enguerrand Decorne, Gabriel Scherer and Anil Madhavapeddy)
- #11827, #12249: Restore prefetching for GC marking
(Fabrice Buoro and Stephen Dolan, review by Gabriel Scherer and Sadiq Jaffer)
- #11935: Load frametables of dynlink'd modules in batch
(Stephen Dolan, review by David Allsopp and Guillaume Munch-Maccagnoni)
* #11865, #11868, #11876: Clarify that the operations of a custom
block must never access the OCaml runtime. The previous
documentation only mentioned the main illicit usages. In particular,
since OCaml 5.0, it is no longer safe to call
`caml_remove_global_root` or `caml_remove_generational_global_root`
from within the C finalizer of a custom block, or within the
finalization function passed to `caml_alloc_final`. As a workaround,
such a finalization operation can be registered with `Gc.finalize`
instead, which guarantees to run the finalizer at a safe point.
(Report by Timothy Bourke, discussion by Yotam Barnoy, Timothy
Bourke, Sadiq Jaffer, Xavier Leroy, Guillaume Munch-Maccagnoni, and
Gabriel Scherer)
- #12130: Fix multicore crashes with weak hash sets. Fixes #11934.
(Nick Barnes, review by François Bobot)
- #12099: Add ocamlrund option, -events, to produce a trace of
debug events during bytecode interpretation. Fixes #12098.
(Richard L Ford, review by Gabriel Scherer)
- #12001: Fix book keeping for last finalisers during the minor cycle
(KC Sivaramakrishnan and Enguerrand Decorne, report by Guillaume Bury
and Vincent Laviron, review by Sadiq Jaffer and KC Sivaramakrishnan)
- #11919: New runtime events counters for major heap stats and minor heap
resizing.
(Sadiq Jaffer, review by Gabriel Scherer and David Allsopp)
- #11287, #11872, #11955: Clean up reserved header bits (once used for
Spacetime profiling).
(Nick Barnes, review by Gabriel Scherer and Damien Doligez)
- #11750: Decouple major slice from minor GC.
(KC Sivaramakrishnan, review by Sadiq Jaffer, Guillaume Munch-Maccagnoni and
Damien Doligez)
- #11796: protect lazy computation of code fragment digest by a mutex.
This makes the thread sanitizer happier, and avoids duplicating
the hashing work.
(Gabriel Scherer, review by Xavier Leroy, report by Olivier Nicole)
- #11137: new `Unsafe_store_tag(val, new_tag)` macro to stop using
`Tag_val(val)` as lvalue.
(Gabriel Scherer, review by Xavier Leroy, Guillaume Munch-Maccagnoni
and Nicolás Ojeda Bär)
- #11880: Restore the correct sigmask in systhreads.
(Christiano Haesbaert, review by Guillaume Munch-Maccagnoni and
Sébastien Hinderer)
- #11881: Fix thread-unsafety of registration of operations for "custom"
values.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer and KC
Sivaramakrishnan)
- #11980: fix quadratic behavior in natdynlink by using a STW section
for frame-descriptor updates.
(Gabriel Scherer, review by Sadiq Jaffer, report by André Maroneze
for Frama-C and Guillaume Melquiond for Coq)
- #12121: unrooted implementations of caml_callback*_exn
(Gabriel Scherer, review by KC Sivaramakrishnan and Xavier Leroy)
- #3921, #12039, #12128: poll for signals in long-running polymorphic
comparisons.
(B. Szilvasy, Gabriel Scherer and Xavier Leroy, review by
Stefan Muenzel, Guillaume Munch-Maccagnoni and Damien Doligez)
- #12231: Support MinGW-w64 11.0 winpthreads library, where the macro
to set up to get flexdll working changed
(David Allsopp and Samuel Hym, light review by Xavier Leroy)
### Language features:
* #11694: Add short syntax for generative functor types `() -> ...`
(Jeremy Yallop, review by Gabriel Scherer, Nicolás Ojeda Bär,
Jacques Garrigue)
* #11457: Remove old polymorphic variant syntax.
With ``type t = [ `A | `B ]``, one could use the syntax `#t` in types,
where it means the same thing as `[< t]`, and in patterns, where it means
``(`A | `B)``. The use of `#t` in types for polymorphic variants
was deprecated since 2001, and is now removed. The syntax remains available
in patterns, or for objects -- when `t` is a class type.
(Stefan Muenzel, review by Gabriel Scherer and Jacques Garrigue)
* #11984: Add dedicated syntax for generative functor application.
Previously, OCaml did not disinguish between `F ()` and
`F (struct end)`, even though the latter looks applicative. Instead,
the decision between generative and applicative functor application
was made based on the type of `F`. With this patch, we now distinguish
these two application forms; writing `F (struct end)` for a generative
functor leads to new warning 73.
(Frederic Bour and Richard Eisenberg, review by Florian Angeletti)
- #9975, #11365: Make empty types (`type t = |`) immediate.
(Antal Spector-Zabusky, review by Gabriel Scherer)
### Type system:
* #6941, #11187: prohibit using classes through recursive modules
inheriting or including a class belonging to a mutually-recursive module
would previous behave incorrectly, and now results in a clean error.
(Leo White, review by Gabriel Scherer and Florian Angeletti)
* #12189, #12211: anonymous row variables in explicitly polymorphic type
annotation, e.g. `'a. [< X of 'a ] -> 'a`, are now implicitly
universally quantified (in other words, the example above is now read
as `'a 'r. ([< X of 'a ] as 'r) -> 'a`).
(Florian Angeletti and Gabriel Scherer, review by Jacques Garrigue)
### Code generation and optimizations:
- #11967: Remove traces of Obj.truncate, which allows some mutable
loads to become immutable.
(Nick Barnes, review by Vincent Laviron and KC Sivaramakrishnan)
- #9945, #10883: Turn boolean-result float comparisons into primitive operations
Uses the architecture's elementary operations for float comparisons,
when available, rather than branching and then setting the return value.
(Stefan Muenzel, review by Stephen Dolan, Alain Frisch and Vincent Laviron)
- #8998, #11321, #11430: change mangling of OCaml long identifiers
from `camlModule__name_NNN` to `camlModule.name_NNN`. The previous
mangling schema, using `__`, was ambiguous.
(Xavier Leroy, report by sliquister and Michael Bacarella,
review by Gabriel Scherer)
- #10834: The -safer-matching option disables type-based optimizations of
pattern-matching compilation. This allows to produce a match failure if
a pattern-matching was wrongly assumed to be exhaustive. Since the
exhaustiveness check for GADTs has had bugs in the past, it may be
useful if you need extra security with GADTs.
(Jacques Garrigue, review by Gabriel Scherer)
- #11102: Speed up register allocation by permanently spilling registers
(Stephen Dolan, review by Xavier Leroy)
- #11383: Restrict the local function optimisation to forbid moving code
inside a sub-function
(Vincent Laviron, review by Gabriel Scherer)
- #11686: Better spilling heuristic for the Linear Scan allocator for more
efficient stack usage.
(Nicolás Ojeda Bär, Gabriel Scherer, Alain Frisch, review by Gabriel Scherer,
Alain Frisch and Nathanaëlle Courant)
- #11904: Remove arm, i386 native-code backends that were already
disabled at configuration time.
(Nicolás Ojeda Bär, review by Stephen Dolan, Anil Madhavapeddy, and Xavier
Leroy)
### Other libraries:
- #11374: Remove pointer cast to a type with stricter alignment requirements
in Windows implementation of Unix.gettimeofday. Windows implementations of
caml_unix_map_file, caml_unix_lseek and caml_unix_lseek_64 now release the
runtime lock. Windows implementation of caml_unix_lockf modernised and
simplified. Where possible, 64 bit integers are used instead of LARGE_INTEGER
structs.
(David Allsopp, review by Jonah Beckford and Xavier Leroy)
- #11475: Make Unix terminal interface bindings domain-safe
(Olivier Nicole and Xavier Leroy, review by Xavier Leroy)
- #11775: Unix.write on a non-blocking socket under Windows will return normally
if the write blocks after some data has already been written (as otherwise
there is no way of knowing how much data has been written before
blocking). The same behaviour was already present under Unix.
(Nicolás Ojeda Bär, review by David Allsopp)
* #11991: Unix on Windows: map ERROR_TOO_MANY_LINKS to EMLINK.
(Nicolás Ojeda Bär)
- #12067: Document Windows specific meanings of `Unix.process_status`
type
(Samuel Hym, review by David Allsopp)
- #12072: Document and test that Sys.rename works over directories too
(Jan Midtgaard, review by Anil Madhavapeddy and Xavier Leroy)
### Tools:
- #11889, #11978: ocamldoc: handle injectivity annotations and wildcards in type
parameters.
(Florian Angeletti, report by Wiktor Kuchta, review by Jules Aguillon)
- #11787: Fix GDB scripts to work with OCaml 5's heap layout. (Nick
Barnes)
- #11772: fix ocamlyacc's handling of raw string literals
(Demi Marie Obenour)
- #9290: Add a directive to switch off debugging in toplevel.
This allows to see optimized bytecode with -dlambda.
(Jacques Garrigue, review by Gabriel Scherer)
- #11166: ocamllex: the union of two character sets "cset1 | cset2" can now be
used in any context where a character set is expected.
(Nicolás Ojeda Bär, Martin Jambon, review by Sébastien Hinderer)
- #11718: ocamlyacc: OCaml-style comments are now supported, in addition to
the C-style comments already supported. The syntax is the same as that used
in OCaml code.
(Demi Marie Obenour, review by Damien Doligez)
- #11728: ocamlyacc: generate line directives for %type declarations
(Demi Marie Obenour, review by Damien Doligez)
- #11773: ocamlyacc: Do not allow quoted literals (such as 'a' or "bc")
in a token name or %type declaration. Previously such literals were
accepted by ocamlyacc, but produced malformed OCaml that was rejected
by the compiler.
(Demi Marie Obenour, review by Gabriel Scherer)
- #11774: ocamlyacc: fail if there is an I/O error
(Demi Marie Obenour, review by Gabriel Scherer)
- #11973: Add support for postfixed mingw host triplets
(Romain Beauxis)
- #12165: ocamldoc, use standard doctype to avoid quirk mode.
(Florian Angeletti, review by Gabriel Scherer)
### Manual and documentation:
- #11476: Add examples in documentation of Hashtbl, Queue, Atomic, Format
(Simon Cruanes, review by Yotam Barnoy, Gabriel Scherer, Daniel Bünzli,
Ulugbek Abdullaev, and Nicolás Ojeda Bär)
- #11883, #11884: Update documentation for In_channel and Out_channel
with examples and sections to group related functions.
(Kiran Gopinathan, review by Daniel Bünzli and Xavier Leroy)
- #12095, #12097: Put the sample code of the user's manual and reference
documentation of the standard library under the CC0 1.0 Universal
(CC0 1.0) Public Domain Dedication license.
- #11892: Document the semantic differences of Unix.exec* between Unix and
Windows.
(Boris Yakobowski, review by Daniel Bünzli, Gabriel Scherer and Nicolás Ojeda
Bär)
- #9430, #11291: Document the general desugaring rules for binding operators.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #11481: Fix the type of Unix.umask to Unix.file_perm -> Unix.file_perm
(Favonia, review by Sébastien Hinderer)
- #11676: Fix missing since annotation in the `Sys` and `Format` modules
(Github user Bukolab99, review by Florian Angeletti)
- #12028: Update format documentation to make it clearer that
`pp_print_newline` flushes its newline
(Florian Angeletti, review by Gabriel Scherer)
- #12201: in the tutorial on modules, replace priority queue example by
a simpler example based on FIFO queues.
(Xavier Leroy, review by Anil Madhavapeddy and Nicolás Ojeda Bär).
### Compiler user-interface and warnings:
- #10647: Show hints for the "undefined global" error in the toplevel
(Wiktor Kuchta, review by Gabriel Scherer)
- #12116: Don't suggest to insert a semicolon when the type is not unit
(Jules Aguillon, review by Florian Angeletti)
- #11679: Improve the error message about too many arguments to a function
(Jules Aguillon, review by Gabriel Scherer and Florian Angeletti)
- #10009: Improve the error reported by mismatched struct/sig and =/: in module
and module type bindings.
(Jules Aguillon, review by Gabriel Scherer)
- #11530: Include kinds in kind mismatch error message.
"Error: This variant or record definition does not match that of type M.t
The original is abstract, but this is a record".
(Leonhard Markert, review by Gabriel Scherer and Florian Angeletti)
- #11646: Add colors to error message hints.
(Christiana Anthony, review by Florian Angeletti)
- #11235, #11864: usage warnings for constructors and fields can now be disabled
on field-by-field or constructor-by-constructor basis
(Florian Angeletti, review by Gabriel Scherer)
- #11888: Improve the error message when type variables cannot be deduced from
the type parameters:
Before:
"Error: In this definition, a type variable cannot be deduced
from the type parameters."
After:
"Error: In the GADT constructor
T : 'a -> 'a s t
the type variable 'a cannot be deduced from the type parameters."
(Stefan Muenzel, review by Florian Angeletti and Gabriel Scherer)
- #10818: Preserve integer literal formatting in type hint.
(Leonhard Markert, review by Gabriel Scherer and Florian Angeletti)
- #11338: Turn some partial application warnings into hints.
(Leo White, review by Stephen Dolan)
- #10931: Improve warning 14 (illegal backslash) with a better explanation
of the causes and how to fix it.
(David Allsopp, Florian Angeletti, Lucas De Angelis, Gabriel Scherer,
review by Nicolás Ojeda Bär, Florian Angeletti, David Allsopp and
Gabriel Scherer)
- #10911: Improve the location reported by parenthesized assert expressions
(Fabian Hemmer, review by Gabriel Scherer)
- #1391, #7645, #3922: Add an early error when compiling different
modules with mismatching -for-pack
(Pierre Chambart and Vincent Laviron, review by Mark Shinwell)
- #11297: Report "unclosed" error when "done" is missing in a "do .. done"
construct.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #11635, #5461, #10564: turn warning 31 (Module_linked_twice) into a hard error
for ocamlc — this was already an error with ocamlopt.
(Hugo Heuzard, review by Valentin Gatien-Baron and Gabriel Scherer)
- #11653: Add the -no-absname option to ocamlc, ocamlopt and ocamldep.
(Abiola Abdulsalam, review by Sébastien Hinderer and Florian Angeletti)
- #11696: Add the -no-g option to ocamlc and ocamlopt.
(Abiola Abdulsalam, review by Sébastien Hinderer, Nicolás Ojeda Bär and
Florian Angeletti)
- #11722: clearer error messages on non-well-founded type definitions
(Gabriel Scherer, review by Jacques Garrigue)
- #11819: make the `native_compiler` and `native_dynlink` configuration
variables available through ocamlc -config.
(Sébastien Hinderer, review by Gabriel Scherer and David Allsopp)
- #8602, #11863: Add -stop-after lambda flag option
(Douglas Smith and Dmitrii Kosarev, review by Gabriel Scherer)
- #11910: Simplify naming convention for shadowed or ephemeral identifiers in
error messages (eg: `Illegal shadowing of included type t/2 by t`)
(Florian Angeletti, review by Jules Aguillon)
- #12024: insert a blank line between separate compiler messages
(Gabriel Scherer, review by Florian Angeletti, report by David Wong)
- #12088, #9265, #11949: ocamldebug: fix confusing repeating behavior
on blank lines within source scripts
(Damien Doligez, review by Gabriel Scherer, report by Gaëtan Gilbert)
- #12107: use aliases to mark weak row variables: `_[< ... ]`, `< _..>`, `_#ct`
are now rendered as `[< ...] as '_weak1`, `< .. > as '_weak1`,
and `#ct as '_weak1`.
(Florian Angeletti, suggestion by Stefan Muenzel, review by Gabriel Scherer)
- #12051: Improve the error messages when type variables cannot be generalized
(Stefan Muenzel, review by Florian Angeletti)
* #12094: Trigger warning 5 (ignored-partial-application) when the scrutinee of
a pattern matching is of arrow type and all cases match wildcard or exception
patterns.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #11018, #11869: Clean up Types.Variance, adding a description of
the lattice used, and defining explicitly composition.
(Jacques Garrigue, review by Gabriel Scherer and Jeremy Yallop)
- #11536: Introduce wrapper functions for level management
([Ctype.with_level], etc) and for type variable scoping
([Typetexp.with_local_type_variable_scope]).
The older API ([Ctype.(begin_def,end_def)], [Typetexp.(narrow,widen)], etc.)
is now removed.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #11601, #11612, #11628, #11613, #11623, #12120 : Clean up some
global state handling in emitcode, bytepackager, bytegen,
bytesections, spill.
(Hugo Heuzard, Stefan Muenzel, review by Vincent Laviron, Gabriel Scherer
and Nathanaëlle Courant)
- #12119, #12188, #12191: mirror type constraints on value binding in the
parsetree:
the constraint `typ` in `let pat : typ = exp` is now directly stored
in the value binding node in the parsetree.
(Florian Angeletti, review by Richard Eisenberg)
- #11912: Refactoring handling of scoped type variables
(Richard Eisenberg, review by Gabriel Scherer and Florian Angeletti)
- #11691, #11706: use __asm__ instead of asm for strict ISO C conformance
(Xavier Leroy, report by Gregg Reynolds , review by Sadiq Jaffer)
- #11764: add prototypes to old-style C function definitions and declarations
(Antonin Décimo, review by Xavier Leroy)
- #11693: Remove use of C99 Variable Length Arrays (VLAs) in the runtime.
(David Allsopp, review by Xavier Leroy, Guillaume Munch-Maccagnoni,
Stefan Muenzel and Gabriel Scherer)
- #12138: Generalise interface for BUILD_PATH_PREFIX_MAP mapping.
Absolute paths are now rewritten too.
(Richard L Ford, suggestions and review by Gabriel Scherer)
- #10512: explain the compilation strategy for switches on constructors
(Gabriel Scherer, review by Vincent Laviron)
- #11990: Improve comments and macros around frame descriptors.
(Nick Barnes, review by Gabriel Scherer)
- #11847, #11849, #11851, #11898: small refactorings in the type checker
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #11027: Separate typing counter-examples from type_pat into retype_pat;
type_pat is no longer in CPS.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #11286, #11515: disambiguate identifiers by using how recently they have
been bound in the current environment
(Florian Angeletti, review by Gabriel Scherer)
- #11364: Allow `make -C testsuite promote` to take `TEST` and `LIST` variables
(Antal Spector-Zabusky, review by Gabriel Scherer and David Allsopp)
- #11446: document switch compilation (lambda/switch.ml)
(Gabriel Scherer, review by Luc Maranget and Vincent Laviron)
- #11568: Encode inline record types in Path.t
(Leo White and Hyunggyu Jang, review by Gabriel Scherer)
- #11569: Remove hash type encoding
(Hyunggyu Jang, review by Gabriel Scherer and Florian Angeletti)
- #11627: use return values instead of globals for linear scan intervals
(Stefan Muenzel, review by Nicolás Ojeda Bär)
- #11634: Dll.open_dll now properly handles opening for execution while already
opened for checking
(Hugo Heuzard, review by Nicolás Ojeda Bär)
* #11745, #12358: Debugger and toplevels: embed printer types rather than
reading their representations from topdirs.cmi at runtime.
This change also removes the ocamlmktop initialization module introduced
in #11382 which was no longer useful.
This change breaks toplevel scripts relying on the visibility of `Topdirs`
in the initial toplevel environment without loading `topfind`.
Since the opam default `.ocamlinit` file loads `topfind`, it is expected
that only scripts run with `ocaml -noinit` are affected.
For those scripts, accessing `Topdirs` now requires the `compiler-libs`
directory to be added to the toplevel search path with
```
#directory "+compiler-libs";;
````
as was already the case for the other modules in the toplevel interface
library.
(Sébastien Hinderer, review by Florian Angeletti, Nicolás Ojeda Bär and
Gabriel Scherer)
- #11615: remove global variables form asmcomp/linearize.ml
(Stefan Muenzel, review by Nicolás Ojeda Bär
- #10856: Add location, attribute(s) visitors to Tast_mapper/Tast_iterator
(Yan Dong, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #11763, #11759, #11861: Enable stricter C compilation warnings, use
strict prototypes on primitives.
(Antonin Décimo, review by Xavier Leroy, David Allsopp and Sébastien
Hinderer)
- #11933: Use the correct machtype when reading the code pointer from closures
(Nathanaëlle Courant, review by Gabriel Scherer and Vincent Laviron)
- #11972: refactor runtime/frame_descriptors.c
in preparation for quadratic-time fix
(Gabriel Scherer, review by Enguerrand Decorne)
- #11997: translate structured constants into their Obj.t representation
at compile time rather than link time. Changes the way dumpobj prints
these constants because their representation becomes untyped.
(Sébastien Hinderer, review by Xavier Leroy, Nicolás Ojeda Bär and
Hugo Heuzard)
- #12011: remove Ctype.reified_var_counter
(Takafumi Saikawa and Jacques Garrigue, review by Gabriel Scherer)
- #12012: move calls to Typetexp.TyVarEnv.reset inside with_local_level etc.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #12034: a logarithmic algorithm to find the next free variable
(Gabriel Scherer, review by Stefan Muenzel)
- #12092: remove Lev_module_definition from lambda
(Nick Roberts, review by Gabriel Scherer)
- #12117: Remove arity-interrupting elaboration of module unpacks
(Nick Roberts, review by Richard Eisenberg and Jacques Garrigue)
- #12118: stop storing names of predefined exceptions in the
cu_required_globals field of compilation unit descriptors.
(Sébastien Hinderer, review by Vincent Laviron)
- #12125: Add Misc.print_see_manual and modify [@manual_ref] to accept
lists for simpler printing of manual references
(Stefan Muenzel, review by Florian Angeletti)
### Build system:
- #11844: Reduce verbosity of `make` logs by printing program invocations in
shorthand (eg `OCAMLC foo.cmo`). Setting `V=1` recovers the old style (with
full command-lines).
(Xavier Leroy, Nicolás Ojeda Bär, review by Sébastien Hinderer)
- #11590: Allow installing to a destination path containing spaces.
(Élie Brami, review by Sébastien Hinderer and David Allsopp)
- #11243, #11248, #11268, #11420, #11675: merge the sub-makefiles into
the root Makefile.
(Sébastien Hinderer, review by David Allsopp and Florian Angeletti)
- #11828: Compile otherlibs/ C stubs in two version for native and bytecode
(Olivier Nicole, review by Sébastien Hinderer and Xavier Leroy)
- #12265: Stop adding -lexecinfo to cclibs (leftover debugging code from the
multicore project). Harden the feature probe for -lm in configure so -lm is
only added if strictly necessary. configure.ac now correctly propagates
library flags for the Windows ports, allowing Windows OCaml to be configured
with ZSTD support.
(David Allsopp, review by Sébastien Hinderer)