forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChanges
9249 lines (7393 loc) · 372 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
- #7557, #1726: multi-indices for extended indexing operators
(Florian Angeletti, review by Gabriel Radanne)
* #1859: --enable-force-safe-string is now the default. This can be
overridden at configure time only (introduced by 4.04 in 2016).
Unless --disable-force-safe-string is used at configure time, this
breaks code that use the '-unsafe-string' argument and C stubs that
use String_val as a char* instead of const char*
(Kate Deplaix)
### Internal/compiler-libs changes:
- #8844: Printing faulty constructors, inline records fields and their types
during type mismatches. Also slightly changed other type mismatches error
output.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White)
- #8828: Added abstractions for variants, records, constructors, fields and
extension constructor types mismatch.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White and Gabriel Scherer)
- #7927, #8527: Replace long tuples into records in typeclass.ml
(Ulugbek Abdullaev, review by David Allsopp and Gabriel Scherer)
- #1901: Fix lexing of character literals in comments
(Pieter Goetschalckx, review by Damien Doligez)
- #1932: Allow octal escape sequences and identifiers containing apostrophes
in ocamlyacc actions and comments.
(Pieter Goetschalckx, review by Damien Doligez)
- #2288: Move middle end code from [Asmgen] to [Clambda_middle_end] and
[Flambda_middle_end]. Run [Un_anf] from the middle end, not [Cmmgen].
(Mark Shinwell, review by Pierre Chambart)
- #8692: Remove Misc.may_map and similar
(Leo White, review by Gabriel Scherer and Thomas Refis)
- #8677: Use unsigned comparisons in amd64 and i386 emitter of Lcondbranch3.
(Greta Yorsh, review by Xavier Leroy)
- #8766: Parmatch: introduce a type for simplified pattern heads
(Gabriel Scherer and Thomas Refis, review by Stephen Dolan and
Florian Angeletti)
- #8774: New implementation of Env.make_copy_of_types
(Alain Frisch, review by Thomas Refis, Leo White and Jacques Garrigue)
- #7924: Use a variant instead of an int in Bad_variance exception
(Rian Douglas, review by Gabriel Scherer)
- #8890: in -dtimings output, show time spent in C linker clearly
(Valentin Gatien-Baron)
- #8910, #8911: minor improvements to the printing of module types
(Gabriel Scherer, review by Florian Angeletti)
- #8913: ocamltest: improve 'promote' implementation to take
skipped lines/bytes into account
(Gabriel Scherer, review by Sébastien Hinderer)
- #8928: Move contains_calls and num_stack_slots from Proc to Mach.fundecl
(Greta Yorsh, review by Florian Angeletti and Vincent Laviron)
### Code generation and optimizations:
- #8672: Optimise Switch code generation on booleans.
(Stephen Dolan, review by Pierre Chambart)
- #2322: Add pseudo-instruction `Ladjust_trap_depth` to replace
dummy Lpushtrap generated in linearize
(Greta Yorsh and Vincent Laviron, review by Xavier Leroy)
- #8707: Simplif: more regular treatment of Tupled and Curried functions
(Gabriel Scherer, review by Leo White and Alain Frisch)
- #8526: Add compile-time option -function-sections in ocamlopt to emit
each function in a separate named text section on supported targets.
(Greta Yorsh, review by Pierre Chambart)
- #2321: Eliminate dead ICatch handlers
(Greta Yorsh, review by Pierre Chambart and Vincent Laviron)
- #8919: lift mutable lets along with immutable ones
(Leo White, review by Pierre Chambart)
### Runtime system:
- #8619: Ensure Gc.minor_words remains accurate after a GC.
(Stephen Dolan, Xavier Leroy and David Allsopp,
review by Xavier Leroy and Gabriel Scherer)
* #8711: The major GC hooks are no longer allowed to interact with the
OCaml heap.
(Jacques-Henri Jourdan, review by Damien Doligez)
- #8691, #8897: Allocation functions are now guaranteed not to trigger any
OCaml callback when called from C.
(Jacques-Henri Jourdan, review by Stephen Dolan and Gabriel Scherer)
- #8630: Use abort() instead of exit(2) in caml_fatal_error, and add
the new hook caml_fatal_error_hook.
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #8713: Introduce a state table in the runtime to contain the global variables
which must be duplicated for each domain in the multicore runtime.
(KC Sivaramakrishnan and Stephen Dolan, compatibility header hacking by
David Allsopp, review by David Allsopp, Alain Frisch, Nicolas Ojeda Bar,
Gabriel Scherer and Damien Doligez)
### Tools:
* #6792, #8654 ocamldebug now supports program using Dynlink. This
breaks compatibility with emacs modes.
(Whitequark and Jacques-Henri Jourdan, review by Gabriel Scherer
and Xavier Clerc)
### Standard library:
- #8832: List.find_map : ('a -> 'b option) -> 'a list -> 'b option
(Gabriel Scherer, review by Jeremy Yallop, Nicolás Ojeda Bär
and Daniel Bünzli)
- #8657: Optimization in [Array.make] when initializing with unboxed
or young values.
(Jacques-Henri Jourdan, review by Gabriel Scherer and Stephen Dolan)
- #8634: Statistical memory profiling provided by the Gc.Memprof
module.
Incomplete version: does not sample objects allocated in the minor
heap in native mode
(Jacques-Henri Jourdan, review by Stephen Dolan, Gabriel Scherer and
Damien Doligez)
- #7672, #1492: Add `Filename.quote_command` to produce properly-quoted
commands for execution by Sys.command.
(Xavier Leroy, review by David Allsopp and Damien Doligez)
- #8716: Optimize [Array.fill] and [Hashtbl.clear] with a new runtime primitive
(Alain Frisch, review by David Allsopp, Stephen Dolan and Damien Doligez)
- #8530: List.sort: avoid duplicate work by chop
(Guillaume Munch-Maccagnoni, review by David Allsopp, Damien Doligez and
Gabriel Scherer)
### Other libraries:
- #1939, #2023: Implement Unix.truncate and Unix.ftruncate on Windows.
(Florent Monnier and Nicolás Ojeda Bär, review by David Allsopp)
### Manual and documentation:
- #8950: manual, move local opens in pattern out of the extension chapter
(Florian Angeletti, review and suggestion by Gabriel Scherer)
### Compiler user-interface and warnings:
- #8833: Hint for (type) redefinitions in toplevel session
(Florian Angeletti, review by Gabriel Scherer)
- #2127: Refactor lookup functions
Included observable changes:
- makes the location of usage warnings and alerts for constructors more
precise
- don't warn about a constructor never being used to build values when it
has been defined as private
(Leo White, review by Thomas Refis)
- #8885: Warn about unused local modules
(Thomas Refis, review by Alain Frisch)
### Build system:
- #8650: ensure that "make" variables are defined before use;
revise generation of config/util.ml to better quote special characters
(Xavier Leroy, review by David Allsopp)
- #8690, #8696: avoid rebuilding the world when files containing primitives
change.
(Stephen Dolan, review by Gabriel Scherer, Sébastien Hinderer and
Thomas Refis)
- #8837: build manpages using ocamldoc.opt when available
cuts the manpages build time from 14s to 4s
(Gabriel Scherer, review by David Allsopp and Sébastien Hinderer,
report by David Allsopp)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
### Compiler user-interface and warnings:
- #8702, #8777: improved error messages for fixed row polymorphic variants
(Florian Angeletti, report by Leo White, review by Thomas Refis)
- #8874: add tests for typechecking error messages and pack them into
pretty-printing boxes.
(Oxana Kostikova, review by Gabriel Scherer)
- #8914: clarify the warning on unboxable types used in external primitives (61)
(Gabriel Scherer, review by Florian Angeletti, report on the Discourse forum)
### Bug fixes:
- #7925, #8611: fix error highlighting for exceptionally
long toplevel phrases
(Kyle Miller, reported by Armaël Guéneau, review by Armaël Guéneau
and Nicolás Ojeda Bär)
- #8622: Don't generate #! headers over 127 characters.
(David Allsopp, review by Xavier Leroy and Stephen Dolan)
- #8715: minor bugfixes in CamlinternalFormat; removes the unused
and misleading function CamlinternalFormat.string_of_formatting_gen
(Gabriel Scherer and Florian Angeletti,
review by Florian Angeletti and Gabriel Radanne)
- #8875: fix missing newlines in the output from MSVC invocation.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #8921, #8924: Fix stack overflow with Flambda
(Vincent Laviron, review by Pierre Chambart and Leo White,
report by Aleksandr Kuzmenko)
OCaml 4.09 maintenance branch:
------------------------------
- #8953, #8954: Fix error submessages in the toplevel: do not display
dummy locations
(Armaël Guéneau, review by Gabriel Scherer)
OCaml 4.09.0 (19 September 2019):
---------------------------------
### Runtime system:
* #1725, #2279: Deprecate Obj.set_tag and Obj.truncate
(Stephen Dolan, review by Gabriel Scherer, Damien Doligez and Xavier Leroy)
* #2240: Constify "identifier" in struct custom_operations
(Cedric Cellier, review by Xavier Leroy)
* #2293: Constify "caml_named_value"
(Stephen Dolan, review by Xavier Leroy)
- #8787, #8788: avoid integer overflow in caml_output_value_to_bytes
(Jeremy Yallop, report by Marcello Seri)
- #2075, #7729: rename _T macro used to support Unicode in the (Windows) runtime
in order to avoid compiler warning
(Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
- #2250: Remove extra integer sign-extension in compare functions
(Stefan Muenzel, review by Xavier Leroy)
- #8607: Remove obsolete macros for pre-2002 MSVC support
(Stephen Dolan, review by Nicolás Ojeda Bär and David Allsopp)
- #8656: Fix a bug in [caml_modify_generational_global_root]
(Jacques-Henri Jourdan, review by Gabriel Scherer)
### Standard library:
- #2262: take precision (.<n>) and flags ('+' and ' ') into account
in printf %F
(Pierre Roux, review by Gabriel Scherer)
- #6148, #8596: optimize some buffer operations
(Damien Doligez, reports by John Whitington and Alain Frisch,
review by Jeremy Yallop and Gabriel Scherer)
### Other libraries:
* #2318: Delete the graphics library. This library is now available
as a separate "graphics" package in opam. Its new home is:
https://github.com/ocaml/graphics
(Jérémie Dimino, review by Nicolas Ojeda Bar, Xavier Leroy and
Sébastien Hinderer)
* #2289: Delete the vmthreads library. This library was deprecated in 4.08.0.
(Jérémie Dimino)
- #2112: Fix Thread.yield unfairness with busy threads yielding to each
other.
(Andrew Hunter, review by Jacques-Henri Jourdan, Spiros Eliopoulos, Stephen
Weeks, & Mark Shinwell)
- #7903, #2306: Make Thread.delay interruptible by signals again
(Xavier Leroy, review by Jacques-Henri Jourdan and Edwin Török)
- #2248: Unix alloc_sockaddr: Fix read of uninitialized memory for an
unbound Unix socket. Add support for receiving abstract (Linux) socket paths.
(Tim Cuthbertson, review by Sébastien Hinderer and Jérémie Dimino)
- #2165: better unboxing heuristics for let-bound identifiers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)
### Compiler user-interface and warnings:
* #2276: Remove support for compiler plugins and hooks (also adds
[Dynlink.unsafe_get_global_value])
(Mark Shinwell, Xavier Clerc, review by Nicolás Ojeda Bär,
Florian Angeletti, David Allsopp and Xavier Leroy)
- #2301: Hint on type error on int literal
(Jules Aguillon, review by Nicolás Ojeda Bär , Florian Angeletti,
Gabriel Scherer and Armaël Guéneau)
* #2314: Remove support for gprof profiling.
(Mark Shinwell, review by Xavier Clerc and Stephen Dolan)
- #2190: fix pretty printing (using Pprintast) of "lazy ..." patterns and
"fun (type t) -> ..." expressions.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #2277: Use newtype names as type variable names
The inferred type of (fun (type t) (x : t) -> x)
is now printed as ('t -> 't) rather than ('a -> 'a).
(Matthew Ryan)
- #2309: New options -with-runtime and -without-runtime in ocamlopt/ocamlc
that control the inclusion of the runtime system in the generated program.
(Lucas Pluvinage, review by Daniel Bünzli, Damien Doligez, David Allsopp
and Florian Angeletti)
- #3819, #8546 more explanations and tests for illegal permutation
(Florian Angeletti, review by Gabriel Scherer)
- #8537: fix the -runtime-variant option for bytecode
(Damien Doligez, review by David Allsopp)
- #8541: Correctly print multi-lines locations
(Louis Roché, review by Gabriel Scherer)
- #8579: Better error message for private constructors
of an extensible variant type
(Guillaume Bury, review by many fine eyes)
### Code generation and optimizations:
- #2278: Remove native code generation support for 32-bit Intel macOS,
iOS and other Darwin targets.
(Mark Shinwell, review by Nicolas Ojeda Bar and Xavier Leroy)
- #8547: Optimize matches that are an affine function of the input.
(Stefan Muenzel, review by Alain Frisch, Gabriel Scherer)
- #1904, #7931: Add FreeBSD/aarch64 support
(Greg V, review by Sébastien Hinderer, Stephen Dolan, Damien Doligez
and Xavier Leroy)
- #8507: Shorten symbol names of anonymous functions in Flambda mode
(the directory portions are now hidden)
(Mark Shinwell, review by Nicolás Ojeda Bär)
- #8681, #8699, #8712: Fix code generation with nested let rec of functions.
(Stephen Dolan, Leo White, Gabriel Scherer and Pierre Chambart,
review by Gabriel Scherer, reports by Alexey Solovyev and Jonathan French)
### Manual and documentation:
- #7584, #8538: Document .cmt* files in the "overview" of ocaml{c,opt}
(Oxana Kostikova, rewiew by Florian Angeletti)
- #8757: Rename Pervasives to Stdlib in core library documentation.
(Ian Zimmerman, review by David Allsopp)
- #8515: manual, precise constraints on reexported types
(Florian Angeletti, review by Gabriel Scherer)
### Tools:
- #2221: ocamldep will now correctly allow a .ml file in an include directory
that appears first in the search order to shadow a .mli appearing in a later
include directory.
(Nicolás Ojeda Bär, review by Florian Angeletti)
### Internal/compiler-libs changes:
- #1579: Add a separate types for clambda primitives
(Pierre Chambart, review by Vincent Laviron and Mark Shinwell)
- #1965: remove loop constructors in Cmm and Mach
(Vincent Laviron)
- #1973: fix compilation of catches with multiple handlers
(Vincent Laviron)
- #2228, #8545: refactoring the handling of .cmi files
by moving the logic from Env to a new module Persistent_env
(Gabriel Scherer, review by Jérémie Dimino and Thomas Refis)
- #2229: Env: remove prefix_idents cache
(Thomas Refis, review by Frédéric Bour and Gabriel Scherer)
- #2237, #8582: Reorder linearisation of Trywith to avoid a call instruction
(Vincent Laviron and Greta Yorsh, additional review by Mark Shinwell;
fix in #8582 by Mark Shinwell, Xavier Leroy and Anil Madhavapeddy)
- #2265: Add bytecomp/opcodes.mli
(Mark Shinwell, review by Nicolas Ojeda Bar)
- #2268: Improve packing mechanism used for building compilerlibs modules
into the Dynlink libraries
(Mark Shinwell, Stephen Dolan, review by David Allsopp)
- #2280: Don't make more Clambda constants after starting Cmmgen
(Mark Shinwell, review by Vincent Laviron)
- #2281: Move some middle-end files around
(Mark Shinwell, review by Pierre Chambart and Vincent Laviron)
- #2283: Add [is_prefix] and [find_and_chop_longest_common_prefix] to
[Misc.Stdlib.List]
(Mark Shinwell, review by Alain Frisch and Stephen Dolan)
- #2284: Add various utility functions to [Misc] and remove functions
from [Misc.Stdlib.Option] that are now in [Stdlib.Option]
(Mark Shinwell, review by Thomas Refis)
- #2286: Functorise [Consistbl]
(Mark Shinwell, review by Gabriel Radanne)
- #2291: Add [Compute_ranges] pass
(Mark Shinwell, review by Vincent Laviron)
- #2292: Add [Proc.frame_required] and [Proc.prologue_required].
Move tail recursion label creation to [Linearize]. Correctly position
[Lprologue] relative to [Iname_for_debugger] operations.
(Mark Shinwell, review by Vincent Laviron)
- #2308: More debugging information on [Cmm] terms
(Mark Shinwell, review by Stephen Dolan)
- #7878, #8542: Replaced TypedtreeIter with tast_iterator
(Isaac "Izzy" Avram, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #8598: Replace "not is_nonexpansive" by "maybe_expansive".
(Thomas Refis, review by David Allsopp, Florian Angeletti, Gabriel Radanne,
Gabriel Scherer and Xavier Leroy)
### Compiler distribution build system:
- #2267: merge generation of header programs, also fixing parallel build on
Cygwin.
(David Allsopp, review by Sébastien Hinderer)
- #8514: Use boot/ocamlc.opt for building, if available.
(Stephen Dolan, review by Gabriel Scherer)
### Bug fixes:
- #8864, #8865: Fix native compilation of left shift by (word_size - 1)
(Vincent Laviron, report by Murilo Giacometti Rocha, review by Xavier Leroy)
- #2296: Fix parsing of hexadecimal floats with underscores in the exponent.
(Hugo Heuzard and Xavier Leroy, review by Gabriel Scherer)
- #8800: Fix soundness bug in extension constructor inclusion
(Leo White, review by Jacques Garrigue)
- #8848: Fix x86 stack probe CFI information in caml_c_call and
caml_call_gc
(Tom Kelly, review by Xavier Leroy)
- #7156, #8594: make top level use custom printers if they are available
(Andrew Litteken, report by Martin Jambon, review by Nicolás Ojeda Bär,
Thomas Refis, Armaël Guéneau, Gabriel Scherer, David Allsopp)
- #3249: ocamlmklib should reject .cmxa files
(Xavier Leroy)
- #7937, #2287: fix uncaught Unify exception when looking for type
declaration
(Florian Angeletti, review by Jacques Garrigue)
- #8610, #8613: toplevel printing, consistent deduplicated name for types
(Florian Angeletti, review by Thomas Refis and Gabriel Scherer,
reported by Xavier Clerc)
- #8635, #8636: Fix a bad side-effect of the -allow-approx option of
ocamldep. It used to turn some errors into successes
(Jérémie Dimino)
- #8701, #8725: Variance of constrained parameters causes principality issues
(Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
- #8777(partial): fix position information in some polymorphic variant
error messages about missing tags
(Florian Angeletti, review by Thomas Refis)
- #8779, more cautious variance computation to avoid missing cmis
(Florian Angeletti, report by Antonio Nuno Monteiro, review by Leo White)
- #8810: Env.lookup_module: don't allow creating loops
(Thomas Refis, report by Leo White, review by Jacques Garrigue)
- #8862, #8871: subst: preserve scopes
(Thomas Refis, report by Leo White, review by Jacques Garrigue)
- #8921, #8924: Fix stack overflow with Flambda
(Vincent Laviron, review by Pierre Chambart and Leo White,
report by Aleksandr Kuzmenko)
- #8944: Fix "open struct .. end" on clambda backend
(Thomas Refis, review by Leo White, report by Damon Wang and Mark Shinwell)
OCaml 4.08.1 (5 August 2019)
----------------------------
### Bug fixes:
- #7887: ensure frame table is 8-aligned on ARM64 and PPC64
(Xavier Leroy, report by Mark Hayden, review by Mark Shinwell
and Gabriel Scherer)
- #8751: fix bug that could result in misaligned data section when compiling to
native-code on amd64. (observed with the mingw64 compiler)
(Nicolás Ojeda Bär, review by David Allsopp)
- #8769, #8770: Fix assertion failure with -pack
(Leo White, review by Gabriel Scherer, report by Fabian @copy)
- #8816, #8818: fix loading of packed modules with Dynlink (regression in
#2176).
(Leo White, report by Andre Maroneze, review by Gabriel Scherer)
- #8830: configure script: fix tool prefix detection and Debian's armhf
detection
(Stéphane Glondu, review by David Allsopp)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
OCaml 4.08.0 (13 June 2019)
---------------------------
### Language features:
- #1947: Introduce binding operators (let*, let+, and* etc.)
(Leo White, review by Thomas Refis)
- #1892: Allow shadowing of items coming from an include
(Thomas Refis, review by Gabriel Radanne)
- #2122: Introduce local substitutions in signatures: "type t := type_expr"
and "module M := Extended(Module).Path"
(Thomas Refis, with help and review from Leo White, and Alain Frisch)
- #1804: New notion of "alerts" that generalizes the deprecated warning
[@@ocaml.alert deprecated "Please use bar instead!"]
[@@ocaml.alert unsafe "Please use safe_foo instead!"]
(Alain Frisch, review by Leo White and Damien Doligez)
- #6422, #7083, #305, #1568: Allow `exception` under or-patterns
(Thomas Refis, with help and review from Alain Frisch, Gabriel Scherer, Jeremy
Yallop, Leo White and Luc Maranget)
- #1705: Allow @@attributes on exception declarations.
(Hugo Heuzard, review by Gabriel Radanne and Thomas Refis)
- #1506, #2147, #2166, #2167: Extended `open` to arbitrary module
expression in structures and to applicative paths in signatures
(Runhang Li, review by Alain Frisch, Florian Angeletti, Jeremy Yallop,
Leo White and Thomas Refis)
* #2106: .~ is now a reserved keyword, and is no longer available
for use in extended indexing operators
(Jeremy Yallop, review by Gabriel Scherer, Florian Angeletti, and
Damien Doligez)
* #7841, #2041, #2235: allow modules from include directories
to shadow other ones, even in the toplevel; for a example, including
a directory that defines its own Result module will shadow the stdlib's.
(Jérémie Dimino, review by Alain Frisch and David Allsopp)
### Type system:
- #2110: Partial support for GADTs inside or-patterns;
The type equalities introduced by the GADT constructor are only
available inside the or-pattern; they cannot be used in the
right-hand-side of the clause, when both sides of the or-pattern
agree on it.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1826: allow expanding a type to a private abbreviation instead of
abstracting when removing references to an identifier.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1942, #2244: simplification of the static check
for recursive definitions
(Alban Reynaud and Gabriel Scherer,
review by Jeremy Yallop, Armaël Guéneau and Damien Doligez)
### Standard library:
- #2128: Add Fun module: `id, const, flip, negate, protect`
(protect is a "try_finally" combinator)
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Fun.html
(Many fine eyes)
- #2010: Add Bool module
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Bool.html
(Many fine eyes)
- #2011: Add Int module
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Int.html
(Many fine eyes)
- #1940: Add Option module and Format.pp_print_option
`none, some, value, get, bind, join, map, fold, iter`, etc.
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Option.html
(Many fine eyes)
- #1956: Add Result module and Format.pp_print_result
`ok, error, value, get_ok, bind, join, map, map_error`, etc.
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Result.html
(Many fine eyes)
- #1855, #2118: Add `Fun.protect ~finally` for enforcing local
invariants whether a function raises or not, similar to
`unwind-protect` in Lisp and `FINALLY` in Modula-2. It is careful
about preserving backtraces and treating exceptions in finally as
errors.
(Marcello Seri and Guillaume Munch-Maccagnoni, review by Daniel
Bünzli, Gabriel Scherer, François Bobot, Nicolás Ojeda Bär, Xavier
Clerc, Boris Yakobowski, Damien Doligez, and Xavier Leroy)
* #1605: Deprecate Stdlib.Pervasives. Following #1010, Pervasives
is no longer needed and Stdlib should be used instead.
(Jérémie Dimino, review by Nicolás Ojeda Bär)
- #2185: Add `List.filter_map`
(Thomas Refis, review by Alain Frisch and Gabriel Scherer)
- #1957: Add Stack.{top_opt,pop_opt} and Queue.{peek_opt,take_opt}.
(Vladimir Keleshev, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #1182: Add new Printf formats %#d %#Ld %#ld %#nd (idem for %i and %u) for
alternative integer formatting -- inserts '_' between blocks of digits.
(ygrek, review by Gabriel Scherer)
- #1959: Add Format.dprintf, a printing function which outputs a closure
usable with %t.
(Gabriel Radanne, request by Armaël Guéneau,
review by Florian Angeletti and Gabriel Scherer)
- #1986, #6450: Add Set.disjoint
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #7812, #2125: Add Filename.chop_suffix_opt
(Alain Frisch, review by Nicolás Ojeda Bär, suggestion by whitequark)
- #1864: Extend Bytes and Buffer with functions to read/write
binary representations of numbers
(Alain Frisch and Daniel Bünzli)
- #1458: Add unsigned operations unsigned_div, unsigned_rem, unsigned_compare
and unsigned_to_int to modules Int32, Int64, Nativeint.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Alain Frisch and Max Mouratov)
- #2002: Add Format.pp_print_custom_break, a new more general kind of break
hint that can emit non-whitespace characters.
(Vladimir Keleshev and Pierre Weis, review by Josh Berdine, Gabriel Radanne)
- #1966: Add Format semantic tags using extensible sum types.
(Gabriel Radanne, review by Nicolás Ojeda Bär)
- #1794: Add constants zero, one, minus_one and functions succ,
pred, is_finite, is_infinite, is_nan, is_integer, trunc, round,
next_after, sign_bit, min, max, min_max, min_num, max_num,
min_max_num to module Float.
(Christophe Troestler, review by Alain Frish, Xavier Clerc and Daniel Bünzli)
- #1354, #2177: Add fma support to Float module.
(Laurent Thévenoux, review by Alain Frisch, Jacques-Henri Jourdan,
Xavier Leroy)
- #5072, #6655, #1876: add aliases in Stdlib for built-in types
and exceptions.
(Jeremy Yallop, reports by Pierre Letouzey and David Sheets,
review by Valentin Gatien-Baron, Gabriel Scherer and Alain Frisch)
- #1731: Format, use raise_notrace to preserve backtraces.
(Frédéric Bour, report by Jules Villard, review by Gabriel Scherer)
- #6701, #1185, #1803: make float_of_string and string_of_float
locale-independent.
(ygrek, review by Xavier Leroy and Damien Doligez)
- #7795, #1782: Fix off-by-one error in Weak.create.
(KC Sivaramakrishnan, review by Gabriel Scherer and François Bobot)
- #7235: Format, flush err_formatter at exit.
(Pierre Weis, request by Jun Furuse)
- #1857, #7812: Remove Sort module, deprecated since 2000 and emitting
a deprecation warning since 4.02.
(whitequark)
- #1923: Arg module sometimes misbehaved instead of rejecting invalid
-keyword=arg inputs
(Valentin Gatien-Baron, review by Gabriel Scherer)
- #1959: Small simplification and optimization to Format.ifprintf
(Gabriel Radanne, review by Gabriel Scherer)
- #2119: clarify the documentation of Set.diff
(Gabriel Scherer, suggestion by John Skaller)
- #2145: Deprecate the mutability of Gc.control record fields
(Damien Doligez, review by Alain Frisch)
- #2159, #7874: annotate {String,Bytes}.equal as being [@@noalloc].
(Pierre-Marie Pédrot, review by Nicolás Ojeda Bär)
- #1936: Add module Float.Array
(Damien Doligez, review by Xavier Clerc and Alain Frisch)
- #2183: Fix segfault in Array.create_float with -no-flat-float-array
(Damien Doligez, review by Gabriel Scherer and Jeremy Yallop)
- #1525: Make function set_max_indent respect documentation
(Pierre Weis, Richard Bonichon, review by Florian Angeletti)
- #2202: Correct Hashtbl.MakeSeeded.{add_seq,replace_seq,of_seq} to use
functor hash function instead of default hash function. Hashtbl.Make.of_seq
shouldn't create randomized hash tables.
(David Allsopp, review by Alain Frisch)
### Other libraries:
- #2533, #1839, #1949: added Unix.fsync
(Francois Berenger, Nicolás Ojeda Bär, review by Daniel Bünzli, David Allsopp
and ygrek)
- #1792, #7794: Add Unix.open_process_args{,_in,_out,_full} similar to
Unix.open_process{,_in,_out,_full}, but passing an explicit argv array.
(Nicolás Ojeda Bär, review by Jérémie Dimino, request by Volker Diels-Grabsch)
- #1999: Add Unix.process{,_in,_out,_full}_pid to retrieve opened process's
pid.
(Romain Beauxis, review by Nicolás Ojeda Bär)
- #2222: Set default status in waitpid when pid is zero. Otherwise,
status value is undefined.
(Romain Beauxis and Xavier Leroy, review by Stephen Dolan)
* #2104, #2211, #4127, #7709: Fix Thread.sigmask. When
system threads are loaded, Unix.sigprocmask is now an alias for
Thread.sigmask. This changes the behavior at least on MacOS, where
Unix.sigprocmask used to change the masks of all threads.
(Jacques-Henri Jourdan, review by Jérémie Dimino)
- #1061: Add ?follow parameter to Unix.link. This allows hardlinking
symlinks.
(Christopher Zimmermann, review by Xavier Leroy, Damien Doligez, David
Allsopp, David Sheets)
- #2038: Deprecate vm threads.
OCaml supported both "native threads", based on pthreads,
and its own green-threads implementation, "vm threads". We are not
aware of any recent usage of "vm threads", and removing them simplifies
further maintenance.
(Jérémie Dimino)
* #4208, #4229, #4839, #6462, #6957, #6950, #1063, #2176,
#2297: Make (nat)dynlink sound by correctly failing when
dynlinked module names clash with other modules or interfaces.
(Mark Shinwell, Leo White, Nicolás Ojeda Bär, Pierre Chambart)
- #2263: Delete the deprecated Bigarray.*.map_file functions in
favour of `*_of_genarray (Unix.map_file ...)` functions instead. The
`Unix.map_file` function was introduced in OCaml 4.06.0 onwards.
(Jérémie Dimino, reviewed by David Allsopp and Anil Madhavapeddy)
### Compiler user-interface and warnings:
- #2096: Add source highlighting for errors & warnings in batch mode
(Armaël Guéneau, review by Gabriel Scherer and Jérémie Dimino)
- #2133: [@ocaml.warn_on_literal_pattern]: now warn on literal patterns
found anywhere in a constructor's arguments.
(Jeremy Yallop, review by Gabriel Scherer)
- #1720: Improve error reporting for missing 'rec' in let-bindings.
(Arthur Charguéraud and Armaël Guéneau, with help and advice
from Gabriel Scherer, Frédéric Bour, Xavier Clerc and Leo White)
- #7116, #1430: new -config-var option
to get the value of a single configuration variable in scripts.
(Gabriel Scherer, review by Sébastien Hinderer and David Allsopp,
request by Adrien Nader)
- #1733,1993,1998,2058,2094,2140: Typing error message improvements
- #1733, change the perspective of the unexpected existential error
message.
- #1993, expanded error messages for universal quantification failure
- #1998, more context for unbound type parameter error
- #2058, full explanation for unsafe cycles in recursive module
definitions (suggestion by Ivan Gotovchits)
- #2094, rewording for "constructor has no type" error
- #7565, #2140, more context for universal variable escape
in method type
(Florian Angeletti, reviews by Jacques Garrique, Armaël Guéneau,
Gabriel Radanne, Gabriel Scherer and Jeremy Yallop)
- #1913: new flag -dump-into-file to print debug output like -dlambda into
a file named after the file being built, instead of on stderr.
(Valentin Gatien-Baron, review by Thomas Refis)
- #1921: in the compilation context passed to ppx extensions,
add more configuration options related to type-checking:
-rectypes, -principal, -alias-deps, -unboxed-types, -unsafe-string
(Gabriel Scherer, review by Gabriel Radanne, Xavier Clerc and Frédéric Bour)
- #1976: Better error messages for extension constructor type mismatches
(Thomas Refis, review by Gabriel Scherer)
- #1841, #7808: the environment variable OCAMLTOP_INCLUDE_PATH can now
specify a list of additional include directories for the ocaml toplevel.
(Nicolás Ojeda Bär, request by Daniel Bünzli, review by Daniel Bünzli and
Damien Doligez)
- #6638, #1110: introduced a dedicated warning to report
unused "open!" statements
(Alain Frisch, report by dwang, review by and design from Leo White)
- #1974: Trigger warning 5 in "let _ = e" and "ignore e" if e is of function
type and syntactically an application. (For the case of "ignore e" the warning
already existed, but used to be triggered even when e was not an application.)
(Nicolás Ojeda Bär, review by Alain Frisch and Jacques Garrigue)
- #7408, #7846, #2015: Check arity of primitives.
(Hugo Heuzard, review by Nicolás Ojeda Bär)
- #2091: Add a warning triggered by type declarations "type t = ()"
(Armaël Guéneau, report by linse, review by Florian Angeletti and Gabriel
Scherer)
- #2004: Use common standard library path `lib/ocaml` for Windows,
for consistency with OSX & Linux. Previously was located at `lib`.
(Bryan Phelps, Jordan Walke, review by David Allsopp)
- #6416, #1120: unique printed names for identifiers
(Florian Angeletti, review by Jacques Garrigue)
- #1691: add shared_libraries to ocamlc -config exporting
SUPPORTS_SHARED_LIBRARIES from Makefile.config.
(David Allsopp, review by Gabriel Scherer and Mark Shinwell)
- #6913, #1786: new -match-context-rows option
to control the degree of optimization in the pattern matching compiler.
(Dwight Guth, review by Gabriel Scherer and Luc Maranget)
- #1822: keep attributes attached to pattern variables from being discarded.
(Nicolás Ojeda Bär, review by Thomas Refis)
- #1845: new `-dcamlprimc` option to keep the generated C file containing
the information about primitives; pass `-fdebug-prefix-map` to the C compiler
when supported, for reproducible builds
(Xavier Clerc, review by Jérémie Dimino)
- #1856, #1869: use `BUILD_PATH_PREFIX_MAP` when compiling primitives
in order to make builds reproducible if code contains uses of
`__FILE__` or `__LOC__`
(Xavier Clerc, review by Gabriel Scherer and Sébastien Hinderer)
- #1906: the -unsafe option does not apply to marshalled ASTs passed
to the compiler directly or by a -pp preprocessor; add a proper
warning (64) instead of a simple stderr message
(Valentin Gatien-Baron)
- #1925: Print error locations more consistently between batch mode, toplevel
and expect tests
(Armaël Guéneau, review by Thomas Refis, Gabriel Scherer and François Bobot)
- #1930: pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler
(Xavier Clerc, review by Gabriel Scherer, Sébastien Hinderer, and
Xavier Leroy)
- #1945, #2032: new "-stop-after [parsing|typing]" option
to stop compilation after the parsing or typing pass
(Gabriel Scherer, review by Jérémie Dimino)
- #1953: Add locations to attributes in the parsetree.
(Hugo Heuzard, review by Gabriel Radanne)
- #1954: Add locations to toplevel directives.
(Hugo Heuzard, review by Gabriel Radanne)
* #1979: Remove support for TERM=norepeat when displaying errors
(Armaël Guéneau, review by Gabriel Scherer and Florian Angeletti)
- #1960: The parser keeps previous location when relocating ast node.
(Hugo Heuzard, review by Jérémie Dimino)
- #7864, #2109: remove duplicates from spelling suggestions.
(Nicolás Ojeda Bär, review by Armaël Guéneau)
### Manual and documentation:
- #7548: printf example in the tutorial part of the manual
(Kostikova Oxana, rewiew by Gabriel Scherer, Florian Angeletti,
Marcello Seri and Armaël Guéneau)
- #7546, #2020: preambles and introduction for compiler-libs.
(Florian Angeletti, review by Daniel Bünzli, Perry E. Metzger
and Gabriel Scherer)
- #7547, #2273: Tutorial on Lazy expressions and patterns in OCaml Manual
(Ulugbek Abdullaev, review by Florian Angeletti and Gabriel Scherer)
- #7720, #1596, precise the documentation
of the maximum indentation limit in Format.
(Florian Angeletti, review by Richard Bonichon and Pierre Weis)
- #7825: html manual split compilerlibs from stdlib in the html
index of modules
(Florian Angeletti, review by Perry E. Metzger and Gabriel Scherer)
- #1209, #2008: in the Extension section, use the caml_example environment
(uses the compiler to check the example code).
This change was made possible by a lot of tooling work from Florian Angeletti:
#1702, #1765, #1863, and Gabriel Scherer's #1903.
(Gabriel Scherer, review by Florian Angeletti)
- #1788, 1831, 2007, 2198, 2232, move language extensions to the core
chapters:
- #1788: quoted string description
- #1831: local exceptions and exception cases
- #2007: 32-bit, 64-bit and native integer literals
- #2198: lazy patterns
- #2232: short object copy notation
(Florian Angeletti, review by Xavier Clerc, Perry E. Metzger, Gabriel Scherer
and Jeremy Yallop)
- #1863: caml-tex2, move to compiler-libs
(Florian Angeletti, review by Sébastien Hinderer and Gabriel Scherer)
- #2105: Change verbatim to caml_example in documentation
(Maxime Flin, review by Florian Angeletti)
- #2114: ocamldoc, improved manpages for documentation inside modules
(Florian Angeletti, review by Gabriel Scherer)
- #2117: stdlib documentation, duplicate the operator precedence table
from the manual inside a separate "OCaml_operators" module.
(Florian Angeletti, review by Daniel Bünzli, Perry E. Metzger
and Gabriel Scherer)
- #2187: document "exception A | pat" patterns
(Florian Angeletti, review by Perry E. Metzger and Jeremy Yallop)
- #8508: refresh \moduleref macro
(Florian Angeletti, review by Gabriel Scherer)
### Code generation and optimizations:
- #7725, #1754: improve AFL instrumentation for objects and lazy values.
(Stephen Dolan)
- #1631: AMD64 code generator: emit shorter instruction sequences for the
sign-extension operations.
(LemonBoy, review by Alain Frisch and Xavier Leroy)
- #7246, #2146: make a few int64 primitives use [@@unboxed]
stubs on 32bits
(Jérémie Dimino)
- #1917: comballoc: ensure object allocation order is preserved
(Stephen Dolan)
- #6242, #2143, #8558, #8559: Optimize some local functions.
Local functions that do not escape and whose calls all have
the same continuation are lowered into a static-catch handler.
(Alain Frisch, review by Gabriel Scherer)
- #2082: New options [-insn-sched] and [-no-insn-sched] to control
instruction scheduling.
(Mark Shinwell, review by Damien Doligez)