forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChanges
11727 lines (9224 loc) · 473 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
----------------
### Language features:
- #10437: Allow explicit binders for type variables.
(Stephen Dolan, review by Leo White)
### Runtime system:
* #9391, #9424: Fix failed assertion in runtime due to ephemerons *set_* and
*blit_* function during Mark phase
(François Bobot, reported by Stephen Dolan, reviewed by Damien Doligez)
- #10549: Stack overflow detection and naked pointers checking for ARM64
(Xavier Leroy, review by Stephen Dolan)
### Code generation and optimizations:
- #10578: Increase the number of integer registers used for
parameter passing on PowerPC (16 registers) and on s390x (8 registers).
(Xavier Leroy, review by Mark Shinwell)
### Standard library:
* #7812, #10475: `Filename.chop_suffix name suff` now checks that `suff`
is actually a suffix of `name` and raises Invalid_argument otherwise.
(Xavier Leroy, report by whitequark, review by David Allsopp)
* #10482: mark the Stream and Genlex modules as deprecated, in preparation
for a future removal. These modules (without deprecation alert)
are now provided by the camlp-streams library.
(Xavier Leroy, review by Nicolás Ojeda Bär)
- #10526: add Random.bits32, Random.bits64, Random.nativebits
(Xavier Leroy, review by Gabriel Scherer and François Bobot)
* #10568: remove Obj.marshal and Obj.unmarshal
(these functions have been deprecated for a while and are superseded
by the functions from module Marshal)
(François Pottier, review by Gabriel Scherer and Kate Deplaix)
- #10545: Add In_channel and Out_channel modules.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Simon Cruanes, Gabriel Scherer,
Guillaume Munch-Maccagnoni, Alain Frisch and Xavier Leroy)
### Other libraries:
- #10192: Add support for Unix domain sockets on Windows and use them
to emulate Unix.socketpair (only available on Windows 1803+)
(Antonin Décimo, review by David Allsopp)
- #10469: Add Thread.set_uncaught_exception_handler and
Thread.default_uncaught_exception_handler.
(Enguerrand Decorne, review by David Allsopp)
### Tools:
- #3959, #7202, #10476: ocaml, in script mode, directive errors
(`#use "missing_file";;`) use stderr and exit with an error.
(Florian Angeletti, review by Gabriel Scherer)
- #10524: Directive argument type error now shows expected and received type.
(Wiktor Kuchta, review by Gabriel Scherer)
- #10560: Disable colors if the env variable `NO_COLOR` is set. If
`OCAML_COLOR` is set, its setting takes precedence over `NO_COLOR`.
(Nicolás Ojeda Bär, report by Gabriel Scherer, review by Daniel Bünzli,
Gabriel Scherer and David Allsopp)
- #10565: Toplevel value printing: truncate strings only after 8 bytes.
(Wiktor Kuchta, review by Xavier Leroy)
### Debugging:
- #10517, #10594: when running ocamldebug on a program linked with the
threads library, don't fail immediately; instead, allow debugging
until the program creates a thread for the first time, then fail cleanly.
(Xavier Leroy, report by @anentropic, review by Gabriel Scherer)
### Manual and documentation:
- #7812, #10475: reworded the description of the behaviors of
float->int conversions in case of overflow, and of iterators
in case of concurrent modifications.
(Xavier Leroy, report by whitequark, review by David Allsopp)
### Compiler user-interface and warnings:
- #10328: Give more precise error when disambiguation could not possibly work.
(Leo White, review by Gabriel Scherer and Florian Angeletti)
- #10361: Improve error messages for mismatched record and variant
definitions.
(Florian Angeletti, review by Gabriel Radanne and Gabriel Scherer)
- #10407: Produce more detailed error messages that contain full error traces
when module inclusion fails.
(Antal Spector-Zabusky, review by Florian Angeletti)
- #10531: add naked_pointers to ocamlc -config exporting NAKED_POINTERS from
Makefile.config.
(Damien Doligez, review by Mark Shinwell and Gabriel Scherer)
### Internal/compiler-libs changes:
- #1599: add unset directive to ocamltest to clear environment variables before
running tests.
(David Allsopp, review by Damien Doligez and Sébastien Hinderer)
- #10433: Remove the distinction between 32-bit aligned and 64-bit aligned
64-bit floats in Cmm.memory_chunk.
(Greta Yorsh, review by Xavier Leroy)
- #10434: Pun labelled arguments with type constraint in function applications.
(Greta Yorsh, review by Nicolas Chataing and Nicolás Ojeda Bär)
- #10470: Remove unused `cstr_normal` field from the `constructor_description`
type
(Nicolas Chataing, review by Gabriel Scherer)
- #10472: refactor caml_sys_random_seed to ease future Multicore changes
(Gabriel Scherer, review by Xavier Leroy)
- #10487: Move logic to get the type path from a constructor return type in
Types
(Nicolas Chataing, review by Jacques Garrigue)
- #10555: Do not use ghost locations for type constraints
(Nicolás Ojeda Bär, report by Anton Bachin, review by Thomas Refis)
### Build system:
### Bug fixes:
- #10473: Add CFI directives to RISC-V runtime and asmcomp.
This allows stacktraces to work in gdb through C and OCaml calls.
(Edwin Török, review by Nicolás Ojeda Bär and Xavier Leroy)
- #10461, #10498: `caml_send*` helper functions take derived pointers
as arguments. Those must be declared with type Addr instead of Val.
Moreover, poll point insertion must be disabled for `caml_send*`,
otherwise the derived pointer is live across a poll point.
(Vincent Laviron and Xavier Leroy, review by Xavier Leroy and Sadiq Jaffer)
- #10539: Field kinds should be kept when copying types
Losing the sharing meant that one could desynchronize them between several
occurrences of self, allowing a method to be both public and hidden,
which broke type soundness.
(Jacques Garrigue, review by Leo White)
- #10542: Fix detection of immediate64 types through unboxed types.
(Leo White, review by Stephen Dolan and Gabriel Scherer)
- #10590: Some typechecker optimisations
(Stephen Dolan, review by Gabriel Scherer and Leo White)
OCaml 4.13.0
-------------
### Language features:
- #10039: Safepoints
Add poll points to native generated code. These are effectively
zero-sized allocations and fix some signal and remembered set
issues. Also multicore prerequisite.
(Sadiq Jaffer, Stephen Dolan, Damien Doligez, Xavier Leroy,
Anmol Sahoo, Mark Shinwell, review by Damien Doligez, Xavier Leroy,
and Mark Shinwell)
- #9331: Improve error messages for functor application and functor types.
(Florian Angeletti and Gabriel Radanne, review by Leo White)
- #10013: Let-punning
Allow 'let* x in ...' and 'let%ext x in ...' as shorthand for
'let* x = x in ...' and 'let%ext x = x in ...' respectively.
(Stephen Dolan, review by Gabriel Scherer)
- #10441: Remove unnecessary parentheses surrounding immediate objects.
Allow 'object ... end # f', 'f object ... end', etc.
(Yan Dong, review by Nicolás Ojeda Bär, Florian Angeletti and Gabriel Scherer)
### Type system:
- #9584, #7074: Allow to name existentials in pattern-matching
One can now write '(Cstr (type a) (x, y : int * a))' to give a name to
existentials freshly introduced by GADT constructors.
(Jacques Garrigue, review by Leo White and Gabriel Scherer)
- #10174: Make Tsubst more robust by avoiding strange workarounds
(Takafumi Saikawa and Jacques Garrigue, review by Gabriel Scherer and
Florian Angeletti)
- #10133: module type substitutions
Allow 'SIG with module type T = F(X).S', 'SIG with module type T := sig end'
and their local equivalent `module type T := sig type u end`
(Florian Angeletti, review by Gabriel Radanne and Leo White)
- #10265: Move type_unboxed.unboxed into type_kind
(Stephen Dolan, review by Gabriel Scherer)
* #10081: Typecheck `x |> f` and `f @@ x` as `(f x)`
(Alain Frisch, review by Jacques Garrigue, Josh Berdine and Thomas Refis)
### Runtime system:
- #9284: Add -config option to display the configuration of ocamlrun on stdout,
including the search path for shared stub libraries.
(David Allsopp, review by Xavier Leroy)
- #9934: Optimise sweeping using prefetching.
(Stephen Dolan and Will Hasenplaugh, review by David Allsopp, Xavier
Leroy and Damien Doligez, benchmarking by Shubham Kumar and KC
Sivaramakrishnan)
- #9919: Introduce caml_record_backtraces and update Interfacing with C to
refer to it (previous instruction to use caml_record_backtrace primitive was
not possible without defining CAML_INTERNALS)
- #10102: Ignore PROFINFO_WIDTH if WITH_PROFINFO is not defined (technically
a breaking change if the configuration system was being abused before).
(David Allsopp, review by Xavier Leroy)
- #10107: Ensure modules compiled with -afl-instrument can still link on
platforms without AFL support.
(David Allsopp, review by Xavier Leroy)
- #10195: Speed up GC by prefetching during marking
(Stephen Dolan, review by Xavier Leroy, Guillaume Munch-Maccagnoni,
Jacques-Henri Jourdan and Damien Doligez)
* #10098: Improve command-line parsing in ocamlrun: strictly recognise options,
be more informative for `ocamlrun -I` and support `--` for terminating options
parsing.
(David Allsopp, review by Xavier Leroy)
- #10101: Add -help/--help option to ocamlrun.
(David Allsopp, review by Xavier Leroy)
- #10136: Minor clean-ups in runtime/io.c and runtime/caml/io.h
(Xavier Leroy, review by David Allsopp and Guillaume Munch-Maccagnoni)
- #10171: Tweak the naked pointers checker so that processes which trigger the
alarm always exit with non-zero status (i.e. exit(0) becomes exit(70)).
(David Allsopp, review by Xavier Leroy)
- #10188, #10213: Switch the default allocation policy to best-fit and adjust
the default overhead parameter accordingly.
(Damien Doligez, review by Josh Berdine and Xavier Leroy)
- #10212: Simplify and improve the Windows-specific code that connects
to the debugger via a socket.
(Antonin Décimo, review by Xavier Leroy)
- #10217: Fix a segfault in a corner case of compaction (reported in #9853)
(Damien Doligez, report by Sadiq Jaffer, review by Stephen Dolan)
- #10250, #10266: Dynamically allocate alternate signal stacks to
accommodate changes in Glibc 2.34.
(Xavier Leroy, reports by Tomasz Kłoczko and R.W.M. Jones, review by Anil
Madhavapeddy, Stephen Dolan, and Florian Angeletti)
- #10318: Windows Unicode runtime functions are no longer marked as
experimental.
(Nicolás Ojeda Bär, review by David Allsopp)
- #10194: Change compaction-triggering heuristic: use the overhead measured
by the previous GC cycle instead of an indirect (and noisy) computation
of the current overhead.
(Damien Doligez, review by Stephen Dolan)
### Code generation and optimizations:
- #1400: Add an optional invariants check on Cmm, which can be activated
with the -dcmm-invariants flag
(Vincent Laviron, with help from Sebastien Hinderer, review by Stephen Dolan
and David Allsopp)
- #9562, #367: Allow CSE of immutable loads across stores
(Stephen Dolan, review by Mark Shinwell)
- #9876: do not cache the young_limit GC variable in a processor register.
This affects the ARM64, PowerPC and RISC-V ports, making signal handling
and minor GC triggers more reliable, at the cost of a small slowdown.
(Xavier Leroy, review by Nicolás Ojeda Bär)
- #9937: improvements in ARM64 code generation (constants, sign extensions)
(Xavier Leroy, review by Stephen Dolan)
- #10228: Better code-generation for inlined comparisons
(Stephen Dolan, review by Alain Frisch and Xavier Leroy)
- #10244: Optimise Int32.unsigned_to_int
(Fabian Hemmer, review by Stephen Dolan and Xavier Leroy)
- #10302, #10303: Fix incorrect instruction selection for string constant loads
on ppc.
(David Allsopp, review by Stephen Dolan)
- #10349: Fix destroyed_at_c_call on RISC-V
(Mark Shinwell, review by Nicolás Ojeda Bär)
- #10404: Add a generic backward dataflow analyzer and use it to speed up
liveness analysis
(Xavier Leroy, review by Gabriel Scherer, Greta Yorsh, Mark Shinwell)
- #10414: Avoid compilation times exponential in the nesting of loops
in the spilling and reloading passes
(Xavier Leroy, review by Vincent Laviron)
- #10419: Add %frame_pointers primitive which is true only in native code with
frame pointers mode enabled.
(David Allsopp, review by Vincent Laviron and Mark Shinwell)
### Standard library:
- #944: Add some missing C99 float operations. `Stdlib` now contains
the inverse hyperbolic functions `acosh`, `asinh`, and `atanh`. These
functions were also added to module `Stdlib.Float` together with `exp2`,
`log2`, `cbrt`, `erf`, and `erfc`. Full support on MSVC requires VS2013+ but
emulated versions are still available (for now) for older compilers.
(Markus Mottl, review by David Allsopp, Olivier Andrieu, Florian Angeletti,
Nicolás Ojeda Bär, Daniel Bünzli, Fabian @copy, Pascal Cuoq, Damien
Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Xavier Leroy, Guillaume
Melquiond, Perry E. Metzger, @objmagic, Gabriel Scherer, Mark Shinwell,
Bernhard Schommer and Christophe Troestler)
- #9448: Add String.{empty,cat} as dual of Bytes.{empty,cat},
String.{of,to}_bytes as aliases of Bytes.{to,of}_string,
Bytes.split_on_char as dual of String.split_on_char, and binary decoding
functions in String to match those in Bytes.
(David Allsopp, review by Damien Doligez, Gabriel Scherer and others)
- #9487, #9489: Add Random.full_int which allows 62-bit bounds on 64-bit
systems.
(David Allsopp, request by Francois Berenger, review by Xavier Leroy and
Damien Doligez)
- #9533: Added String.starts_with and String.ends_with.
(Bernhard Schommer, review by Daniel Bünzli, Gabriel Scherer and
Alain Frisch)
- #9582: Add Array.{find_opt,find_map,split,combine}.
(Nicolás Ojeda Bär, review by Daniel Bünzli and Gabriel Scherer)
- #9961: Add Array.fold_left_map.
(Craig Ferguson, review by Damien Doligez)
- #10097: Lazy.map, Lazy.map_val: ('a -> 'b) -> 'a Lazy.t -> 'b Lazy.t
(map f x) is always (lazy (f (force x))), whereas (map_val f x)
applies f directly if x is already forced.
(Gabriel Scherer, review by Nicolás Ojeda Bär, Alain Frisch, Xavier Leroy,
Daniel Bünzli and Stephen Dolan)
* #10169, #10270, #10301, #10451: Use capitalized module names in the Standard
Library prefixing scheme to match Dune, e.g. Stdlib__String instead of
Stdlib__string. This is a breaking change only to code which attempted to use
the internal names before. The Standard Library generated by the Dune rules is
now equivalent to the main build (the Dune rules still do not generate a
distributable compiler).
(David Allsopp and Mark Shinwell, review by Gabriel Scherer)
- #10242: Added convenience pretty printer for Either.t in the Format module.
(Oghenevwogaga Ebresafe, review by Nicolás Ojeda Bär,
Gabriel Scherer and Xavier Van de Woestyne)
- #10352: Seq.(concat : 'a t t -> 'a t)
Seq.concat_map as an alias to Seq.flat_map,
(Gabriel Scherer, review by Ulugbek Abdullaev and Daniel Bünzli
and Nicolás Ojeda Bär and Florian Angeletti)
- #882: Add fold_left, fold_right, exists and for_all to String/Bytes
(Yotam Barnoy, review by Alain Frisch and Jeremy Yallop)
- #4070, #10398: small optimization of Stdlib.{frexp,modf}.
(Markus Mottl, Nicolás Ojeda Bär, review by Gabriel Scherer)
- #10389, #10391, #10392: Add {Int,Int32,Int64,Nativeint}.{min,max}.
(Nicolás Ojeda Bär and Alain Frisch, review by Xavier Leroy)
- #10430: Add Format.print_bytes and Format.pp_print_bytes.
(Gabriel Radanne, review by Gabriel Scherer and David Allsopp)
### Other libraries:
- #10047: Add `Unix.realpath`
(Daniel Bünzli, review by David Allsopp, Josh Berdine and Gabriel Scherer)
* #10084: Unix.open_process_args* functions now look up the program in the PATH.
This was already the case under Windows, but this is now also done under
Unix. Note that previously the program was interpreted relative to the current
directory.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)
- #10184: Remove expensive debug assertion from dynlink.
(Leo White, review by David Allsopp and Xavier Leroy)
- #10185: Consider that IPv6 is always enabled on Windows.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
- #10306: Map WSA error code to Unix errno for sockopt and getsockname
functions (Antonin Décimo, review by David Allsopp)
- #10309: Properly return EBADF on error in Unix.descr_of_{in,out}_channel on
Win32 and map Windows error correctly in Unix.truncate and Unix.ftruncate on
Win32.
(David Allsopp, review by Nicolás Ojeda Bär)
### Tools:
- #8645, #10363: ocamldoc: escape `<`, `>`, and `&` in html backend.
(Florian Angeletti, report by Wim Lewis, review by Gabriel Scherer)
- #10139: Remove confusing navigation bar from stdlib documentation.
Adds a -nonavbar option to ocamldoc, and uses it to improve navigation within
the reference manual.
(John Whitington, review by David Allsopp)
- #10438: add a new toplevel cli argument `-e <script>` to
run script passed to the toplevel.
(Pavlo Khrystenko, review by Gabriel Scherer)
### Manual and documentation:
- #9525, #10402: ocamldoc only create paragraphq at the toplevel of
documentation comments
(Florian Angeletti, report by Hendrik Tews, review by Gabriel Scherer)
- #10206: Split labels and polymorphic variants tutorials
Splits the labels and polymorphic variants tutorial into two. Moves the GADTs
tutorial from the Language Extensions chapter to the tutorials.
(John Whitington, review by Florian Angeletti and Xavier Leroy)
- #10247: Add initial tranche of examples to reference manual.
Adds some eighty examples to the reference manual, principally to the
expressions and patterns sections.
(John Whitington, review by Xavier Leroy, Gabriel Scherer, @Fourchaux, and
Florian Angeletti)
- #9786, #10181: improved documentation of Unix.{in,out}_channel_of_descr
with respect to closing.
(Xavier Leroy, report by Jacques-Henri Jourdan, review by Guillaume
Munch-Maccagnoni, Gabriel Scherer, Jacques-Henri Jourdan)
- #10139: Remove confusing navigation bar from stdlib documentation.
Removes the 'Up', 'Previous' and 'Next' links from the top of each standard
library module's documentation.
(John Whitington, review by David Allsopp)
- #1351: Document `-output-complete-obj` option in the manual.
(François Bobot, Nicolás Ojeda Bär, review by Daniel Bünzli and Damien
Doligez)
- #9987, #9988, #9996, #9997: add an odoc mode for the documentation
of the standard library and compiler library
(Florian Angeletti, review by David Allsopp, Sébastien Hinderer,
and Gabriel Scherer)
- #9632: Document incremental build solutions with opam
(Vincent Laviron, review by Daniel Bünzli and Gabriel Scherer)
- #10497: Styling changes in the post-processed HTML manual (webman)
(Wiktor Kuchta, review by Florian Angeletti)
### Compiler user-interface and warnings:
- #1737, #2092, #7852, #7859, #10405, #10417: Update locations during
destructive substitutions
(Thomas Refis, review by Gabriel Radanne, report by Hugo Heuzard)
- #2245: Improve error message for link order error in bytecode
(Pierre Chambart, review by Jérémie Dimino and Gabriel Scherer)
- #8732, improved error messages for invalid private row type definitions.
For instance, [ type t = private [< `A > `A ] ] .
(Florian Angeletti, review by Jacques Garrigue, Thomas Refis,
and Gabriel Scherer)
- #9407: added warning for missing mli interface file
(Anukriti Kumar, review by Florian Angeletti)
- #9960: extend ocamlc/ocamlopt's -o option to work when compiling C files
(Sébastien Hinderer, reported by Daniel Bünzli, review by Florian
Angeletti and Gabriel Scherer)
- #10095: simplify the syntax error messages produced by the compiler.
In many cases, the compiler would produce an error message that looked
potentially helpful but was actually misguided and arguably confusing,
because the error message implicitly referred to an earlier point in
the source code than the point explicitly shown in the error message.
(François Pottier, review by Gabriel Scherer and Frédéric Bour.)
* #10118, #10140: enable warning 6 [labels-omitted] by default.
The following now warns:
let f ~x y = ... in f 3 5
the callsite (f 3 5) has to be turned into (f ~x:3 5).
This prevents mistakes where two arguments of the same types are swapped.
(Note: Dune already enables this warning by default.)
(Gabriel Scherer, review by Xavier Leroy and Florian Angeletti,
report by ygrek)
- #10196, #10197: better error message on empty character literals ''.
(Gabriel Scherer, review by David Allsopp and Florian Angeletti
and Daniel Bünzli, report by Robin Björklin)
- #8877: Call the linker when ocamlopt is invoked with .o and .a files only.
(Greta Yorsh, review by Leo White)
- #10207, #10312: deprecate consecutive letters in warning
specifications.
The form `-w aBcD` was equivalent to `-w -a+b-c+d`.
It is now deprecated to improve the coexistence with warning mnemonics.
However, using isolated single letter is not deprecated to allow the form
`-w "A-32..50-45"`.
(Florian Angeletti, review by Damien Doligez and Gabriel Scherer)
- #10232: Warning for unused record fields.
(Leo White, review by Florian Angeletti)
### Internal/compiler-libs changes:
- #8516: Change representation of class signatures
(Leo White, review by Thomas Refis)
- #9243, simplify parser rules for array indexing operations
(Florian Angeletti, review by Damien Doligez and Gabriel Scherer)
- #9650, #9651: keep refactoring the pattern-matching compiler
(Gabriel Scherer, review by Thomas Refis and Florian Angeletti)
- #9827: Replace references with functions arguments in Simplif
(Anukriti Kumar, review by Vincent Laviron and David Allsop)
- #9994: Make Types.type_expr a private type, and abstract marking mechanism
(Jacques Garrigue and Takafumi Saikawa,
review by Gabriel Scherer and Leo White)
- #10007: Driver.compile_common: when typing a .ml file, return the
compilation unit signature (inferred or from the .cmi) in addition
to the implementation and the coercion.
(Leandro Ostera, review by Gabriel Scherer and Thomas Refis)
- #10045: Add libext variable to ocamltest and enable C# tests on on mingw
(David Allsopp, review by Gabriel Scherer)
* #10061, #10078, #10187: remove library `ocamlopttoplevel`, remove modules
`Opttoploop`, `Opttopstart`, which are replaced by `Toploop` and `Topstart` in
library `ocamltoplevel`, made available in native code.
- #10124: remove duplicated code from the native toplevel, split toplevel
implementation into the shared part (`Topcommon`, etc.) and specific ones
(`Topeval`, `Trace`, `Topmain`).
* #10086: add the commands `make list-parse-errors` and `make
generate-parse-errors` to generate a set of syntactically incorrect
sentences that covers all error states of the LR automaton. Add these
sentences to the test suite. This can be used to evaluate the quality of the
parser's syntax error messages and (in the future) to evaluate the impact of
changes in the parser.
(François Pottier, review by Gabriel Scherer and Xavier Leroy.)
- #10090: Distinguished constructors for ref variables at lambda level
(Keryan Didier, review by Gabriel Scherer and Vincent Laviron)
- #10113: add a `-timeout` option to ocamltest and use it in the test suite.
(Xavier Leroy and Gabriel Scherer, review by Sébastien Hinderer
and David Allsopp)
- #10311: Separate the constraint-solving part of Typecore.type_pat into
specific solver functions.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #10327: Add a subdirectories variable and a copy action to ocamltest
(Sébastien Hinderer, review by David Allsopp)
* #10337: Normalize type_expr nodes on access
One should now use accessors such as get_desc and get_level to access fields
of type_expr, rather than calling manually Btype.repr (which is now hidden
in Types.Transient_expr).
(Jacques Garrigue and Takafumi Saikawa,
review by Florian Angeletti and Gabriel Radanne)
- #10358: Use a hash table for the load path.
(Leo White, review by Gabriel Scherer)
- #8936: Per-function environment for Emit
(Greta Yorsh, review by Vincent Laviron and Florian Angeletti)
- #10307: Refactor type_description in the typing env
(Nicolas Chataing, review by Takafumi Saikawa, Florian Angeletti and Thomas
Refis)
- #10170: Maintain more structural information in type-checking errors
A mostly-internal change that preserves more information in errors
during type checking; most significantly, it split the errors from
unification, moregen, and type equality into three different types.
(Antal Spector-Zabusky and Mekhrubon Tuarev, review by Leo White,
Florian Angeletti, and Jacques Garrigue)
- #10307: Make build_other_constrs work with names instead of tags.
(Nicolas Chataing, review by Florian Angeletti)
- #10543: Fix Ast_mapper to apply the mapping function to the constants in
"interval" patterns `c1..c2`.
(Guillaume Petiot, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #7449 #10458: Change the size heuristics of switch in flambda to avoid
inlining too large jump tables. (Pierre Chambart, review by Gabriel Scherer,
report by Mark Hayden)
### Build system:
- #10289, #10406: Do not print option documentation in usage messages.
(Pavlo Khrystenko, review by Gabriel Scherer, fix by Kate Deplaix)
- #9191, #10091, #10182: take the LDFLAGS variable into account, except on
flexlink-using systems.
(Gabriel Scherer, review by Sébastien Hinderer and David Allsopp,
report by Ralph Seichter)
- #10135: Overhaul the FlexDLL bootstrap process. It's now fully integrated
with the default build target and controlled by --with-flexdll which allows
externally downloaded sources for FlexDLL to be specified. A separate
non-shared version of the runtime is built, and shared artefacts are no longer
built twice. When bootstrapping, any flexlink in PATH is now ignored and the
Cygwin port also supports bootstrapping FlexDLL. flexlink.opt is automatically
built and installed as part of opt.opt/world.opt.
(David Allsopp, review by Sébastien Hinderer)
- #10156: configure script: fix sockets feature detection.
(Lucas Pluvinage, review by David Allsopp and Damien Doligez)
- #10176: By default, call the assembler through the C compiler driver
(Sébastien Hinderer, review by Gabriel Scherer, David Allsopp and Xavier
Leroy)
- #10186: configure wasn't using library link flags when searching for
network functions on systems where they're not in libc. Fix IPv6 and
socklen_t detection on Windows.
(Antonin Décimo, review by David Allsopp and Sébastien Hinderer)
- #10332, #10333: Generate lambda/runtimedef.ml correctly in Swedish locale.
(the letter 'w' is not included in '[a-z]' in sv_SE.UTF-8)
(David Allsopp, report by Anders Jackson, review by Florian Angeletti and
Gabriel Scherer)
- #10366: Make it possible to use the OCAMLRUN variable to specify
which runtime to use while building the compilers (Sébastien Hinderer,
review by David Allsopp)
- #10451: Replace the use of iconv with a C utility to convert $(LIBDIR) to a
C string constant on Windows when building the runtime. Hardens the generation
of the constant on Unix for paths with backslashes, double-quotes and
newlines.
(David Allsopp, review by Florian Angeletti and Sébastien Hinderer)
- #10471: Fix detection of arm32 architectures with musl in configure.
(Louis Gesbert, review by David Allsopp)
### Bug fixes:
- #6654, #9774, #10401: make `include` and with `constraints` handle correctly
the ghost components of signatures. For instance, in
include struct class c = object end end type c
the type `c` shadows the `class c` to avoid shadowing only the ghost type
c introduced by the class.
(Florian Angeletti, report by Eduardo Rafael, review by Gabriel Scherer)
- #6985, #10385: remove all ghost row types from included modules
(Florian Angeletti, review by Gabriel Scherer)
- #7453, #9828, #10416: fix #show for recursive types and modules
(Florian Angeletti, review by Gabriel Scherer)
* #7469, #10408: Sys.time now returns processor time on Windows (previously
returned wall-clock time)
(David Allsopp, review by Nicolás Ojeda Bär)
* #8857, #10220: Don't clobber GetLastError() in caml_leave_blocking_section
when the systhreads library is loaded.
(David Allsopp, report by Anton Bachin, review by Xavier Leroy)
- #8575, #10362: Surprising interaction between polymorphic variants and
constructor disambiguation.
(Jacques Garrigue, report and review by Thomas Refis)
- #8917, #8929, #9889, #10219: fix printing of nested recursive definitions
in presence of a name collision.
(Florian Angeletti, report by Thomas Refis, review by Gabriel Scherer)
- #10005: Try expanding aliases in Ctype.nondep_type_rec
(Stephen Dolan, review by Gabriel Scherer, Leo White and Xavier Leroy)
- #10072, #10085: Check that sizes and offsets in stack frame descriptors
do not overflow the 16-bit fields where they are stored.
(Xavier Leroy, report by Github user pveber, review by Gabriel Scherer)
- #10087, #10138: In the toplevel REPL, don't use the cache
of included directories, so that files created or deleted while
the REPL is running are correctly handled.
(Xavier Leroy, report by Github user quakerquickoats, review by
Jeremie Dimino)
- #10294, #10295: fix an assert-failure in pattern-matching compilation
(Gabriel Scherer, review by Thomas Refis and Luc Maranget,
report by Nicolás Ojeda Bär)
- #10147, #10148: Fix building runtime with GCC on macOS.
(David Allsopp, report by John Skaller)
- #10166: Fix illegal permutation error reporting in module aliases.
(Matthew Ryan, review by Florian Angeletti)
- #10189, #10190, #10347: Universal variables leaking through GADT equations
(Jacques Garrigue, report and review by Leo White)
- #10205: Avoid overwriting closures while initialising recursive modules
(Stephen Dolan, review by Xavier Leroy, Hugo Heuzard and Vincent Laviron)
- #10253, #10373: tweak error message for unknown variant constructors
or record fields in type-directed disambiguation
(Florian Angeletti, report by Hongbo Zhang, review by Gabriel Scherer)
* #10277, #10383: Need to detect ambiguity recursively inside types to
guarantee principality (affects only principal mode)
(Jacques Garrigue, review by Thomas Refis, Leo White and Kate Deplaix)
- #10283, #10284: Enforce right-to-left evaluation order for Lstaticraise
(Vincent Laviron, report by Github user Ngoguey42, review by Gabriel Scherer)
- #10298, #10305: Incorrect propagation of type equalities in functor
application
(Jacques Garrigue, report and review by Didier Remy)
- #10324, #10325: Prevent generation of Lsend(Cached, _) in bytecode
(Vincent Laviron, report by Yawar Amin and Nicolás Ojeda Bär, review by
Jacques Garrigue)
- #10338, #10340: Translcore.push_defaults does not respect scoping
(Jacques Garrigue, report and review by Stephen Dolan)
- #10351: Fix DLL loading with binutils 2.36+ on mingw-w64
(David Allsopp, review by Nicolás Ojeda Bär)
- #10339, #10354, #10387: Fix handling of exception-raising specific
operations during spilling and liveness analysis.
(This bug affects ARM and ARM64.)
In passing, refactor Proc.op_is_pure and Mach.operation_can_raise.
(Xavier Leroy, report by Richard Bornat, review by Stephen Dolan
and Mark Shinwell)
- #10371: no longer generatd useless `.cds` file when using
`-output-complete-exe`.
(Nicolás Ojeda Bär, review by David Allsopp)
- #10376: Link runtime libraries correctly on msvc64 in -output-complete-obj
(David Allsopp, review by Gabriel Scherer)
- #10380: Correct handling of UTF-8 paths in configure on Windows
(David Allsopp, review by Sébastien Hinderer)
- #10449: Fix major GC work accounting (the GC was running too fast).
(Damien Doligez, report by Stephen Dolan, review by Nicolás Ojeda Bär
and Sadiq Jaffer)
- #10450, #10558: keep %apply and %revapply primitives working with abstract
types. This breach of backward compatibility was only present in the alpha
releases of OCaml 4.13.0 .
(Florian Angeletti, review by Thomas Refis and Leo White)
- #10454: Check row_more in nondep_type_rec.
(Leo White, review by Thomas Refis)
- #10468: Correctly pretty print local type substitution, e.g. type t := ...,
with -dsource
(Matt Else, review by Florian Angeletti)
- #10550, #10551: fix pretty-print of gadt-pattern-with-type-vars
(Chet Murthy, review by Gabriel Scherer)
- #10584, #10856: Standard Library documentation build no longer fails if
optional libraries have been disabled.
(David Allsopp, report by Yuri Victorovich review by Florian Angeletti)
- #10593: Fix untyping of patterns without named existential quantifiers. This
bug was only present in the beta version of OCaml 4.13.0.
(Ulysse Gérard, review by Florian Angeletti)
OCaml 4.12, maintenance version
-------------------------------
### Bug fixes:
- #10442, #10446: Fix regression in the toplevel to #directory caused by
corrections and improvements to the Load_path in #9611. #directory now
adds the path to the start of the load path again (so files in the newly
added directory take priority).
(David Allsopp, report by Vasile Rotaru, review by Florian Angeletti
and Nicolás Ojeda Bär)
- #10478: Fix segfault under Windows due to a mistaken initialization of thread
ID when a thread starts.
(David Allsopp, Nicolás Ojeda Bär, review by Xavier Leroy)
OCaml 4.12.0 (24 February 2021)
-------------------------------
### Supported platforms (highlights):
- #9699: add support for iOS and macOS on ARM 64 bits
(Eduardo Rafael, review by Xavier Leroy, Nicolás Ojeda Bär
and Anil Madhavapeddy, additional testing by Michael Schmidt)
### Standard library (highlights):
- #9797: Add Sys.mkdir and Sys.rmdir.
(David Allsopp, review by Nicolás Ojeda Bär, Sébastien Hinderer and
Xavier Leroy)
* #9765: add init functions to Bigarray.
(Jeremy Yallop, review by Gabriel Scherer, Nicolás Ojeda Bär, and
Xavier Leroy)
* #9668: List.equal, List.compare
(This could break code using "open List" by shadowing
Stdlib.{equal,compare}.)
(Gabriel Scherer, review by Nicolás Ojeda Bär, Daniel Bünzli and Alain Frisch)
- #9066: a new Either module with
type 'a Either.t = Left of 'a | Right of 'b
(Gabriel Scherer, review by Daniel Bünzli, Thomas Refis, Jeremy Yallop)
- #9066: List.partition_map :
('a -> ('b, 'c) Either.t) -> 'a list -> 'b list * 'c list
(Gabriel Scherer, review by Jeremy Yallop)
- #9865: add Format.pp_print_seq
(Raphaël Proust, review by Nicolás Ojeda Bär)
### Compiler user-interface and warnings (highlights):
- #9657: Warnings can now be referred to by their mnemonic name. The names are
displayed using `-warn-help` and can be utilized anywhere where a warning list
specification is expected.
ocamlc -w +fragile-match
...[@@ocaml.warning "-fragile-match"]
Note that only a single warning name at a time is supported for now:
"-w +foo-bar" does not work, you must use "-w +foo -w -bar".
(Nicolás Ojeda Bär, review by Gabriel Scherer, Florian Angeletti and
Leo White)
- #8939: Command-line option to save Linear IR before emit.
(Greta Yorsh, review by Mark Shinwell, Sébastien Hinderer and Frédéric Bour)
- #9003: Start compilation from Emit when the input file is in Linear IR format.
(Greta Yorsh, review by Jérémie Dimino, Gabriel Scherer and Frédéric Bour)
### Language features (highlights):
* #9500, #9727, #9866, #9870, #9873: Injectivity annotations
One can now mark type parameters as injective, which is useful for
abstract types:
module Vec : sig type !'a t end = struct type 'a t = 'a array end
On non-abstract types, this can be used to check the injectivity of
parameters. Since all parameters of record and sum types are by definition
injective, this only makes sense for type abbreviations:
type !'a t = 'a list
Note that this change required making the regularity check stricter.
(Jacques Garrigue, review by Jeremy Yallop and Leo White)
### Runtime system (highlights):
- #9534, #9947: Introduce a naked pointers checker mode to the runtime
(configure option --enable-naked-pointers-checker). Alarms are printed
when the garbage collector finds out-of-heap pointers that could
cause a crash in no-naked-pointers mode.
(Enguerrand Decorne, KC Sivaramakrishnan, Xavier Leroy, Stephen Dolan,
David Allsopp, Nicolás Ojeda Bär review by Xavier Leroy, Nicolás Ojeda Bär)
* #1128, #7503, #9036, #9722, #10069: EINTR-based signal handling.
When a signal arrives, avoid running its OCaml handler in the middle
of a blocking section. Instead, allow control to return quickly to
a polling point where the signal handler can safely run, ensuring that
I/O locks are not held while it runs. A polling point was removed from
caml_leave_blocking_section, and one added to caml_raise.
(Stephen Dolan, review by Goswin von Brederlow, Xavier Leroy, Damien
Doligez, Anil Madhavapeddy, Guillaume Munch-Maccagnoni and Jacques-
Henri Jourdan)
* #5154, #9569, #9734: Add `Val_none`, `Some_val`, `Is_none`, `Is_some`,
`caml_alloc_some`, and `Tag_some`. As these macros are sometimes defined by
authors of C bindings, this change may cause warnings/errors in case of
redefinition.
(Nicolás Ojeda Bär, review by Stephen Dolan, Gabriel Scherer, Mark Shinwell,
and Xavier Leroy)
* #9674: Memprof: guarantee that an allocation callback is always run
in the same thread the allocation takes place
(Jacques-Henri Jourdan, review by Stephen Dolan)
- #10025: Track custom blocks (e.g. Bigarray) with Memprof
(Stephen Dolan, review by Leo White, Gabriel Scherer and Jacques-Henri
Jourdan)
- #9619: Change representation of function closures so that code pointers
can be easily distinguished from environment variables
(Xavier Leroy, review by Mark Shinwell and Damien Doligez)
- #9654: More efficient management of code fragments.
(Xavier Leroy, review by Jacques-Henri Jourdan, Damien Doligez, and
Stephen Dolan)
### Other libraries (highlights):
- #9573: reimplement Unix.create_process and related functions without
Unix.fork, for better efficiency and compatibility with threads.
(Xavier Leroy, review by Gabriel Scherer and Anil Madhavapeddy)
- #9575: Add Unix.is_inet6_addr
(Nicolás Ojeda Bär, review by Xavier Leroy)
- #9930: new module Semaphore in the thread library, implementing
counting semaphores and binary semaphores
(Xavier Leroy, review by Daniel Bünzli and Damien Doligez,
additional suggestions by Stephen Dolan and Craig Ferguson)
* #9206, #9419: update documentation of the threads library;
deprecate Thread.kill, Thread.wait_read, Thread.wait_write,
and the whole ThreadUnix module.
(Xavier Leroy, review by Florian Angeletti, Guillaume Munch-Maccagnoni,
and Gabriel Scherer)
### Manual and documentation (highlights):
- #9755: Manual: post-processing the html generated by ocamldoc and
hevea. Improvements on design and navigation, including a mobile
version, and a quick-search functionality for the API.
(San Vũ Ngọc, review by David Allsopp and Florian Angeletti)
- #9468: HACKING.adoc: using dune to get merlin support
(Thomas Refis, review by Gabriel Scherer)
- #9684: document in address_class.h the runtime value model in
naked-pointers and no-naked-pointers mode
(Xavier Leroy and Gabriel Scherer)
### Internal/compiler-libs changes (highlights):
- #9464, #9493, #9520, #9563, #9599, #9608, #9647: refactor
the pattern-matching compiler
(Thomas Refis and Gabriel Scherer, review by Florian Angeletti)
- #9696: ocamltest now shows its log when a test fails. In addition, the log
contains the output of executed programs.
(Nicolás Ojeda Bär, review by David Allsopp, Sébastien Hinderer and Gabriel
Scherer)
### Build system (highlights):
- #9824, #9837: Honour the CFLAGS and CPPFLAGS variables.
(Sébastien Hinderer, review by David Allsopp)
- #10063: (Re-)enable building on illumos (SmartOS, OmniOS, ...) and
Oracle Solaris; x86_64/GCC and 64-bit SPARC/Sun PRO C compilers.
(partially revert #2024).
(Tõivo Leedjärv and Konstantin Romanov,
review by Gabriel Scherer, Sébastien Hinderer and Xavier Leroy)
### Language features:
- #1655: pattern aliases do not ignore type constraints
(Thomas Refis, review by Jacques Garrigue and Gabriel Scherer)
- #9429: Add unary operators containing `#` to the parser for use in ppx
rewriters
(Leo White, review by Damien Doligez)
### Runtime system:
* #9697: Remove the Is_in_code_area macro and the registration of DLL code
areas in the page table, subsumed by the new code fragment management API
(Xavier Leroy, review by Jacques-Henri Jourdan)
- #9756: garbage collector colors change
removes the gray color from the major gc
(Sadiq Jaffer and Stephen Dolan reviewed by Xavier Leroy,
KC Sivaramakrishnan, Damien Doligez and Jacques-Henri Jourdan)
* #9513: Selectively initialise blocks in `Obj.new_block`. Reject `Custom_tag`
objects and zero-length `String_tag` objects.
(KC Sivaramakrishnan, review by David Allsopp, Xavier Leroy, Mark Shinwell
and Leo White)
- #9564: Add a macro to construct out-of-heap block header.
(KC Sivaramakrishnan, review by Stephen Dolan, Gabriel Scherer,
and Xavier Leroy)