forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Changes
15562 lines (12108 loc) · 634 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
---------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #13340: Array literal syntax can now be used to denote values of type `'a
array` and `floatarray`, both in expressions and patterns. The compiler
disambiguates each case by using contextual type information (assuming `'a
array` by default).
(Nicolás Ojeda Bär, review by Richard Eisenberg, Jeremy Yallop, Jacques
Garrigue, and Gabriel Scherer)
### Runtime system:
- #13352: Concurrency refactors and cleanups.
(Antonin Décimo, review by Gabriel Scherer, David Allsopp, and Miod Vallat)
- #13437: Stop using GetProcAddress to load functions that were not
available in older, now unsupported Windows versions.
(Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp)
- #13470: Constify some function parameters, flags tables, and some
pointers in C code (take 3).
(Antonin Décimo, review by Stephen Dolan and Miod Vallat)
- #13492: Parse the CAML_LD_LIBRARY_PATH environment variable for the
shared_libs_path item in `ocamlrun -config` in addition to displaying the
entries found in ld.conf.
(David Allsopp, review by Stephen Dolan)
- #13496: Add missing .type and .size directives to main frametable to silence
warnings from the linker when using libasmrun_shared on amd64 and power. The
other backends already carried these directives.
(David Allsopp, review by Tim McGilchrist and Miod Vallat)
- #13500: Add frame pointers support for ARM64 on Linux and macOS.
(Tim McGilchrist, review by KC Sivaramakrishnan, Fabrice Buoro
and Miod Vallat)
- #12964: Reintroduce "memory cleanup upon exit" mode. The cleanup will
however be incomplete if not all domains have been joined when the main
domain terminates.
(Miod Vallat, review by KC Sivaramakrishnan, feedback from Nick Barnes
and Gabriel Scherer)
- #13354: Use C99 flexible array member syntax everywhere.
(Antonin Décimo, review by Miod Vallat, Gabriel Scherer, and Xavier Leroy)
- #11865, #13584: Fix a deadlock triggered by deleting C roots from C finalisers
(Stephen Dolan, report by Timothy Bourke, review by Mark Shinwell and Damien
Doligez)
- #13613: Functions from caml/skiplist.h and caml/lf_skiplist.h no longer raise
Out_of_memory exceptions that the runtime could not handle.
(Guillaume Munch-Maccagnoni, review by Stephen Dolan)
- #13575, #13635: Maintain OCaml frame pointers correctly even when using
C libraries that do not support them.
(Stephen Dolan and David Allsopp, report by Thomas Leonard, review by Tim
McGilchrist and Fabrice Buoro)
### Code generation and optimizations:
* #13050: Use '$' instead of '.' to separate module names in symbol names.
This changes mangling of OCaml identifiers from
`camlModule.name_NNN` to `camlModule$name_NNN`. Additionally it
changes the encoding of special characters from $xx (two hex digits)
to $$xx (two dollar signs followed by two hex digits).
Mangled names are now consistent across all platforms.
(Tim McGilchrist, with contributions from Xavier Leroy,
reviewed by Xavier Leroy, Miod Vallat, Gabriel Scherer,
Nick Barnes and Hugo Heuzard)
- #13565: less tagging in switches compiled to affine transformations
by ocamlopt.
(Gabriel Scherer and Clément Allain, review by Vincent Laviron,
report by Vesa Karvonen)
- #13672 Avoid register stall on conversion instructions on amd64.
(Pierre Chambart, review by Gabriel Scherer and Xavier Leroy,
report by Patrick Nicodemus)
### Standard library:
- #13310: Add Stdlib.Pair
(Victoire Noizet, review by Nicolás Ojeda Bär, Daniel Bünzli, Xavier Van de
Woestyne, Jeremy Yallop and Florian Angeletti)
- #13662: Add eager boolean operations Bool.logand, Bool.logor, Bool.logxor
(Jeremy Yallop, review by Nicolás Ojeda Bär)
- #13463, #13572: Avoid Queue.empty to be raised by Format when used
concurrently. prefer undefined behavior to uncaught exception.
(Chritophe Raffalli, review by Gabriel Scherer and Daniel Bünzli)
- #13620: Avoid copying the string in String.concat, String.sub and
String.split_on_char when the full string is returned.
(Christophe Raffalli, review by Nicolás Ojeda Bär and Gabriel Scherer and
Hugo Heuzard)
### Other libraries:
* #13376: Allow Dynlink.loadfile_private to load bytecode libraries with
internal dependencies
(Vincent Laviron, report by Stéphane Glondu, review by Nicolás Ojeda Bär
and Xavier Leroy)
- #13429: add `Unix.sigwait`, a binding to the `sigwait` system call;
implement `Thread.wait_signal` using `Unix.sigwait`, and
`Thread.sigmask` using `Unix.sigprocmask`.
(Xavier Leroy, review by Antonin Décimo, Gabriel Scherer, Miod Vallat)
- #13442, #13452: Fix Unix.getgroups for users belonging to more than 32 groups
when using musl
(Kate Deplaix, review by Gabriel Scherer, Antonin Décimo, Anil Madhavapeddy)
* #13435: On Windows, use system calls for `Filename.get_temp_dir_name` instead
of directly reading the environment, which in particular improves the security
of OCaml processes running in the SYSTEM security context by mitigating
privileged file operation attacks. For all other processes running with the
default environment (where `TEMP` is set), there is no discernible change.
(Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp)
- #13504, #13625: Add `Thread.set_current_thread_name`.
(Romain Beauxis, review by Gabriel Scherer and Antonin Décimo)
### Tools:
- #12019: ocamlc: add `align_double` and `align_int64` to `ocamlc -config`
output.
(Romain Beauxis, review by David Allsopp)
- #12642, #13536: in the toplevel, print shorter paths for constructors
and labels when only some modules along their path are open.
(Gabriel Scherer, review by Florian Angeletti)
- #13686: Fix Python debugger extensions (for LLDB and GDB) to restore
functionality broken by #13272.
(Nick Barnes, review by Tim McGilchrist Gabriel Scherer)
- #13199, #13485: Support running native debuggers in ocamltest.
(Tim McGilchrist and Sebastien Hinderer, review by Sebastien Hinderer,
Gabriel Scherer and Antonin Décimo)
### Manual and documentation:
### Compiler user-interface and warnings:
- #13428: support dump=[source | parsetree | lambda | ... | cmm | ...]
in OCAMLRUNPARAM
(Gabriel Scherer, review by Vincent Laviron)
- #13493: Clearer error message in ocamlc for conflicting link options for
C stubs when shared libraries are not available.
(David Allsopp, review by Gabriel Scherer)
- #13563, lighter inline code styling for output without bold support: inline
code is no longer printed as "..." to avoid confusion with OCaml strings.
(Florian Angeletti, review by Richard Eisenberg)
- #13568, composable formatting for warning and alert messages
(Florian Angeletti, review by Richard Eisenberg)
- #13587: Enable native backend on x86_64 GNU/Hurd.
(Samuel Thibault, review by Antonin Décimo, Sébastien Hinderer and Miod
Vallat)
- #13601: Enable natdynlink on x86_64 GNU/Hurd
(Samuel Thibault, review by Sébastien Hinderer)
- #13663: Improve the error message when GADT parameter variance cannot be
checked.
(Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)
- #13646: Improve the error messages when a recursive module type
references another recursive module type.
(Stefan Muenzel, review by Florian Angeletti and Gabriel Scherer)
### Internal/compiler-libs changes:
- #13314: Comment the code of Translclass
(Vincent Laviron and Nathanaëlle Courant, review by Olivier Nicole)
- #13624: Added location to exception definitions and type extensions
(Samuel Vivien, review by Gabriel Scherer)
- #13425: undocumented -dmatchcomp flag for the debug
output of the pattern-matching compiler
(Gabriel Scherer, review by Vincent Laviron and Nicolás Ojeda Bär)
- #13460: introduce a variant of all predefined types
(Gabriel Scherer, review by Ulysse Gérard and Florian Angeletti)
- #13457, #13537: Annotate alloc/free open/close pairs of functions
with compiler attributes for static analysis.
(Antonin Décimo, review by Gabriel Scherer and Florian Angeletti)
- #13464: Use generic types in call to `subtype`. This improves
inference of type-directed disambiguation in principal mode.
(Richard Eisenberg, review by Jacques Garrigue)
- #13539: Use nanosleep instead of usleep, if available.
(Antonin Décimo, review by Miod Vallat and Gabriel Scherer)
- #13606: Fix Numbers.Int_base.compare
(Mark Shinwell, review by Vincent Laviron)
- #13612: Refactor `type_application`
(Ulysse Gérard, Leo White, review by Antonin Décimo, Gabriel Scherer,
Samuel Vivien, Florian Angeletti and Jacques Garrigue)
### Build system:
- #13431: Simplify github action responsible for flagging PRs with
the `parsetree-changes` label and extend it to mention the @ppxlib-dev
team.
(Nathan Rebours, review by Florian Angeletti)
* #13526: Simplify the build of cross compilers
This replaces the configure `--with-target-bindir` option by an equivalent
`TARGET_BINDIR` variable
(Samuel Hym, review by Miod Vallat, Xavier Leroy, Antonin Décimo and Sébastien
Hinderer)
### Bug fixes:
- #13454: Output a correct trace of the C_CALLN bytecode.
(Miod Vallat, review by Antonin Décimo)
- #13595: Use x19 as Canonical Frame Address (CFA) register. This would cause
backtraces to be truncated when calling no alloc C code.
(Tim McGilchrist, report by Nick Barnes, review by Nick Barnes)
- #13677, #13679: domain.c: remove backup_thread_running to simplify
concurrent state updates to the backup thread status.
(Gabriel Scherer, review by Jan Midtgaard and Miod Vallat,
report by Jan Midtgaard)
OCaml 5.3.0
___________
(Changes that can break existing programs are marked with a "*")
### Restored backend:
- #12954: Restore the MSVC port
(David Allsopp, Antonin Décimo, Samuel Hym, and Miod Vallat, review by Nicolás
Ojeda Bär)
- #13093: Allow building the MSVC port with clang-cl.
(Antonin Décimo, review by Nicolás Ojeda Bär, Samuel Hym,
David Allsopp and Sébastien Hinderer)
### Language features:
- #12828, #13283: Add short syntax for dependent functor types `(X:A) -> ...`
(Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #12309, #13158: Add syntax support for deep effect handlers
(Leo White, Tom Kelly, Anil Madhavapeddy, KC Sivaramakrishnan, Xavier Leroy
and Florian Angeletti, review by the same, Hugo Heuzard, and Ulysse Gérard)
- #11736, #12664, #13628: Support utf-8 encoded source files and latin-9
compatible identifiers.
(Xavier Leroy and Florian Angeletti, review by Daniel Bünzli and
Jules Aguillon)
### Type system
- #11891, #12507: Allow to name new locally abstract types in constructor type
annotations.
(Jacques Garrigue, report and review by Gabriel Scherer and Florian Angeletti)
### Runtime system:
- #13419: Fix memory bugs in runtime events system.
(B. Szilvasy and Nick Barnes, review by Miod Vallat, Nick Barnes,
Tim McGilchrist, and Gabriel Scherer)
- #13364: Emit major slice counters in the runtime events.
(KC Sivaramakrishnan and Sadiq Jaffer, review by Gabriel Scherer)
- #13382: Add more documentation for Runtime_events types
(Sadiq Jaffer, review by Tim McGilchrist, Miod Vallat and KC Sivaramakrishnan)
- #13370: Fix a low-probability crash when calling Gc.counters.
(Demi Marie Obenour, review by Gabriel Scherer)
- #13272: Allow maximum number of domains to be specified as a OCAMLRUNPARAM
parameter.
(KC Sivaramakrishnan, review by Guillaume Munch-Maccagnoni, Miod Vallat,
Gabriel Scherer, David Allsopp, request by Zachary Yedidia).
- #11911, #12923: Multicore statistical memory profiling.
This restores a notable OCaml 4 feature that was missing
in OCaml 5.
(Nick Barnes, review by Stephen Dolan, Jacques-Henri Jourdan
and Guillaume Munch-Maccagnoni).
- #12579: OS-based Synchronisation for Stop-the-World Sections
(B. Szilvasy, review by Miod Vallat, Nick Barnes, Olivier Nicole,
Gabriel Scherer and Damien Doligez)
- #12789: Restore caml_unregister_frametable from OCaml 4
(Frédéric Recoules, review by Gabriel Scherer)
- #13003: new, more consistent names for array-creation C functions
(Gabriel Scherer, review by Olivier Nicole)
- #13013: introduce a `caml_result` type to supersede the
use of 'encoded exception values' in the FFI.
(Gabriel Scherer, review by Damien Doligez,
Guillaume Munch-Maccagnoni and Xavier Leroy,
suggested by Guillaume Munch-Maccagnoni)
- #12407, #13226: Resource-handling improvements: add
exception-returning variants for all exception-raising functions in
`caml/fail.h`, for the purpose of cleaning-up state and resources
before raising.
(Guillaume Munch-Maccagnoni, review by Damien Doligez, Xavier Leroy
and Gabriel Scherer)
- #13086: Avoid spurious major GC slices.
(Damien Doligez, report by Stephen Dolan, review by Gabriel Scherer
and Stephen Dolan)
- #11779, #13117: Improve logic for fiber stack alignment.
(Miod Vallat, report by Damien Doligez, review by Gabriel Scherer)
- #12839: Remove ATOMIC_UINTNAT_INIT from camlatomic.h (as part of a larger
cleanup of camlatomic.h)
(David Allsopp, review by Antonin Décimo, Sébastien Hinderer, Samuel Hym,
Guillaume Munch-Maccagnoni and Miod Vallat)
- #13163: Enable frame pointers on macOS x86_64
(Tim McGilchrist, review by Sébastien Hinderer and Fabrice Buoro)
- #12951: Constify constructors and flags tables in C code (take 2).
Now these tables will go in the readonly segment, where they belong.
(Antonin Décimo, review by David Allsopp)
- #10696: Introduce __has_attribute and __has_c_attributes in
<caml/misc.h> to test the support of specific atributes in C
code. Introduce fallthrough as a wrapper around the fallthrough
attribute.
(Antonin Décimo, review by Nicolás Ojeda Bär, Xavier Leroy, and
Gabriel Scherer)
- #13083: Use macros from limits.h to avoid signed-integer wrap-around.
Introduce CAML_{U,}INTNAT_{MIN,MAX} macros to expose {u,}intnat limits.
(Antonin Décimo, review by Nick Barnes, Xavier Leroy, Gabriel Scherer,
and Miod Vallat)
- #13239: Check whether the compiler supports the labels as values
extension to enable threaded code interpretation.
(Antonin Décimo, review by Miod Vallat)
- #13238: Enable software prefetching on x86 and x86_64 when building
with MSVC or clang-cl.
(Antonin Décimo, review by Miod Vallat)
- #13241, #13261, #13271: Add CFI_SIGNAL_FRAME to ARM64 and RiscV runtimes,
for the purpose of displaying backtraces correctly in GDB.
(Tim McGilchrist, review by Miod Vallat, Gabriel Scherer and
KC Sivaramakrishnan)
- #13139: Simplify CAMLalign to always use C23/C++11 alignas or C11
_Alignas. Ensures that stat data is always aligned to the best
boundary.
(Antonin Décimo, review by Miod Vallat and Xavier Leroy)
- #13280: Check for support of compiler attributes. Allows using
compiler attributes with clang-cl.
(Antonin Décimo, review by Miod Vallat)
- #13243: Enable C compiler warnings internally when building with
clang-cl or MSVC. Provide fixes too.
(Antonin Décimo, review by Miod Vallat and Xavier Leroy)
- #13242: Define and use unreachable and trap annotation, and clean-up some
runtime assertions.
(Antonin Décimo, review by Miod Vallat, Gabriel Scherer, and David Allsopp)
- #13402, #13512, #13549, #13553: Revise bytecode implementation of callbacks
so that it no longer produces dangling registered bytecode fragments.
(Xavier Leroy, report by Jan Midtgaard, analysis by Stephen Dolan,
review by Miod Vallat)
- #13407: Add Runtime_events.EV_EMPTY_MINOR
(Thomas Leonard)
- #13522: Confirm runtime events ring is still active after callback.
(KC Sivaramakrishnan, review by Sadiq Jaffer and Miod Vallat)
- #13529: Do not write to event ring after going out of stw participant set.
(KC Sivaramakrishnan, review by Sadiq Jaffer)
### Code generation and optimizations:
- #13014: Enable compile-time option -function-sections on all previously
unsupported native backends (POWER, riscv64 and s390x)
(Miod Vallat, review by Nicolás Ojeda Bär)
- #7241, #12555, #13076, #13138, #13338, #13152, #13153, #13154:
fix a soundness bug in the pattern-matching compiler
when side-effects mutate the scrutinee during matching.
(Gabriel Scherer, review by Nick Roberts)
- #13341: a warning when the pattern-matching compiler pessimizes code
because side-effects may mutate the scrutinee during
matching. (This warning is disabled by default, as this rarely
happens and its performance impact is typically not noticeable.)
(Gabriel Scherer, review by Nick Roberts, Florian Angeletti
and David Allsopp)
- #13179: Fix evaluation of toplevel lets in classes containing
local opens
(Vincent Laviron, review by Hugo Heuzard, Nathanaëlle Courant
and Gabriel Scherer)
- #13543: Remove some String-Bytes conversion from the stdlib to behave better
with js_of_ocaml
(Hugo Heuzard, review by Gabriel Scherer)
### Standard library:
- #12884: Add `Queue.drop`
(Léo Andrès, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #13168: In Array.shuffle, clarify the code that validates the
result of the user-supplied function `rand`, and improve the
error message that is produced when this result is invalid.
(François Pottier, review by Florian Angeletti, Daniel Bünzli
and Gabriel Scherer)
- #12133: Expose support for printing substrings in Format
(Florian Angeletti, review by Daniel Bünzli, Gabriel Scherer
and Nicolás Ojeda Bär)
- #12869: Add List.take, List.drop, List.take_while and List.drop_while
(Kate Deplaix and Oscar Butler-Aldridge, review by Nicolás Ojeda Bär,
Craig Ferguson and Gabriel Scherer)
- #12885: move Dynarray to an unboxed representation
(Gabriel Scherer, suggestions by Vincent Laviron,
review by Olivier Nicole and Simon Cruanes, Yann Leray, Alain Frisch)
- #13047: Add Sys.poll_actions to (only) run pending runtime actions.
(Nick Barnes, review by Gabriel Scherer, Guillaume Munch-Maccagnoni, and
Vincent Laviron)
- #13144: Dynarray.{equal, compare}
(Gabriel Scherer,
review by Jeremy Yallop, Daniel Bünzli and Olivier Nicole,
request by Olivier Nicole)
- #13171: expose `Domain.self_index : unit -> int` (a somewhat-dense
indexing of currently-running domains) for advanced use-cases of
domain-indexed concurrent data structures.
(Gabriel Scherer,
review by KC Sivaramakrishnan, Miod Vallat and Nicolás Ojeda Bär,
report by Vesa Karvonen)
- #13197: Dynarray.blit, which allows to extend the destination
dynarray (0 <= dst_pos <= dst_length).
(Gabriel Scherer, report by Hazem Elmasry,
review by Olivier Nicole, Hazem Elmasry and Nicolás Ojeda Bär)
* #13240: Add Uchar.seeded_hash, Change Uchar.hash implementation.
Previously, Uchar.hash was aliased to Uchar.to_int. If you need that behavior,
change your module instantiation from eg `module HT = Hashtbl.Make(Uchar)` to
```
module HT = Hashtbl.Make(struct
...
let hash = Uchar.to_int
end)
```
If the current implementation is desired, and you have a hashtable module `HT`
(produced with the `Make` functor) in persistent storage, use `HT.rebuild` to
ensure it doesn't break when reading from or writing to buckets.
(Hazem ElMasry, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #13318: Fix regression in GC alarms, and fix them for flambda.
(Guillaume Munch-Maccagnoni, report by Benjamin Monate, review by
Vincent Laviron and Gabriel Scherer)
- #13296: Add mem, memq, find_opt, find_index, find_map and find_mapi
to Dynarray.
(Jake H, review by Gabriel Scherer and Florian Angeletti)
### Other libraries:
- #11996: release the dependency of dynlink on compilerlibs.
(Sébastien Hinderer and Stephen Dolan, review by Damien Doligez and
Hugo Heuzard)
- #13326: Implement Unix.O_APPEND on windows.
(Romain Beauxis, review by Miod Vallat, Gabriel Scherer and Antonin Décimo)
### Tools:
- #11716: ocamllex: mismatched parentheses and curly brackets are now caught
by ocamllex, instead of causing invalid OCaml code to be generated.
(Demi Marie Obenour, review by Damien Doligez and Xavier Leroy)
- #12904: Run the testsuite with ThreadSanitizer on a PR when label
`run-thread-sanitizer` is added
(Olivier Nicole, suggested by Sébastien Hinderer and David Allsopp, review by
Gabriel Scherer)
* #13114: Support ocamldebug remote debugging over IPv6 on all
platforms, and over Unix domain sockets on Windows.
(Antonin Décimo, review by Gabriel Scherer and Miod Vallat)
- #13136: Rewrite GDB extensions and macros in debugger-agnostic Python, and add
LLDB support for them.
(Nick Barnes, review by Tim McGilchrist and Gabriel Scherer)
### Toplevel:
- #12891: Improved styling for initial prompt
(Florian Angeletti, review by Gabriel Scherer)
- #13053: Improved display of builtin types such as `_ list` when aliased.
(Samuel Vivien, review by Florian Angeletti)
### Manual and documentation:
- #13370: Document that that temporary variables holding GCd pointers must
not be live across a GC.
(Demi Marie Obenour)
- #12298: Manual: emphasize that Bigarray.int refers to an OCaml integer,
which does not match the C int type.
(Edwin Török, review by Florian Angeletti)
- #12868: Manual: simplify style colours of the post-processed manual and API
HTML pages, and fix the search button icon
(Yawar Amin, review by Simon Grondin, Gabriel Scherer, and Florian Angeletti)
- #12949: document OCaml release cycles and version strings in
`release-info/introduction.md`.
(Florian Angeletti, review by Fabrice Buoro, Kate Deplaix, Damien Doligez, and
Gabriel Scherer)
- #12976: Manual: use webman/<version>/*.html and
webman/<version>/api/ for OCaml.org HTML manual generation
(Shakthi Kannan, review by Hannes Mehnert, and Florian Angeletti)
- #13045: Emphasize caution about behaviour of custom block finalizers.
(Nick Barnes)
- #13216: document the new `caml_result` type in the FFI chapter of the manual.
(Gabriel Scherer, review by Miod Vallat, Daniel Bünzli, Nick Barnes,
Guillaume Munch-Maccagnoni and Antonin Décimo)
- #13287: stdlib/sys.mli: Update documentation on Sys.opaque_identity
following #9412.
(Matt Walker, review by Guillaume Munch-Maccagnoni and Vincent Laviron)
- #13295: Use syntax for deep effect handlers in the effect handlers manual
page.
(KC Sivaramakrishnan, review by Anil Madhavapeddy, Florian Angeletti and Miod
Vallat)
- #13424: Fix `Gc.quick_stat` documentation to clarify that returned fields
`live_words`, `live_blocks`, `free_words`, and `fragments` are not zero.
(Jan Midtgaard, review by Damien Doligez and KC Sivaramakrishnan)
- #13440: Update documentation of `Gc.{control,get,set}` to reflect fields
not currently supported on OCaml 5.
(Jan Midtgaard, review by Gabriel Scherer)
- #13469, #13474, #13535: Document that [Hashtbl.create n] creates a hash table
with a default minimal size, even if [n] is very small or negative.
(Antonin Décimo, Nick Bares, report by Nikolaus Huber and Jan Midtgaard,
review by Florian Angeletti, Anil Madhavapeddy, Gabriel Scherer,
and Miod Vallat)
- #13666: Rewrite parts of the example code around nested lists in Chapter 6
(Polymorphism and its limitations -> Polymorphic recursion) giving the
"depth" function [in the non-polymorphically-recursive part of the example]
a much more sensible behavior; also fix a typo and some formatting.
(Frank Steffahn, review by Florian Angeletti)
- #13668: Document the basic support for unicode identifiers and the switch to
UTF-8 encoded Unicode text for OCaml source file
(Florian Angeletti, review by Nicolás Ojeda Bär and Daniel Bünzli)
### Compiler user-interface and warnings:
* #12084, #13669, #13673: Check link order when creating archive and when using
ocamlopt.
(Hugo Heuzard, review by Stefan Muenzel and Sébastien Hinderer)
- #12980: Explain type mismatch involving first-class modules by including
the module level error message
(Florian Angeletti, review by Vincent Laviron)
- #12985, #12988: Better error messages for partially applied functors.
(Florian Angeletti, report by Arthur Wendling, review by Gabriel Scherer)
- #13034, #13260: Better error messages for mismatched function labels
(Florian Angeletti, report by Daniel Bünzli, review by Gabriel Scherer and
Samuel Vivien)
- #13051: Add a "Syntax error" to error messages for invalid package signatures.
(Samuel Vivien, review by Gabriel Scherer)
- #13099: Fix erroneous loading of cmis for some module type errors.
(Nick Roberts, review by Florian Angeletti)
- #13151, name conflicts explanation as a footnote
(Florian Angeletti, review by Gabriel Scherer)
- #13228: Re-export Cmt2annot.{iterator,binary_part} which had become hidden
since #11288 and broke ocamlbrowser.
(David Allsopp, report by Jacques Garrigue, review by Sébastien Hinderer)
- #13251: Register printer for errors in Emitaux
(Vincent Laviron, review by Miod Vallat and Florian Angeletti)
- #13255: Re-enable warning 34 for unused locally abstract types
(Nick Roberts, review by Chris Casinghino and Florian Angeletti)
- #12182: Improve the type clash error message.
For example, this message:
This expression has type ...
is changed into:
The constant "42" has type ...
(Jules Aguillon, review by Gabriel Scherer and Florian Angeletti)
- #13471: add `-keywords <version?+list>` flag to define the list of keywords
recognized by the lexer, for instance `-keywords 5.2` disable the `effect`
keyword.
(Florian Angeletti, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #11129, #11148: enforce that ppxs do not produce `parsetree`s with
an empty list of universally quantified type variables
(`. int -> int` instead of `'a . int -> int'`)
(Florian Angeletti, report by Simmo Saan, review by Gabriel Scherer)
- #12534: document and refactor Matching.mk_failaction_pos
(Gabriel Scherer, review by Vincent Laviron and Nick Roberts)
- #13076: change the handling of Match_failure exits in the pattern-matching
compiler, to prepare for a complete fix for #7241
(Gabriel Scherer, review by Thomas Refis and Nick Roberts)
- #12896: Simplify the compilation of custom bytecode runtimes by explicitly
compiling the primitives file before calling the linker. Tidy-up both the
generating code and the output itself for C code being generated by the
bytecode linker in `-custom` and `-output-*` modes.
(David Allsopp, Antonin Décimo and Samuel Hym, review by Vincent Laviron)
- #12932: Remove useless code in Typecore.type_label_exp (was a fix for #4862)
(Jacques Garrigue, review by Gabriel Scherer)
- #12943: Make transient_expr.scope a bitfield, and use it to store marks.
Marks are automatically allocated, and removed when leaving their scope.
Falls back to using TransientTypeSet when marks are exhausted.
(Jacques Garrigue and Takafumi Saikawa, review by Basile Clément)
- #12946: Make generalization automatic when leaving scope.
As a result, the `Ctype.generalize*` and `Ctype.correct_levels` functions
were removed. The latter is now called `Ctype.duplicate_type`.
(Jacques Garrigue and Takafumi Saikawa, review by Richard Eisenberg)
- #12968: Attach location to constants in the parsetree
(Jules Aguillon, review by Gabriel Scherer)
- #12959, #13055: Avoid an internal error on recursive module type inconsistency
(Florian Angeletti, review by Jacques Garrigue and Gabriel Scherer)
- #13049: graphical debugging printer for types
(Florian Angeletti, review by Gabriel Scherer)
- #13074, #13082, #13084: refactoring in the pattern-matching compiler
(Gabriel Scherer, review by Thomas Refis, Vincent Laviron and Nick Roberts)
- #13067: rework volatile memory access rules under TSan to consider properly
aligned smaller-than-register read operations as atomic, which gets rid of
false positives on s390x
(Miod Vallat, review by Fabien Buoro)
- #13162: Use quoted strings to clarify code being generated.
(Antonin Décimo, review by Miod Vallat and Gabriel Scherer)
- #13015: Emit floating-point literals in .rodata section on ELF arm64
platforms (Linux, *BSD).
(Miod Vallat, review by Nicolás Ojeda Bär)
- #13169, #13311: Introduce a document data type for compiler messages
rather than relying on `Format.formatter -> unit` closures.
(Florian Angeletti, review by Gabriel Scherer)
- #13193: Remove the unused env_init field from class blocks
(Vincent Laviron, review by Jacques Garrigue)
- #13257: integrate MetaOCaml in the Menhir grammar to ease MetaOCaml
maintenance. This is a purely internal change: there is no support
in the lexer, so no change to the surface OCaml grammar.
(Oleg Kiselyov, Gabriel Scherer and Florian Angeletti,
review by Jeremy Yallop)
- #13286: Distinguish unique identifiers `Shape.Uid.t` according to their
provenance: either an implementation or an interface.
(Ulysse Gérard, review by Florian Angeletti and Leo White)
- #13289: Use C99 for loop to reduce the scope of the for loop iterator.
(Antonin Décimo, review by Miod Vallat and Gabriel Scherer)
- #13308: keep track of relations between declaration in the cmt files. This is
useful information for external tools for navigation and analysis purposis.
(Ulysse Gérard, Florian Angeletti, review by Florian Angeletti and Gabriel
Scherer)
- #13336: compiler-libs, split the `Printtyp` in three to only keep
"user-friendly" functions in the `Printtyp` module.
(Florian Angeletti, review by Gabriel Scherer)
- #13361: split runtime/array.c functions to consistently expose
uniform_array and floatarray versions, use floatarray versions
in Float.Array.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #13507: A small refactoring to [free_vars] to make it a bit faster
by not allocating a list when the list is not necessary.
(Richard Eisenberg, review by Jacques Garrigue)
### Build system:
- #12909: Reorganise how MKEXE_VIA_CC is built to make it correct for MSVC by
grouping all the linker flags at the end of the C compiler commandline
(David Allsopp and Samuel Hym, review by Nicolás Ojeda Bär)
- #12992, #13009: Check that flexlink can be executed only when building in a
native windows environment.
(Romain Beauxis, review by David Allsopp and Sébastien Hinderer)
- #12996: Only link with -lgcc_eh when available.
(Romain Beauxis, review by David Allsopp and Miod Vallat)
* #13200: Do not use CFLAGS for linking.
(Sébastien Hinderer, review by Gabriel Scherer, Antonin Décimo,
Miod Vallat and Samuel Hym)
- #13201, #13244: Fix and speedup builds with TSan.
(Sébastien Hinderer, review by Miod Vallat, Gabriel Scherer and
Olivier Nicole)
* #12578, #12589, #13322, #13519: Use configured CFLAGS and CPPFLAGS *only*
during the build of the compiler itself. Do not use them when
compiling third-party C sources through the compiler. Flags for
compiling third-party C sources can still be specified at configure
time in the COMPILER_{BYTECODE,NATIVE}_{CFLAGS,CPPFLAGS}
configuration variables.
(Sébastien Hinderer, report by William Hu, review by David Allsopp)
- #13285: continue the merge of the sub-makefiles into the root
Makefile started with #11243, #11248, #11268, #11420, #11675,
#12198, #12321, #12586, #12616, #12706 and #13048.
(Sébastien Hinderer, review by David Allsopp and Florian Angeletti)
### Bug fixes:
- #12854: Add a test in the regression suite that flags the bug #12825.
(Luc Maranget)
- #12888: fix printing of uncaught exceptions in `.cmo` files passed on the
command-line of the toplevel.
(Nicolás Ojeda Bär, review by Florian Angeletti, report by Daniel Bünzli)
- #12910, #12920: Fix an unsound interaction between first-class modules
and polymorphic records by saving and restoring univar_pairs.
(Stephen Dolan, review by Gabriel Scherer, report by Jeremy Yallop)
- #12994: Remove un-used and unsafe caml_drop_continuation
(Tim McGilchrist, reviewed by Gabriel Scherer and Miod Vallat)
- #12963: Restore caml_runtime_parameters implementation. This primitive allows
programs to query the runtime parameters supplied to an OCaml program.
Implementation missing since OCaml 5.0.
(Tim McGilchrist, reviewed by David Allsopp and Miod Vallat)
- #13012: parsing: Fix dropped attributes after a '-' or '+'
The syntax '-(1 [@foo])' was incorrectly parsed as '-1'.
(Jules Aguillon, reviewed by Gabriel Scherer, report by Gabriel Scherer)
* #13070: On Windows, when configured with bootstrapped flexdll, don't add
+flexdll to the search path when -nostdlib is specified (which then means
-L <path-to-flexdll> no longer gets passed to the system linker).
(David Allsopp, review by Florian Angeletti)
- #13089: Fix bug in `runtime_events` library which could result in garbled
output under Windows.
(B. Szilvasy, review by Nicolás Ojeda Bär and Miod Vallat)
- #13088: A few type-checker behaviors look at a type to see if there are
any labeled arguments in it. This sometimes required expansion, which
could, in obscure scenarios, result in superfluous type errors.
(Richard Eisenberg, review by Gabriel Scherer and Jacques Garrigue)
- #13103: FreeBSD/amd64: properly annotate .o files with non-executable stack
notes (Konstantin Belousov, review by Nicolás Ojeda Bär)
- #13150: improve a transitive-closure computation algorithm in the flambda
middle-end to avoid a compilation time blowup on Menhir-generated code
(Florian Weimer, review by Gabriel Scherer and Pierre Chambart,
report by Richard Jones)
- #13166: Fix a MinGW/MSVC Sys.rename regression on renaming a parent directory
to an empty child directory.
(Jan Midtgaard, review by Antonin Décimo, Sébastien Hinderer, and
David Allsopp)
- #13185, #13192: Reject type-level module aliases on functor parameter
inside signatures.
(Jacques Garrigue, report by Richard Eisenberg, review by Florian Angeletti)
- #13170: Fix a bug that would result in some floating alerts `[@@@alert ...]`
incorrectly triggering Warning 53.
(Nicolás Ojeda Bär, review by Chris Casinghino and Florian Angeletti)
- #13203: Do not issue warning 53 if the compiler is stopping before attributes
have been accurately marked.
(Chris Casinghino, review by Florian Angeletti)
- #13207: Be sure to reload the register caching the exception handler in
caml_c_call and caml_c_call_stack_args, as its value may have been changed
if the OCaml stack is expanded during a callback.
(Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and
Xavier Leroy)
- #13209: Fix configure test that checks whether `ar` supports `@FILE`
arguments.
(Nicolás Ojeda Bär, report by Boris D.)
- #13221: Compute more accurate instruction sizes for branch relocation on
POWER.
(Miod Vallat, review by Gabriel Scherer)
- #13252: Rework register assignment in the interpreter code on m68k on Linux,
due to the %a5 register being used by Glibc.
(Miod Vallat, report by Stéphane Glondu, review by Gabriel Scherer and
Xavier Leroy)
- #13247: Disable lib_unix/kill test for MacOS AMD64 with TSan, linking
to llvm bug report causing infinite signal loops.
(Tim McGilchrist, review by Olivier Nicole, Miod Vallat, Sébastien Hinderer
and Gabriel Scherer)
- #13234, #13267: Open runtime events file in read-write mode on armel
(armv5) systems due to atomic operations limitations on that
platform.
(Stéphane Glondu, review by Miod Vallat and Vincent Laviron)
- #13273: Fix a call to test in configure.ac that was causing errors when
LDFLAGS contains several words.
(Stéphane Glondu, review by Miod Vallat)
- #13290: Fix uninitialized and out of bounds reads in runtime_events_consumer.c
(Edwin Török, review by Miod Vallat and Antonin Décimo)
- #13306: An algorithm in the type-checker that checks two types for equality
could sometimes, in theory, return the wrong answer. This patch fixes the
oversight. No known program triggers the bug.
(Richard Eisenberg, review by Florian Angeletti)
- #13400: Initialize th->signal_stack to avoid free of uninitialized data
if the user calls caml_c_thread_unregister on the main thread.
(Richard W.M. Jones, review by Guillaume Munch-Maccagnoni and
Gabriel Scherer)
- #13140: POWER back-end: fix issue with call to `caml_call_realloc_stack`
from a DLL
(Xavier Leroy, review by Miod Vallat)
- #13263, #13560: fix printing true and false in toplevel and error
messages (no more unexpected \#true)
(Florian Angeletti, report by Samuel Vivien, review by Gabriel Scherer)
- #13388, #13540: raises an error message (and not an internal compiler error)
when two local substitutions are incompatible (for instance `module type
S:=sig end type t:=(module S)`)
(Florian Angeletti, report by Nailen Matschke, review by Gabriel Scherer, and
Leo White)
- #13408: Fix misplaced debug runtime assertion triggerable by a race
between domain exit and backup thread
(Miod Vallat and Gabriel Scherer, report by Jan Midtgaard)
- #13417: `Filename.quote_command`: fix handling of forward slashes in program
path under Win32.
(Nicolás Ojeda Bär, review by David Allsopp and Damien Doligez)
- #13501: Regression on mutually recursive types caused by #12180.
Resuscitate Typedecl.update_type.
(Jacques Garrigue and Takafumi Saikawa, review by Florian Angeletti, Richard
Eisenberg and Gabriel Scherer)
- #13502: Fix misindexing related to `Gc.finalise_last` that could prevent
finalisers from being run.
(Nick Roberts, review by Mark Shinwell)
- #13495, #13514: Fix typechecker crash while typing objects
(Jacques Garrigue, report by Nicolás Ojeda Bär, review by
Nicolas Ojeda Bär, Gabriel Scherer, Stephen Dolan, Florian Angeletti)
- #13391, #13551: fix a printing bug with `-dsource` when using
raw literal inside a locally abstract type constraint
(i.e. `let f: type \#for. ... `)
(Florian Angeletti, report by Nick Roberts, review by Richard Eisenberg)
- #13520: Fix compilation of native-code version of systhreads. Bytecode fields
were being included in the thread descriptors.
(David Allsopp, review by Sébastien Hinderer and Miod Vallat)
- #13541, #13591: Fix headers for C++ inclusion.
(Antonin Décimo, review by Nick Barnes, report by Kate Deplaix)
- #13579, #13583: Unsoundness involving non-injective types + gadts
(Jacques Garrigue, report by @v-gb,
review by Richard Eisenberg and Florian Angeletti)
- #13598: Falsely triggered warning 56 [unreachable-case]
This was caused by unproper protection of the retyping function.
(Jacques Garrigue, report by Tõivo Leedjärv, review by Florian Angeletti)
- #13603, #13604: fix source printing in the presence of the escaped raw
identifier `\#mod`.
(Florian Angeletti, report by Chris Casinghino, review by Gabriel Scherer)
OCaml 5.2.0 (13 May 2024)
-------------------------
(Changes that can break existing programs are marked with a "*")
### Restored and new backends:
- #12276, #12601: native-code compilation for POWER (64 bits, little-endian)
(Xavier Leroy, review by KC Sivaramakrishnan, Anil Madhavapeddy,
and Stephen Dolan)
- #12667: extend the latter to POWER 64 bits, big-endian, ELFv2 ABI
(A. Wilcox, review by Xavier Leroy)
### Language features:
- #12295, #12568: 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)
- #12375: allow use of [@untagged] for all immediate types like char, bool,
and variant with only constant constructors.
(Christophe Raffalli, review by Gabriel Scherer)
* #12502: the compiler now normalizes the newline sequence \r\n to
a single \n character during lexing, to guarantee that the semantics
of newlines in string literals is not modified by Windows tools
transforming \n into \r\n in source files.
Warning 29 [eol-in-string] is not emitted anymore, as the normalization
gives a more robust semantics to newlines in string literals.
(Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David
Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg)
- #13130: minor fixes to pprintast for raw identifiers and local module open
syntax for types.
(Chet Murthy, review by Gabriel Scherer)
### Type system: