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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079
|
OCaml 5.4.0
---------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #13097: added immutable arrays (`'a iarray` type, Iarray stdlib module)
(Antal Spector-Zabusky and Olivier Nicole, review by Gabriel Scherer,
Jeremy Yallop and Vincent Laviron)
- #13340: Array literal syntax [| e1; ...; en |] can now be used to
denote values of type `'a array` and `'a iarray` 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)
- #13498: Tuple fields are now optionally labeled:
`(x:42, y:0)` and `let (~x, ~y) = ... in ...`.
(Ryan Tjoa and Chris Casinghino, review by Gabriel Scherer, Chris Casinghino,
and Leo White)
- RFCs#39, #13404: atomic record fields
`{ ...; mutable readers : int [@atomic]; ... }`
`Atomic.Loc.fetch_and_add [%atomic.loc data.readers] 1`
(Clément Allain and Gabriel Scherer, review by KC Sivaramakrishnan,
Basile Clément and Olivier Nicole)
### Standard library:
* #14124: Do not raise Invalid_argument on negative List.{drop,take}.
(Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär)
- #13696: Add Result.product and Result.Syntax:
`let open Result.Syntax in let* x = ... in ...`
(Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär)
- #12871: Add the Pqueue module to the stdlib. It implements priority queues.
(Jean-Christophe Filliâtre, review by Daniel Bünzli, Léo Andrès and
Gabriel Scherer)
- #13760: Add String.{edit_distance,spellcheck}
(Daniel Bünzli, review by wikku, Nicolás Ojeda Bär, Gabriel Scherer and
Florian Angeletti)
- #13753, #13755: Add Stdlib.Repr:
Repr.phys_equal and Repr.compare are more explicit than (==) and `compare`.
(Kate Deplaix, Thomas Blanc and Léo Andrès, review by Gabriel Scherer,
Florian Angeletti, Nicolás Ojeda Bär, Daniel Bünzli and Jeremy Yallop)
- #13695: Add Stdlib.Char.Ascii
(Daniel Bünzli, review by by Nicolás Ojeda Bär and Jeremy Yallop)
- #13720: Add Result.{get_ok',error_to_failure}
(Daniel Bünzli, review by wikku, Gabriel Scherer, Nicolás Ojeda Bär,
Vincent Laviron and hirrolot)
- #13885: Add Dynarray.{exists2, for_all2}.
(T. Kinsart, review by Daniel Bünzli, Gabriel Scherer, and Nicolás Ojeda Bär)
* #13862: Make List.sort_uniq keep the first occurrences of duplicates.
(Benoît Jubin, review by Nicolás Ojeda Bär, Gabriel Scherer)
- #13836: Add [Float.]Array.{equal,compare}.
(Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #13796: Add Uchar.utf_8_decode_length_of_byte and
Uchar.max_utf_8_decode_length.
(Daniel Bünzli, review by Nicolás Ojeda Bär and Florian Angeletti)
- #13768: Add Either.get_left and Either.get_right
(T. Kinsart, review by Nicolás Ojeda Bär and Florian Angeletti)
* #13570, #13794: Format, add an out_width function to Format device for
approximating unicode width.
(Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli,
and Gabriel Scherer)
- #13731: Add Either.retract
(Daniel Bünzli, review by Nicolás Ojeda Bär and David Allsopp)
- #13729: Add Seq.filteri
(T. Kinsart, review by Nicolás Ojeda Bär and Daniel Bünzli)
- #13721: Add Result.retract
(Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär and
David Allsopp)
- #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 raising Queue.empty in Format when it is used
concurrently, raise a specific exception instead.
(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)
- #13727: Reimplement Sys.getenv_opt not to use exceptions internally, meaning
that the current backtrace is preserved when Sys.getenv_opt returns None.
(David Allsopp, review by Nicolás Ojeda Bär, Josh Berdine and Gabriel Scherer)
- #13737: Avoid closure allocations in Weak.Make.add when resizing the
table
(Vincent Laviron, review by Gabriel Scherer and Daniel Bünzli)
- #13740: Improve performance of Weak.find_aux
(Josh Berdine, review by Gabriel Scherer)
- #13782: Improve performance and type safety of Type.Id by using
[%extension_constructor] instead of Obj.Extension_constructor.of_val.
(Basile Clément, review by Vincent Laviron and Nicolás Ojeda Bär)
- #13589: Expose Sys.io_buffer_size, the size of internal buffers used by the
runtime system and the `unix` library.
(Yves Ndiaye and Nicolás Ojeda Bär, review by Daniel Bünzli and Nicolás Ojeda
Bär)
- #13569: add a `Format.format_text` which adds break hints to format literals.
(Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli,
and Gabriel Scherer)
- #13578: On Windows, use the OS CSPRNG to seed the Stdlib.Random generator.
(Antonin Décimo, review by Miod Vallat, Nicolás Ojeda Bär, and Xavier Leroy)
- #13859: Fix Weak.get_copy not darkening custom blocks
(Josh Berdine, review by Stephen Dolan)
- #13909: Add `Dynarray.unsafe_to_iarray`
(Olivier Nicole, review by Daniel Bünzli, Stefan Muenzel and Gabriel Scherer,
request by Daniel Bünzli)
- #13932: Add List.singleton and Seq.singleton
(David Allsopp, tariffs applied by Nicolás Ojeda Bär and Gabriel Scherer)
* #13843: Add signal definitions for SIGIO and SIGWINCH. Introduces a
type alias for signal int, signal_to_string to convert OCaml signal numbers
to their POSIX equivalent names, and signal_of_int/signal_to_int for
converting between OCaml and platform signal numbers. (Reported in #13825)
(Tim McGilchrist, review by David Allsopp, Nicolás Ojeda Bär, Daniel Bünzli
Jan Midtgaard and Miod Vallat)
### Runtime system:
- #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)
- #13582: Enable software prefetching support for ARM64, s390x, PPC64 and RiscV.
Used during GC marking and sweeping to speed up both operations by
prefetching data.
(Tim McGilchrist, review by Nick Barnes, Antonin Décimo,
Stephen Dolan and Miod Vallat)
- #13675: Make Unix.map_file memory show up in Gc.Memprof.
(Stephen Dolan, review by Guillaume Munch-Maccagnoni and Gabriel Scherer)
- #13785: Add `Runtime_events.Timestamp.get_current`.
(Simon Cruanes)
- #13774: Fix for inaccurate live blocks/words stats in compaction.
(Sadiq Jaffer, report by KC Sivaramakrishnan and Jan Midtgaard, review by
Gabriel Scherer)
- #13773: Ensure that shared pool owners are correctly set on pool adoption.
(Stephen Dolan, review by Sadiq Jaffer and Gabriel Scherer)
* #11449, #13497: Add caml_stat_char_array_{to,of}_os functions allowing
conversion of string data which may contain NUL characters. Correct
implementation of caml_stat_strdup_to_utf16 to raise Out_of_memory instead of
returning of NULL (the behaviour of caml_stat_strdup_to_os was inconsistent
between Unix/Windows).
(David Allsopp, review by Nick Barnes, Antonin Décimo and Miod Vallat)
- #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)
- #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)
- #13643: Allow values reachable from ephemeron keys to be collected by minor GC
(Stephen Dolan, review by François Bobot)
- #13701: optimize `caml_continuation_use` based on #12735
(Hugo Heuzard, review by KC Sivaramakrishnan)
- #13227, #13714: Review of locking in the multicore runtime. Fix
deadlocks in runtime events and potential deadlocks with named
values.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer, tests by
Jan Midtgaard)
- #13736: Fix major GC pacing bug triggered by synchronous collections.
(Nick Barnes, review by Damien Doligez and Tim McGilchrist)
- #13827: Avoid re-marking ephemerons with trivial data.
(Stephen Dolan, review by Nick Barnes and Josh Berdine, benchmarking by
Nicolás Ojeda Bär)
- #13300, #13861: introduce `Gc.ramp_up` to explicitly mark ramp-up
phases of memory consumption and avoid GC overwork. Ramp-up behaviors
are worse with OCaml 5 than with OCaml 4 due to higher sensitivity
to excessive pacing computations. Indicating ramp-up explicitly eliminates
the main known slowdown of OCaml 5 (relative to OCaml 4) for Coq/Rocq.
(Gabriel Scherer, review by Damien Doligez and Guillaume Munch-Maccagnoni,
report by Emilio Jesús Gallego Arias and Olivier Nicole)
- #14057: Don't update memprof too early at the end of a minor GC.
(Nick Barnes, review by Damien Doligez).
### Code generation and optimizations:
- #13262, #14074: fix performance issue on Apple Silicon macOS by emitting
`stlr` instead of `dmb ishld; str`.
(KC Sivaramakrishnan, report by François Pottier, analysis by Frédéric Bour,
Xavier Leroy, Miod Vallat, Gabriel Scherer and Stephen Dolan, review by Miod
Vallat, Vincent Laviron and Xavier Leroy)
* #13050, #14104, #14143: Use '$' instead of '.' to separate module names
in symbol names on macOS and Windows (including the Cygwin backend).
This changes mangling of OCaml identifiers on those operating systems 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).
(Tim McGilchrist, with contributions from Xavier Leroy,
reviewed by Xavier Leroy, Miod Vallat, Gabriel Scherer,
Nick Barnes and Hugo Heuzard)
- #13807: Allow unaligned memory accesses on ARM64.
(Matthew Else, review by Xavier Leroy)
- #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)
- #13667: (originally #11162) Fix instr_size computation on arm64.
(Stephen Dolan and Tim McGilchrist, review by Xavier Leroy
and David Allsopp)
- #13758: Propagate more value kinds in Flambda to allow more unboxing
(Vincent Laviron, review by Pierre Chambart)
- #13759: Propagate more type information from clambda to cmm.
(Pierre Chambart, review by Gabriel Scherer)
- #13735: Follow the behaviour of the C compiler to decide whether to emit the
`.size` and `.type` directives and the `.note.GNU-stack` section
(Samuel Hym, review by Miod Vallat, Antonin Décimo and Gabriel Scherer)
### Other libraries:
* #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, #14223: Add `Thread.set_current_thread_name`.
(Romain Beauxis, review by Gabriel Scherer and Antonin Décimo)
* #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)
- #13576: Introduce internal helpers to convert between time representations.
On Windows, prevent erroneously waiting for an unbounded time in Unix.select
if more than 64 file descriptors per lists are watched, or if watching
non-socket file descriptors, and a timeout longer than $2^{32}$ milliseconds
is used. Cap the timeout to $2^{32}$ milliseconds.
(Antonin Décimo, review by Gabriel Scherer and Miod Vallat)
- #13921: Set cloexec correctly on CRT file descriptors created by the Unix
library on Windows. The inheritance on the underlying Win32 handles was
correctly set, but the book-keeping for the CRT was leaking the value of
non-inherited handles which combined with re-use of HANDLE values within
processes could appear to make a CRT file descriptor "re-open".
(David Allsopp, review by Nicolás Ojeda Bär)
### Tools:
- #13686: Fix Python debugger extensions (for LLDB and GDB) to restore
functionality broken by #13272 in 5.3.
(Nick Barnes, review by Tim McGilchrist Gabriel Scherer)
- #12019: ocamlc: add `align_double` and `align_int64` to `ocamlc -config`
output.
(Romain Beauxis, review by David Allsopp)
- #12642, #13536, #14184, #14192: 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)
- #13199, #13485, #13665, #13762, #13965: Support running native debuggers in
ocamltest.
(Tim McGilchrist, Sebastien Hinderer, David Allsopp, Antonin Décimo, review by
Sebastien Hinderer, Gabriel Scherer, Antonin Décimo, and Tim McGilchrist)
- #13764, #13779: add missing "-keywords" flag to ocamldep and ocamlprof
(Florian Angeletti, report by Prashanth Mundkur, review by Gabriel Scherer)
- #13877: ocamldoc, add a `-latex-escape-underscore` flag to control the
escaping of `_` underscore in latex references (in order to be able to match
odoc behaviour).
(Florian Angeletti, review by Gabriel Scherer)
- #13906: Add support for a `multicore` tag in ocamltest and use it for
tests that fail on mono-core systems.
(Stéphane Glondu, review by Nicolás Ojeda Bär)
### Manual and documentation:
- #13751: Document support for profiling with Linux perf and frame pointers.
(Tim McGilchrist, review by Gabriel Scherer and Miod Vallat)
- #12452: Add examples to Stdlib.Fun documentation.
(Hazem ElMasry, review by Florian Angeletti and Gabriel Scherer)
- #13924: Document how to put [@deprecated] on let bindings, constructors, etc
in the manual
(Valentin Gatien-Baron, review by Florian Angeletti)
- #13694: Fix name for caml_hash_variant in the C interface.
(Michael Hendricks)
- #13732: Document that custom finalizers must not access the OCaml heap, etc.
(Josh Berdine, review by Stephen Dolan and Guillaume Munch-Maccagnoni)
### Type system
* #13830: fail rather than silently create abstract module types when avoiding
(i.e. hiding) signature items, as in:
```ocaml
module N = struct
open (struct type t = A | B end)
module type T = sig type u = t * int end
end
```
Before, it was succeeding with `module N : sig module type T end`, now it
fails. Similarly for anonymous functor calls (of the form `F(struct ... end))
(Clement Blaudeau, review by Gabriel Scherer)
### Compiler user-interface and warnings:
- #13817: align spellchecking hints with the possibly misspelled identifier/
Error: Unbound type constructor "aray"
Hint: Did you mean "array"?
(Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer)
- #13587: Enable native backend on x86_64 GNU/Hurd.
(Samuel Thibault, review by Antonin Décimo, Sébastien Hinderer and Miod
Vallat)
- #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)
- #13702, #13865: Specialized error messages for functors appearing in contexts
where non-functors were expected `module A: sig ... end = Set.Make`
(and the reverse)
(Florian Angeletti, report by Jeremy Yallop, review by Gabriel Scherer)
- #13788, #13813: Keep the module context in spellchecking hints.
`Fun.protact` now prompts `Did you mean "Fun.protect?"` rather than
`Did you mean "protect?"`.
(Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer)
- #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)
- #13601: Enable natdynlink on x86_64 GNU/Hurd
(Samuel Thibault, review by Sébastien Hinderer)
- #13809: Distinguish `(module M : S)` and `(module M) : (module S)` and
change locations of error messages when `S` is ill-typed in `(module S)`
(Samuel Vivien, review by Florian Angeletti and Gabriel Scherer)
- #13814, 13898: Add an `unused-type-declaration` warning when using
a `t as 'a` with no other occurences of `'a`
(Samuel Vivien, review by Florian Angeletti, Kate Deplaix)
- #13818: better delimited hints in error message
(Florian Angeletti, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #13539, #13776: Use nanosleep instead of usleep or select, if available.
(Antonin Décimo, review by Miod Vallat and Gabriel Scherer)
- #13748: Add a .editorconfig file for basic editor auto-configuration.
(Antonin Décimo, review by Gabriel Scherer and David Allsopp)
- #13302, #14236: Store locations of longidents components
(Ulysse Gérard and Jules Aguillon, review by Jules Aguillon
and Florian Angeletti)
- #13314: Comment the code of Translclass
(Vincent Laviron and Nathanaëlle Courant, review by Olivier Nicole)
- #13362: reimplement Floatarray.concat in C (`caml_floatarray_concat`),
matching the implementation of Array.concat.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #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)
- #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)
- #13744: Refactor in `collect_apply_args`
(Samuel Vivien, review by Florian Angeletti and Gabriel Scherer)
- #13787: a new -dcanonical-ids option to show canonicalized identifier stamps
in -d{lambda,cmm,...} outputs.
(Gabriel Scherer, review by Vincent Laviron and David Allsopp,
suggested by David Allsopp)
- #13820: Add a new option -i-variance to print the variance of every
type parameter; bivariance is printed as `+-`, and for consistency,
parser is modified too to accept `+-` and `-+` as `type_variance`.
(Takafumi Saikawa and Jacques Garrigue, review by Florian Angeletti)
- #13828: Apply BUILD_PATH_PREFIX_MAP to Sys.argv.(0) before storing it in .cmt
and .cmti files.
(David Allsopp, review by Daniel Bünzli and Gabriel Scherer)
- #13848: Add all paths components to the cmt files indexes
(Ulysse Gérard, review by Florian Angeletti)
- #13854: Make the parser set loc_ghost more correctly, for `keyword%extension`
syntax
(Valentin Gatien-Baron, review by Florian Angeletti)
- #13856: Add a new indirection in types AST called `package` that stores the
content of a `Tpackage` node
(Samuel Vivien, review by Florian Angeletti)
- #13866: Modified occurence check that prevents recursive types for it to see
the checked type as a graph rather than a tree
(Samuel Vivien, report by Didier Remy, review by Florian Angeletti
and Jacques Garrigue)
- #13884 Correctly index modules in constructors and labels paths
(Ulysse Gérard, review by Florian Angeletti)
- #13946: refactor the #install_printer code in the debugger and toplevel
(Pierre Boutillier, review by Gabriel Scherer and Florian Angeletti)
- #13952: check and document the correctness of `caml_domain_alone ()`.
(Gabriel Scherer, review by KC Sivaramakrishnan, report by Olivier Nicole)
- #13971: Keep generalized structure from patterns when typing `let`
(Leo White, review by Samuel Vivien and Florian Angeletti)
* #13972: Renamed the `-no-alias-deps` flag internal representation to
`no_alias_deps` instead of `transparent_modules`.
(Clement Blaudeau, review by Gabriel Scherer)
### Build system:
* #13526, #13789, #13804: 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)
- #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)
- #13494: Use native symlinks on Windows for the OCaml installation, reducing
disk usage considerably.
(David Allsopp, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #13789: Strictly validate the host and target triplets when building for the
Windows ports to be *-*-cygwin, *-w64-mingw32* or *-pc-windows. Other Cygwin
variants used to be rejected - other MSVC and mingw-w64 variants are now
rejected too.
(David Allsopp, review by Antonin Décimo and Gabriel Scherer)
### Bug fixes:
- #13819: Fix field initialisation bug in runtime events subsystem.
(Nick Barnes, review by Gabriel Scherer).
- #13977: Pass `-fPIC` when compiling C files using `ocamlopt`. This was a
regression in OCaml 5.3.
(Nicolás Ojeda Bär, review by Daniel Bünzli and Gabriel Scherer)
- #13957: Allow 'effect' as attribute id.
(Pieter Goetschalckx, review by Nicolás Ojeda Bär and Florian Angeletti)
- #13691 #13895: Make four globals underlying Gc.control atomic to avoid C data
races against them.
(Jan Midtgaard, review by Miod Vallat, Sadiq Jaffer and Antonin Décimo)
- #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)
* #13605: Fix ungenerated constraints when they where impossible due to polyvars
issues
(Samuel Vivien, review by Florian Angeletti, Richard Eisenberg
and Jacques Garrigue)
- #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)
- #13896, #14098: ocamldoc, do not wrap module description in a paragraph tag
inside the table of modules
(Florian Angeletti, report by John Whitington, review by Gabriel Scherer)
- #13703: wrong explanation for some polymorphic-variant subtyping errors
(Gabriel Scherer, review by Jacques Garrigue,
report by Wiktor Kuchta and Richard Eisenberg)
- #13710: Support unicode identifiers in comments.
(Pieter Goetschalckx, review by Florian Angeletti and Gabriel Scherer)
- #13763: Track type of variables bound by as-patterns
(Leo White, review by Gabriel Scherer, port by Vincent Laviron)
- #13778, #13811: do not warn for unused type declarations when the type is used
in a first-class module type (`module S with type t = int)`.
(Florian Angeletti, report by Nicolás Ojeda Bär, review by Gabriel Scherer)
- #13790: Fix bytecode-only build of Cygwin when flexlink is being bootstrapped
with the compiler.
(David Allsopp, review by Antonin Décimo and Miod Vallat)
- #13812: Add forgotten check about the validity of the type variable name on
the right-hand side of `_ as _`.
(Samuel Vivien, review by Gabriel Scherer)
- #13845: Fix bug in untypeast/pprintast for value bindings with polymorphic
type annotations.
(Chris Casinghino, review by Florian Angeletti and Gabriel Scherer)
- #13930, #13933: Fix bugs in recursive values definitions involving
lazy values that have already been evaluated.
(Gabriel Scherer, review by Vincent Laviron, report by Vincent Laviron)
- #13867: Fix bug with some recursive bindings of lazy values.
(Guillaume Bury and Vincent Laviron, review by Stefan Muenzel
and Gabriel Scherer)
- #13931: fix bugs in nested recursive value definitions.
(Gabriel Scherer, review by Vincent Laviron,
report by Vincent Laviron)
- #13875, #13878: Add dedicated constructor for mutable variable access in
Cmm to prevent bugs linked to incorrect handling of coeffects.
(Vincent Laviron, review by Gabriel Scherer)
- #13880: Make object stat counters atomic
(Dimitris Mostrous, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #13172, #13829: Fix a missing check of illegal recursive module-type
definitions
(Clement Blaudeau, review by Florian Angeletti)
- #13541, #13777: Using C++11 `thread_local` causes name-mangling
issues when linking with flexlink on Cygwin.
(Antonin Décimo and David Allsopp, report by Kate Deplaix)
* #13874, #13882: Make evaluation order consistent for applications when using
the non-flambda native compiler
(Vincent Laviron, report by Jean-Marie Madiot, review by Gabriel Scherer)
- #13942: Fix assertion on empty array case
(Olivier Nicole, review by Gabriel Scherer)
- #13950: Avoid tearing in `Array.sub`
(Gabriel Scherer and Olivier Nicole, report by Jan Midtgaard, review by
Gabriel Scherer)
- #13928, #13944: Fix handling of excessively nested unboxed types
(Vincent Laviron, review by Gabriel Scherer)
- #13987: Remove a spurious TSan report in case of benign data race between
major GC read and write from the mutator (fixes #13427)
(Olivier Nicole, report by Thomas Leonard, review by Gabriel Scherer)
- #14007, #14015: Fix memory corruption when an exception is raised during
demarshaling.
(Benoît Vaugon, review by David Allsopp and Gabriel Scherer)
- #14025: fix data race between compaction and domain termination
(Gabriel Scherer, review by Jan Midtgaard,
report by Jan Midtgaard)
- #13956 Fix a regression introduced in #13308 triggering wrong unused warnings.
(Ulysse Gérard, review by Florian Angeletti)
- #14070: also point to label mismatches in error messages for labelled tuples
(Florian Angeletti, review by Gabriel Scherer)
- #14088, #14091: fix non-deterministic code generation in
matching.ml (backport of rescript-lang/rescript#7557)
(Christiano Calgano, review by Gabriel Scherer and Vincent Laviron)
- #14105: Fix a loop in Pprintast that could result in a hang when printing
constructor `(::)` in isolation.
(Ulysse Gérard, review by Nicolás Ojeda Bär and Florian Angeletti)
- #14108: toplevel, fix a typo in directive type mismatch
(Florian Angeletti, review by Gabriel Scherer)
- #13586, #14093: Fix closing an out_channel during flush
(Stephen Dolan, report by Jan Midtgaard, investigation by Nick Roberts,
review by Antonin Décimo and Miod Vallat)
- #14101, #14139: define atomic helper types inside `caml/misc.h` to improve
header compatibility with C++
(Florian Angeletti, report by Kate Deplaix, review by Gabriel Scherer)
- #14135: Fix a rare internal typechecker error when combining recursive
modules, polymorphic fields or methods, and constrained type parameters.
(Florian Angeletti, review by Gabriel Scherer)
- #14169: runtime, fix cache miss within the stack fragments cache
(Florian Angeletti, review by Gabriel Scherer)
- #14196, #14197: ocamlprof: do not instrument unreachable clauses
(Gabriel Scherer, review by Nicolás Ojeda Bär, report by Ali Caglayan)
- #14200, #14202 : bad variance check with private aliases
(Jacques Garrigue, report and review by Stephen Dolan)
- #14061, #14209: fix a memory-ordering bug in Weak.set that could
result in uninitialized memory seen by Weak.get on another domain.
(Damien Doligez, review by Gabriel Scherer)
- #14214, #14221: fix a confused error message for module inclusions,
functor error messages were missing some type equalities potentially leading
to nonsensical "type t is not compatible with type t" submessage
(Florian Angeletti, report by Basile Clément, review by Gabriel Scherer)
- #14238: Fix certain variadic macros in misc.h which could trigger C warnings
under certain conditions in prerelease versions of OCaml 5.4.
(Antonin Décimo, review by Nicolás Ojeda Bär)
- #14287: Bugfix for GC root mishandling in memprof.c
(Stephen Dolan, review by Leo White)
OCaml 5.3.0 (8 January 2025)
----------------------------
(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:
- #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)
- #12828, #13283: Add short syntax for dependent functor types `(X:A) -> ...`
(Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer)
### 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:
- #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).
- #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).
- #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, review by KC Sivaramakrishnan, Sadiq Jaffer and
Gabriel Scherer)
- #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:
- #12885: move Dynarray to an unboxed representation
(Gabriel Scherer, suggestions by Vincent Laviron,
review by Olivier Nicole and Simon Cruanes, Yann Leray, Alain Frisch)
- #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)
- #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 Barnes, 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:
- #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)
- #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)
- #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 Fabrice 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)
- #13289: Use C99 for loop to reduce the scope of the for loop iterator.
(Antonin Décimo, review by Miod Vallat 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
Nicolás 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:
- #12313, #11799: Do not re-build as-pattern type when a ground type annotation
is given. This allows to work around problems with GADTs in as-patterns.
(Jacques Garrigue, report by Leo White, review by Gabriel Scherer)
### Runtime system:
- #12193: Re-introduce GC compaction for shared pools
Adds a parallel compactor for the shared pools (which contain major heap
blocks sized less than 128 words). Explicit only for now, on calls to
`Gc.compact`.
(Sadiq Jaffer, Nick Barnes, review by Anil Madhavapeddy, Damien Doligez,
David Allsopp, Miod Vallat, Artem Pianykh, Stephen Dolan, Mark Shinwell
and KC Sivaramakrishnan)
- #12850: Update Gc.quick_stat data at the end of major cycles and compaction
This PR adds an additional caml_collect_gc_stats_sample_stw to the major heap
cycling stw. This means that Gc.quick_stat now actually reflects the state of
the heap after a major cycle or compaction.
(Sadiq Jaffer, review by Miod Vallat and Gabriel Scherer)
- #12859: Ensure Gc.compact does a full major before the compactor runs
(Sadiq Jaffer, review by Leo White, Mark Shinwell, Gabriel Scherer,
Josh Berdine, David Allsopp and KC Sivaramakrishnan)
- #10111: Increase the detail of location information for debugging events to
allow the end line number and character offset to be reported.
(David Allsopp, review by Nick Barnes, Enguerrand Decorne and Stephen Dolan)
- #10403, #12202: introduce `caml_ext_table_add_noexc` that does not
raise `Out_of_memory` exceptions and use it inside the blocking sections
of `caml_read_directory`. Also, check for overflows in ext table sizes.
(Xavier Leroy, report by Arseniy Alekseyev, review by Gabriel Scherer)
- #11332, #12702: make sure `Bool_val(v)` has type `bool` in C++
(Xavier Leroy, report by ygrek, review by Gabriel Scherer)
- #12772, #12787: Avoid using _Bool in public headers for the sake of C++
compatibility
(Guillaume Munch-Maccagnoni, report by KC Sivaramakrishnan, review
by Xavier Leroy and KC Sivaramakrishnan)
- #12223: Constify constructors and flags tables in C code. Now these
tables will go in the readonly segment, where they belong.
(Antonin Décimo, review by Gabriel Scherer and Xavier Leroy)
- #12234: make instrumented time calculation more thread-safe on macOS.
(Anil Madhavapeddy, review by Daniel Bünzli and Xavier Leroy)
- #12235, #12468: introduce and use the `CAMLnoret` macro as
a lighter alternative to `CAMLnoreturn_start` / `CAMLnoreturn_end`.
Implement it so as to conform with C11, C23, C++11, C++17.
(Xavier Leroy and Dhruv Maroo, with help from Antonin Décimo, review by
Gabriel Scherer and David Allsopp)
- #12275: caml/stack.h: more abstract macros to describe OCaml stacks and
how to traverse them, supporting more stack layouts.
(Xavier Leroy, review by KC Sivaramakrishnan and Fabrice Buoro)
- #12268: deliver `Out_of_memory` exception if domain creation fails
due to memory resource exhaustion. It was previous always a `Failure`.
(Anil Madhavapeddy, review by David Allsopp)
- #12300, #12314: Discard out_channel buffered data on permanent I/O error
(Xavier Leroy, report by Török Edwin, review by Anil Madhavapeddy
and Nicolás Ojeda Bär)
- #11386: Simplifications and fixes to multicore systhreads implementation.
(Guillaume Munch-Maccagnoni, review by Anil Madhavapeddy and KC
Sivaramakrishnan)
- #12875, #12879, #12882: Execute preemptive systhread switching as a
delayed pending action. This ensures that one can reason within the
FFI that no mutation happens on the same domain when allocating on
the OCaml heap from C, consistently with OCaml 4. This also fixes
further bugs with the multicore systhreads implementation.
(Guillaume Munch-Maccagnoni, bug reports and suggestion by Mark
Shinwell, review by Nick Barnes and Stephen Dolan)
- #12408: `Domain.spawn` no longer leaks its functional argument for
the whole duration of the children domain lifetime.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
- #12409: Fix unsafety and deadlocks should an asynchronous exception
arise at specific locations during domain creation and shutdown.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
- #12114: Add ThreadSanitizer support
(Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo,
review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc
Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer)
- #11911, #12381: Restore statmemprof functionality in part, with
some API changes in Gc.Memprof.
(Nick Barnes, review by Jacques-Henri Jourdan
and Guillaume Munch-Maccagnoni).
- #12430: Simplify dynamic bytecode loading in Meta.reify_bytecode
(Stephen Dolan, review by Sébastien Hinderer, Vincent Laviron and Xavier
Leroy)
- #12489: Fix an error-handling bug in caml_alloc_sprintf
(Stephen Dolan, report by Chris Casinghino, review by Jeremy Yallop
and Xavier Leroy)
- #11307: Finish adapting the implementation of asynchronous actions for
multicore: soundness, liveness, and performance issues.
Do not crash if a signal handler is called from an unregistered C
thread, and other possible soundness issues. Prevent issues where join
on other domains could make the toplevel unresponsible to Ctrl-C. Avoid
needless repeated polling in C code when callbacks cannot run
immediately.
(Guillaume Munch-Maccagnoni, review by Enguerrand Decorne, Xavier
Leroy, and KC Sivaramakrishnan)
- #12634: Simplify TSan backtrace bookkeeping upon raise
(Olivier Nicole and Fabrice Buoro, review by Gabriel Scherer)
* #12686: Some primitives had the wrong types to be callable from the bytecode
interpreter. Either fix their types, mark them as `CAMLexport` instead of
`CAMLprim`, or remove them entirely if no longer used.
(Xavier Leroy, review by David Allsopp)
- #12700, continuing #11763 and trying to address #12660:
Use the correct types for primitives when generating the table of primitives
used by ocamlrun.
(Xavier Leroy, motivation, review and improvements by Antonin Décimo)
- #12345, #12710: Fix issues with finaliser orphaning at domain termination
(KC Sivaramakrishnan, report by Gabriel Scherer, review by Gabriel Scherer,
Sadiq Jaffer and Fabrice Buoro)
- #12599: Refactor Dynlink startup to avoid parsing bytecode sections twice
(Stephen Dolan, review by David Allsopp, Hugo Heuzard, Damien Doligez and
Xavier Leroy)
- #12678, #12898: free channel buffers on close rather than on finalization
(Damien Doligez, review by Jan Midtgaard and Gabriel Scherer, report
by Jan Midtgaard)
- #12681: Fix TSan false positives due to volatile write handling
(Olivier Nicole, Fabrice Buoro and Anmol Sahoo, review by Luc Maranget,
Gabriel Scherer, Hernan Ponce de Leon and Xavier Leroy)
- #12743: Use pthread_sigmask instead of sigprocmask
Updates usage of sigprocmask to pthread_sigmask in otherlibs/unix.
(Max Slater, review by Miod Vallat and Xavier Leroy)
- #12769: Unify MSVC and MinGW-w64 code paths, by always using WinAPI
directly.
(David Allsopp, Antonin Décimo, and Samuel Hym, review by Nicolás Ojeda Bär)
- #11911, #12382, #12383: Restore statmemprof functionality in part
(backtrace buffers, per-thread and per-domain data structures,
GC/allocation interface). (Nick Barnes, review by Gabriel Scherer,
Fabrice Buoro, Sadiq Jaffer, Guillaume Munch-Maccagnoni, and
Jacques-Henri Jourdan).
- #12735: Store both ends of the stack chain in continuations
(Leo White, review by Miod Vallat and KC Sivaramakrishnan)
- #12746: Simplify and clean up TSan annotations
(Olivier Nicole, review by Miod Vallat and Fabrice Buoro)
- #12809: Add ThreadSanitizer support to FreeBSD/amd64
(Miod Vallat, review by Gabriel Scherer)
- #12810: Port ThreadSanitizer support to Linux and macOS on arm64
(Miod Vallat, review by Tim McGilchrist)
- #12811: Define and use the CAMLthread_local macro for TLS variables.
(Antonin Décimo and Samuel Hym, review by Miod Vallat and Xavier Leroy)
- #12814: More detailed failure messages from `input_value` and `Marshal.from_*`
(Xavier Leroy, review by Stephen Dolan and Anil Madhavapeddy)
- #12815: Correctly format multi-line locations in exception backtraces, in the
style that the compiler driver uses.
(David Allsopp, review by Gabriel Scherer)
- #12773, #12830, #12834: Rewrite `caml_c_thread_(un)register` to fix
various bugs.
(Guillaume Munch-Maccagnoni, reported by Miod Vallat, suggested by
Hari Hara Naveen S, reviewed by Fabrice Buoro, Gabriel Scherer and
Miod Vallat)
- #12876: Port ThreadSanitizer support to Linux on POWER
(Miod Vallat, review by Tim McGilchrist)
- #12886: Reinitialize IO mutexes after fork
(Max Slater, review by Guillaume Munch-Maccagnoni and Xavier Leroy)
- #12907: Port ThreadSanitizer support to Linux on RiscV
(Miod Vallat, review by Nicolás Ojeda Bär and Fabrice Buoro)
- #12915: Port ThreadSanitizer support to Linux on s390x
(Miod Vallat, review by Tim McGilchrist)
- #12934: Fix data races between marking and sweeping functions
(Olivier Nicole, suggested by Stephen Dolan, review by Gabriel Scherer,
Miod Vallat and Damien Doligez)
### Code generation and optimizations:
- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8.
This reduces stack usage. It's only C stacks that require 16-alignment.
(Xavier Leroy, review by Gabriel Scherer and Stephen Dolan)
- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays)
were not correctly rounded sometimes.
(Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist)
- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation.
Non-function recursive bindings are now forbidden from Lambda onwards,
and compiled using a new Value_rec_compiler module.
(Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer,
Stefan Muenzel and Nathanaëlle Courant)
- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers
(Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron)
- #12825: disable common subexpression elimination for atomic loads... again.
(Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy
and Vincent Laviron, report by Vesa Karvonen)
### Standard library:
- #12716: Add `Format.pp_print_nothing` function.
(Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #11563: Add the Dynarray module to the stdlib. Dynamic arrays are
arrays whose length can be changed by adding or removing elements at
the end, similar to 'vectors' in C++ or Rust.
(Gabriel Scherer, Simon Cruanes and Florian Angeletti, review by
Daniel Bünzli, Guillaume Munch-Maccagnoni, Clément Allain,
Damien Doligez, Wiktor Kuchta and Pieter Goetschalckx)
* #6732, #12423: Make Buffer.add_substitute surjective and fix its
documentation.
(Damien Doligez, review by Antonin Décimo)
* #10775, #12499: Half-precision floating-point elements in Bigarray.
(Anton Yabchinskiy, review by Xavier Leroy and Nicolás Ojeda Bär)
- #11517, #12477: Expose pp_infinity in interface of the format module, and
check that margin is less than pp_infinity when setting or checking geometry.
(Janith Petangoda, reported by Simmo Saan, reviewed by Florian Angeletti,
Simmo Saan, Josh Berdine and Gabriel Scherer)
- #12217: Add `Array.shuffle`.
(Daniel Bünzli, review by Nicolás Ojeda Bär, David Allsopp and Alain Frisch)
- #12212: Add cache-aligned constructor for atomics. The patch ensures that
all allocations (of the right size) in the shared heap are aligned.
(Bartosz Modelski with Gabriel Scherer, Guillaume Munch-Maccagnoni,
Xavier Leroy, review by Alain Frisch, Anil Madhavapeddy, Gabriel Scherer,
Guillaume Munch-Maccagnoni, KC Sivaramakrishnan, Stefan Muenzel,
Xavier Leroy)
- #12307: Add BLAKE2b hashing and an MD5 submodule to the Digest module.
(Xavier Leroy, review by Olivier Nicole, Gabriel Scherer, Wiktor Kuchta,
Daniel Bünzli, David Allsopp)
- #12365: Add In_channel.input_bigarray, In_channel.really_input_bigarray,
Out_channel.output_bigarray, Unix.read_bigarray, Unix.write_bigarray,
Unix.single_write_bigarray.
(Nicolás Ojeda Bär, review by Jeremy Yallop, Xavier Leroy, Gabriel Scherer,
David Allsopp)
- #12455: Add `Array.init_matrix`, `Float.Array.make_matrix`,
`Float.Array.init_matrix`.
(Glen Mével, review by Xavier Leroy, Gabriel Scherer, Jeremy Yallop,
Nicolas Ojeda Bar)
* #12455: `Array.make_matrix dimx dimy f` now raises `Invalid_argument`
when `dimx = 0 && dimy < 0` This was already specified but not enforced.
(Glen Mével, report by Jeremy Yallop, review by Nicolás Ojeda Bär)
- #12459: Add `Random.int_in_range`, `Random.int32_in_range`,
`Random.int64_in_range`, `Random.nativeint_in_range`,
and their counterpart in `Random.State`.
(Glen Mével and Xavier Leroy, review by Gabriel Scherer, Xavier Leroy,
Florian Angeletti)
- #12459: `Random`: restore compatibility between 32-bit integers (JavaScript)
and 63-bit integers (64-bit OCaml).
For `Random.full_int` this was guaranteed in 4.14 but wrongly removed in 5.0.
(Xavier Leroy, review by Glen Mével)
- #12511: Minor performance improvements and cleanups in the implementation
of modules Int32, Int64, and Nativeint
(Xavier Leroy, review by Gabriel Scherer and Daniel Bünzli)
- #12558: Adapt GC alarms for multicore and fix their documentation.
(Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan
and Gabriel Scherer)
- #12625: Remove the Closure module from Obj
(Vincent Laviron, review by Xavier Leroy)
- #12758, #12998: Remove the `Marshal.Compression` flag to the
`Marshal.to_*` functions. The compilers are still able to use
ZSTD compression for compilation artefacts.
This is a forward port and clean-up of the emergency fix that was introduced
in OCaml 5.1.1 by #12734.
(Xavier Leroy, review by Damien Doligez)
- #12784: Fix computation of minor-heap allocation in Gc.counters()
and Gc.allocated_bytes(). (Nick Barnes, review by Gabriel Scherer)
- #12770: Add `Fun.compose`.
(Justin Frank, review by Nicolás Ojeda Bär, Daniel Bünzli and Jeremy Yallop)
- #12845: Add `{In,Out}_channel.is_binary_mode` as the dual of
`set_binary_mode`. This function was previously only available in the internal
C API.
(David Allsopp, review by Nicolás Ojeda Bär and Xavier Leroy)
### Other libraries:
- #12213: Dynlink library, improve legibility of error messages
(Samuel Hym, review by Gabriel Scherer and Nicolás Ojeda Bär)
* #12686: Runtime_events library, C API: define
`caml_runtime_events_{start,pause,resume}` as returning `void`
instead of `value`.
(Xavier Leroy, review by David Allsopp)
### Tools:
- #12340: testsuite: collect known issues with current -short-paths
implementation for existential types
(Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis)
- #12147: ocamllex: Allow carriage returns at the end of line directives.
(SeungCheol Jung, review by Nicolás Ojeda Bär)
- #12260: Fix invalid_argument on some external or module aliases in ocamlnat
(Fabian Hemmer, review by Vincent Laviron)
- #12185: New script language for ocamltest.
(Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer,
review by Sébastien Hinderer and Gabriel Scherer)
- #12371: ocamltest: fix recursive expansion of variables.
(Antonin Décimo, Damien Doligez, review by Sébastien Hinderer,
Damien Doligez, Gabriel Scherer, and Xavier Leroy)
* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no
input files are specified to build an executable.
(Antonin Décimo, review by Sébastien Hinderer)
- #12576: ocamldep: various refactors.
(Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès)
- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators.
(Sébastien Hinderer, review by Gabriel Scherer and Florian Angeletti)
- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching
for init.ml and use this to extend init.ml support to the toplevel when
running on Windows.
(David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and
Antonin Décimo)
- #12688: Setting the env variable `NO_COLOR` with an empty value no longer
has effects. Previously, setting `NO_COLOR` with any value, including
the empty value, would disable colors (unless `OCAML_COLOR` is also set).
After this change, the user must set `NO_COLOR` with an non-empty value
to disable colors. This reflects a specification clarification/change
from the upstream website at https://no-color.org.
(Favonia, review by Gabriel Scherer)
- #12744: ocamltest: run tests in recursive subdirs more eagerly
(Nick Roberts, review by Nicolás Ojeda Bär)
- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect
lexers; use unsigned numbers in the table encoding when possible.
(Vincent Laviron, report by Edwin Török, review by Xavier Leroy)
### Manual and documentation:
- #12338: clarification of the documentation of process related function in
the unix module regarding the first element of args and shell's pid.
(Christophe Raffalli, review by Florian Angeletti)
- #12473: Document in runtime/memory.c our current understanding of
accesses to the OCaml heap from the C runtime code -- the problem
of hybrid programs mixing two memory models.
(Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier
Nicole and Xavier Leroy)
- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the
consequences with regard to the memory model.
(Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume
Munch-Maccagnoni and Fabrice Buoro)
- #12802: Add manual chapter about ThreadSanitizer support
(Olivier Nicole, review by Miod Vallat, Sebastien Hinderer, Fabrice Buoro,
Gabriel Scherer and KC Sivaramakrishnan)
- #12819: Clarify which runtime interactions are allowed in custom ops
(Basile Clément, review by Guillaume Munch-Maccagnoni and Xavier Leroy)
- #12840: manual: update runtime tracing chapter for custom events (ex #12335)
(Lucas Pluvinage, Sadiq Jaffer and Olivier Nicole, review by Gabriel Scherer,
David Allsopp, Tim McGilchrist and Thomas Leonard)
- #13066, update OCAMLRUNPARAM documentation for the stack size parameter l
(Florian Angeletti, review by Nicolás Ojeda Bär, Tim McGilchrist, and
Miod Vallat)
- #13078: update Format tutorial on structural boxes to mention alignment
questions.
(Edwin Török, review by Florian Angeletti)
- #13092: document the existence of the `[@@poll error]` built-in attribute
(Florian Angeletti, review by Gabriel Scherer)
### Compiler user-interface and warnings:
* #10613, #12405: Simplify the values used for the system variable (`system:` in
`ocamlopt -config` or the `Config.system` constant). In particular, s390x and
ppc64 now report "linux" instead of "elf"; all variants of 32-bit ARM on Linux
now report "linux"; OpenBSD now reports "openbsd" instead of "bsd" for 32-bit
ARM; FreeBSD, NetBSD and OpenBSD now report the same value for both x86_64 and
x86_32; x86_32 systems matching *bsd but not freebsd*, netbsd* or openbsd*
are no longer identified (as on x86_64); x86_32 Linux now reports "linux"
instead of "linux_elf".
(David Allsopp, request by Kate Deplaix, review by Sébastien Hinderer and
Xavier Leroy)
- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies
without including them in the initial environment.
(Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White
and Stefan Muenzel, RFC by François Bobot)
- #12247: configure: --disable-ocamldebug can now be used instead
of --disable-debugger (which remains available for compatibility)
(Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer)
- #12199: improve the error message for non-overriding `inherit!`
(Florian Angeletti, review by Jules Aguillon)
- #12210: uniform style for inline code in compiler messages
(Florian Angeletti, review by Gabriel Scherer)
* #12278, #:12325: Remove the OCAML_FLEXLINK environment variable from the
compiler drivers. This environment variable was previously used as part of the
FlexDLL bootstrap procedure and existed solely for that purpose. Its removal
greatly simplifies both the build system and testsuite machinery.
(David Allsopp, review by Sébastien Hinderer)
- #12347: error messages: always report missing polyvariant tags
(Florian Angeletti, report by Tianbo Hao, review by Gabriel Scherer)
- #12224, specialized error message when trying to apply non-functor
module (e.g `module M = Int(Int)`)
(Florian Angeletti, review by Gabriel Scherer)
- #12451: Warning 53 (misplaced attributes) now works for all attributes.
(Chris Casinghino, review by Florian Angeletti)
- #12622: Give hints about existential types appearing in error messages
(Leo White, review by Gabriel Scherer and Florian Angeletti)
- #12671: When a class type parameter or class parameter does not match,
identify which parameter in the error message, instead of saying
"A type parameter" or "A parameter".
(Stefan Muenzel, review by Gabriel Scherer)
- #12679: Add more detail to the error message and manual in case of
invalid module type substitutions.
(Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)
- #12750: Display the command executed to extract primitives in
`ocamlc -verbose`.
(David Allsopp, review by Nicolás Ojeda Bär)
- #12777: Add details about the actual and expected method types to the method
mismatch error messages.
(Javier Chávarri, review by Gabriel Scherer and Florian Angeletti)
* #12942: Fix an line ordering in some module inclusion error messages
(Nick Roberts, review by Florian Angeletti, report by Carl Eastlund)
### Internal/compiler-libs changes:
- #12639: parsing: Attach a location to the RHS of Ptyp_alias
and improve the 'alias type mismatch' error message.
(Jules Aguillon, review by Florian Angeletti)
- #12447: Remove 32-bit targets from X86_proc.system
(Masanori Ogino, review by David Allsopp)
- #12216, #12248: Prevent reordering of atomic loads during instruction
scheduling. This is for reference, as instruction scheduling is currently
unused in OCaml 5.
(Xavier Leroy, report by Luc Maranget and KC Sivaramakrishnan,
review by Nicolás Ojeda Bär)
- #12025: Split Typecore.unify_pat_types into two
to avoid unnecessary references to the environment in type_pat
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #12031: Use dedicated types to represent names of compilation units
and predefined exceptions in CMO files.
(Sébastien Hinderer, review by Florian Angeletti, Thomas Refis,
Gabriel Scherer, Vincent Laviron, Pierre Chambart, Luke Maurer,
Hugo Heuzard, Xavier Leroy and Damien Doligez)
- #12109: Pack parameters to unification in unification_environment
(Takafumi Saikawa and Jacques Garrigue, review by Richard Eisenberg)
- #12331, #12361: Pack the unification data for pattern checking in Typecore
(Takafumi Saikawa and Jacques Garrigue,
review by Gabriel Scherer, Thomas Refis and Florian Angeletti)
- #12229: Remove global mutable state for typechecking patterns
in Typecore in favor of local mutable state.
(Nick Roberts, review by Takafumi Saikawa)
- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity
This changes function arity to be based solely on the source program's
parsetree. Previously, the heuristic for arity had more subtle heuristics
that involved type information about patterns. Function arity is important
because it determines when a pattern match's effects run and is an input
into the fast path for function application.
This change affects tooling: it changes the function constructs in parsetree
and typedtree.
See https://github.com/ocaml/RFCs/pull/32 for the original RFC.
(Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer;
RFC by Stephen Dolan)
- #12542: Minor bugfix to #12236: restore dropped call to `instance`
(Nick Roberts, review by Jacques Garrigue)
- #12242: Move the computation of stack frame parameters to a separate
`Stackframe` module, and save the parameters in the results of the
`Linearize` pass
(Xavier Leroy, review by KC Sivaramakrishnan and Mark Shinwell)
- #12442: document jump summaries in the pattern-matching compiler
(Gabriel Scherer and Thomas Refis, review by Florian Angeletti
and Vincent Laviron)
- #12446, #12792: remove the hooks machinery around channel locking
in runtime/io.c
(Gabriel Scherer, review by Xavier Leroy)
- #12389, #12544, #12984, #12987: centralize the handling of metadata for
compilation units and artifacts in preparation for better unicode support for
OCaml source files.
(Florian Angeletti, review by Vincent Laviron and Gabriel Scherer)
- #12532, #12553: improve readability of the pattern-matching debug output
(Gabriel Scherer, review by Thomas Refis)
- #12537: Use C11/C++11 standard static assertion.
(Antonin Décimo, review by Sebastien Hinderer, Xavier Leroy,
and KC Sivaramakrishnan)
- #12169: runtime: document and enforce naming conventions around STW sections.
(Gabriel Scherer, review by Enguerrand Decorne, Miod Vallat, B. Szilvasy
and Nick Barnes, report by KC Sivaramakrishnan)
- #12669 : Clean up some global state handling in schedgen
(Stefan Muenzel, review by Miod Vallat and Gabriel Scherer)
- #12640: Make the module separator used in symbol names configurable
(Miod Vallat, review by Hugo Heuzard and Xavier Leroy)
- #12691 : Clean up Ctype.expand_abbrev_gen and
rename Env.add_local_type to add_local_constraint
(Takafumi Saikawa and Jacques Garrigue, review by Florian Angeletti)
- #12786 : Clean up the algorithm of Ctype.limited_generalize
(Takafumi Saikawa and Jacques Garrigue, review by Gabriel Scherer)
- #10691: Ast_mapper, Ast_iterator: add functions directive_argument,
toplevel_directive and toplevel_phrase.
(Guillaume Petiot, review by Gabriel Scherer and Kate Deplaix)
- #12764: Move all installable headers in `caml/` sub-directories.
(Antonin Décimo, review by Gabriel Scherer and David Allsopp)
- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by
generating index tables of all identifier occurrences. This extra data in .cmt
files is only added when the new flag -bin-annot-occurrences is passed.
(Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas
Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis)
- #12914: Slightly change the s390x assembly dialect in order to build with
Clang's integrated assembler.
(Miod Vallat, review by Gabriel Scherer)
- #13001: do not read_back entire shapes to get aliases' uids when building the
usages index
(Ulysse Gérard, review by Gabriel Scherer and Nathanaëlle Courant)
### Build system:
- #12198, #12321, #12586, #12616, #12706, #13048: continue the merge of the
sub-makefiles into the root Makefile started with #11243, #11248,
#11268, #11420 and #11675.
(Sébastien Hinderer, review by David Allsopp and Florian Angeletti)
- #12569, #12570: remove 'otherlibraries' as a prerequisite for 'runtop';
use 'runtop-with-otherlibs' to use a library from otherlibs/
(Gabriel Scherer, review by Sébastien Hinderer, suggestion by David Allsopp)
- #12652: Make magic numbers easier to bump and duplicate.
(Sébastien Hinderer, review by Antonin Décimo, David Allsopp and Florian
Angeletti)
* #12751: --with-target-bindir configure option implemented. This option
refers to the location of the runtime binaries on the target system for a
cross-compiler and is embedded in executables produced by ocamlc. It does
not affect the bytecode executables installed as part of the build. The old
mechanism `make TARGET_BINDIR=..` no longer works.
(David Allsopp, review by Damien Doligez, Xavier Leroy and Olivier Nicole)
- #12768, #13030: Detect mingw-w64 coupling with GCC or LLVM, detect clang-cl,
and fix C compiler feature detection on macOS.
(Antonin Décimo, review by Miod Vallat and Sébastien Hinderer)
### Bug fixes:
- #10652, #12720: fix evaluation order in presence of optional arguments
(Jacques Garrigue, report by Leo White, review by Vincent Laviron)
- #12595, #12597: fix a race in `caml_clear_gc_stats_sample`
(Gabriel Scherer, review by B. Szilvasy, report by B. Szilvasy)
- #12580: Fix location of alias pattern variables.
(Chris Casinghino, review Gabriel Scherer, report by Milo Davis)
- #12583: Add a closing event for when `EV_MAJOR_EPHE_MARK` is complete
(Sudha Parimala, review by Gabriel Scherer)
- #12566: caml_output_value_to_malloc wrongly uses `caml_stat_alloc`
instead of `malloc` since 4.06, breaking (in pooled mode) user code
that uses `free` on the result. Symmetrically,
caml_input_value_from_malloc should use `free`.
(Gabriel Scherer, review by Xavier Leroy and Enguerrand Decorne,
report by Ido Yariv)
- #12490: Unix: protect the popen_processes hashtable with a mutex
(Gabriel Scherer, report by Olivier Nicole, review by Xavier Leroy)
- #11931: Fix tricky typing bug with type substitutions
(Stephen Dolan, review by Leo White and Jacques Garrigue)
- #12037, #12171: Fix get_extern_state potential NULL dereference.
(Alexander Skvortsov, report by Török Edwin,
design by Gabriel Scherer, Xavier Leroy)
- #12635: Fix get_intern_state potential NULL dereference.
(Antonin Décimo, review by KC Sivaramakrishnan)
- #12032, #12059: Bug fixes related to compilation of recursive definitions
(Vincent Laviron, report by Victoire Noizet, review by Gabriel Scherer)
* #12145: Loopy constraints cause ocamlc to loop.
Fixed by completely removing the call to `update_type` in
`Typedecl.transl_type_decl`, as the expansion is already checked by
`check_regularity`. As a result, recursion is more polymorphic,
which may cause some (essentially wrong) type declarations to have
unbound type variables, and some constraints unrelated to the concrete
type to be ignored (see tests/typing-misc/constraints.ml).
(Jacques Garrigue, report by Richard Eisenberg, review by Leo White)
- #12207, #12222: Make closure computation linear in the number of recursive
functions instead of quadratic
(Vincent Laviron, report by François Pottier, review by Nathanaëlle Courant
and Gabriel Scherer)
- #11040, #12591: fix a data race in major_gc.c
(Gabriel Scherer, review by Guillaume Munch-Maccagnoni
and KC Sivaramakrishnan, report by Sadiq Jaffer)
- #12238, #12403, #12698: read input files in one go to avoid source reprinting
issues.
(Gabriel Scherer, report by Mike Spivey and Vincent Laviron, review by
Nicolás Ojeda Bär, Xavier Leroy and Jeremy Yallop)
- #12334, #12368: Bad error message with mutually recursive abbreviations
(Jacques Garrigue, report by Richard Eisenberg, review by Gabriel Scherer
and Richard Eisenberg)
- #12401: `seek_in` and `seek_out` sometimes returned normally when given
negative offsets, instead of failing. Now both functions should consistently
raise `Sys_error` in this case.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #12267: Fix stack alignment computation
(Miod Vallat, report by Jan Midtgaard, review by Gabriel Scherer)
- #12395, #12404: Fix thread-unsafety in the fallback implementation of
`Unix.create_process` (the one used when `posix_spawnp` is unavailable)
(Xavier Leroy, report by Chris Vine, review by Nicolás Ojeda Bär)
- #12949: open shadowing mistriggers
(Gabriel Scherer, review by Florian Angeletti, report by Andreas Rossberg)
- #12526: Honor `ocaml.inline always` attribute on functions with
optional arguments and default values in the Closure backend
(Alain Frisch, review by Vincent Laviron)
- #12677, #12889: make Domain.DLS thread-safe
(Gabriel Scherer, review by Olivier Nicole and Damien Doligez,
report by Vesa Karvonen)
- #12561: Fix crash when combining TSan and frame-pointers
(Fabrice Buoro and Olivier Nicole, report by Jan Midtgaard, review by Miod
Vallat and Gabriel Scherer)
- #12482: Rework bounds checking code in the POWER backend
(Miod Vallat and Xavier Leroy, report by Jan Midtgaard, review by
KC Sivaramakrishnan)
- #12528, #12703: Avoid pointer arithmetic overflow in Tag_val macro
(very likely harmless, but can trigger alarms)
(Xavier Leroy, report by Sam Goldman, review by Guillaume Munch-Maccagnoni)
- #12593: TSan should handle Effect.Unhandled correctly
(Fabrice Buoro and Olivier Nicole, report by Jan Midtgaard and Miod Vallat,
review by Gabriel Scherer)
- #12684: fix locations filename in AST produced by the `-pp` option
(Gabriel Scherer, review by Florian Angeletti)
- #12714: check whether macros are defined before using them to ensure
that the headers can always be used in code which turns on -Wundef
(or equivalent).
(Antonin Décimo, review by Miod Vallat, Gabriel Scherer,
Xavier Leroy, and David Allsopp)
- #12726: fix segmentation fault under Windows when executing a bytecode file if
the runtime (`ocamlrun.exe`) cannot be found.
(Vadim Zborovskii, Nicolás Ojeda Bär, report by Vadim Zborovskii, review by
David Allsopp)
- #12727, #12730: fix bug with value let-rec and labelled applications
(Vincent Laviron, review by Gabriel Scherer)
* #12751: Always keep within the 128 character limit for shebang lines. Previous
fix in #8622 handled building the compiler with a long prefix; this patch
extends this to the bytecode executables emitted by that compiler.
(David Allsopp, review by Damien Doligez, Xavier Leroy and Olivier Nicole)
- #12755: Fix data race on global pools arrays of pool_freelist
(Fabrice Buoro and Olivier Nicole, review by Gabriel Scherer)
- #12796, #12801: Fix memory corruption in caml_unix_alloc_sockaddr
(Thomas Leonard, review by Nicolás Ojeda Bär)
- #12737: Fix data races in minor_gc.c and caml_natdynlink_open
(Olivier Nicole, review by Stefan Muenzel, Miod Vallat, Guillaume
Munch-Maccagnoni, Gabriel Scherer and Xavier Leroy)
- #12831: Fix call to caml_call_realloc_stack for s390x in PIC mode
(Vincent Laviron, report by Jerry James, review by Miod Vallat)
* #12837: Show non-generalizable type parameters in type definitions
Changes type of type parameters in outcometree.mli.
(Jacques Garrigue, review by Richard Eisenberg)
- #12897: fix locking bugs in Runtime_events
(Gabriel Scherer and Thomas Leonard,
review by Olivier Nicole, Vincent Laviron and Damien Doligez,
report by Thomas Leonard)
- #12851: Fix race between runtime events teardown and event emission
(Olivier Nicole, review by Miod Vallat and Gabriel Scherer)
- #12860: Fix an assertion that wasn't taking into account the possibility of an
ephemeron pointing at static data.
(Mark Shinwell, review by Gabriel Scherer and KC Sivaramakrishnan)
- #12861: Fix a possible crash in the `threads` library.
(Mark Shinwell, review by Gabriel Scherer and KC Sivaramakrishnan)
- #11040, #12894: Silence false data race observed between caml_shared_try_alloc
and oldify. Introduces macros to call tsan annotations which help annotate
a ``happens before'' relationship.
(Hari Hara Naveen S and Olivier Nicole,
review by Gabriel Scherer and Miod Vallat)
- #12958: Fix tail-modulo-cons compilation of try-with, && and ||
expressions.
(Gabriel Scherer and Nicolás Ojeda Bär, report by Sylvain Boilard, review by
Gabriel Scherer)
- #12919: Fix register corruption in caml_callback2_asm on s390x.
(Miod Vallat, review by Gabriel Scherer)
- #12924, #12930: Rework package constraint checking to improve interaction with
immediacy
(Chris Casinghino and Florian Angeletti, review by Florian Angeletti and
Richard Eisenberg)
- #12969: Fix a data race in caml_darken_cont
(Fabrice Buoro and Olivier Nicole, review by Gabriel Scherer and Miod Vallat)
- #12971, #12974: fix an uncaught Ctype.Escape exception on some
invalid programs forming recursive types.
(Gabriel Scherer, review by Florian Angeletti, report by Neven Villani)
- #13019: Remove linking instructions for the Unix library from threads.cma
(this was done for threads.cmxa in OCaml 3.11). Eliminates warnings from
new lld when using threads.cma of duplicated libraries.
(David Allsopp, review by Nicolás Ojeda Bär)
- #13058: Add TSan instrumentation to caml_call_gc(), since it may raise
exceptions.
(Fabrice Buoro, Olivier Nicole, Gabriel Scherer and Miod Vallat)
- #13079: Save and restore frame pointer across Iextcall on ARM64
(Tim McGilchrist, review by KC Sivaramakrishnan and Miod Vallat)
- #13094: Fix undefined behavior of left-shifting a negative number.
(Antonin Décimo, review by Miod Vallat and Nicolás Ojeda Bär)
OCaml 5.1.1 (8 December 2023)
----------------------------
### Standard library:
* #12562, #12734, #12783: Remove the `Marshal.Compression` flag to the
`Marshal.to_*` functions introduced in 5.1 by #12006, as it cannot
be implemented without risking to link -lzstd with all
ocamlopt-generated executables. The compilers are still able to use
ZSTD compression for compilation artefacts.
(Xavier Leroy and David Allsopp, report by Kate Deplaix, review by
Nicolás Ojeda Bär, Kate Deplaix, and Damien Doligez).
### Bug fixes:
- #11800, #12707: fix an assertion race condition in `install_backup_thread`
(Jan Midtgaard, review by Gabriel Scherer)
- #12318: GC: simplify the meaning of custom_minor_max_size: blocks with
out-of-heap memory above this limit are now allocated directly in
the major heap.
(Damien Doligez, report by Stephen Dolan, review by Gabriel Scherer)
- #12439: Finalize and collect dead custom blocks during minor collection
(Damien Doligez, review by Xavier Leroy, Gabriel Scherer and KC
Sivaramakrishnan)
- #12486, #12535: Fix delivery of unhandled effect exceptions on amd64 with
--enable-frame-pointers
(Miod Vallat, report by Jan Midtgaard, review by Gabriel Scherer)
- #12581, #12609: Fix error on uses of packed modules outside their pack
to correctly handle nested packs
(Vincent Laviron, report by Javier Chávarri, review by Pierre Chambart)
- #12590, #12595: Move `caml_collect_gc_stats_sample` in
`caml_empty_minor_heap_promote` before barrier arrival.
(B. Szilvasy, review by Gabriel Scherer)
- #12623, fix the computation of variance composition
(Florian Angeletti, report by Vesa Karvonen, review by Gabriel Scherer)
- #12645, #12649 fix error messages for cyclic type definitions in presence of
the `-short-paths` flag.
(Florian Angeletti, report by Vesa Karvonen, review by Gabriel Scherer)
- #12712, #12742: fix an assertion boundary case in `caml_reset_young_limit`
(Jan Midtgaard, review by Guillaume Munch-Maccagnoni and KC Sivaramakrishnan)
- #12713, #12715: disable common subexpression elimination for atomic loads
(Gabriel Scherer and Vincent Laviron,
review by Vincent Laviron, KC Sivaramakrishnan and Xavier Leroy,
report by Vesa Karvonen and Carine Morel)
- #12757: Fix ocamlnat (native toplevel) by registering frametables correctly
(Stephen Dolan, Nick Barnes and Mark Shinwell,
review by Vincent Laviron and Sébastien Hinderer)
- #12791: `extern` is applied to definitions of `caml_builtin_cprim`
and `caml_names_of_builtin_cprim` when linking bytecode '-custom'
executables with a C++ linker.
(Shayne Fletcher, review by Antonin Décimo and Xavier Leroy)
- #12491, #12493, #12500, #12754: Do not change GC pace when creating
sub-arrays of bigarrays
(Xavier Leroy, report by Ido Yariv, analysis by Gabriel Scherer,
review by Gabriel Scherer and Fabrice Buoro)
OCaml 5.1.0 (14 September 2023)
-------------------------------
### Restored backends
- #11418, #11708: RISC-V multicore support.
(Nicolás Ojeda Bär, review by KC Sivaramakrishnan)
- #11712, #12258, #12261: s390x / IBM Z multicore support:
OCaml & C stack separation; dynamic stack size checks; fiber and
effects support.
(Aleksei Nikiforov, with help from Vincent Laviron and Xavier Leroy,
additional suggestions by Luc Maranget,
review by the same and KC Sivaramakrishnan)
- #11642: Restore Cygwin port. Add GC messages for address space reservations
when OCAMLRUNPARAM option v includes 0x1000.
(David Allsopp, review by Xavier Leroy, Guillaume Munch-Maccagnoni
and Gabriel Scherer)
### Standard library:
- #12006, #12064: Add `Marshal.Compression` flag to `Marshal.to_*` functions.
When this flag is explicitly set, marshaled data is compressed using ZSTD.
On some practical examples, the marshalled output became three times smaller
at no noticeable cost on the marshalling time.
(Xavier Leroy, review by Edwin Török and Gabriel Scherer, fix by Damien
Doligez)
- #10464: Add List.is_empty.
(Craig Ferguson, review by David Allsopp)
- #11848: Add `List.find_mapi`,
`List.find_index: ('a -> bool) -> 'a list -> int option`,
`Seq.find_mapi`, `Seq.find_index`, `Array.find_mapi`, `Array.find_index`,
`Float.Array.find_opt`, `Float.Array.find_index`, `Float.Array.find_map`,
`Float.Array.find_mapi`.
(T. Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär)
- #11410: Add Set.to_list, Map.to_list, Map.of_list,
`Map.add_to_list: key -> 'a -> 'a list t -> 'a list t`.
(Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #11836, #11837: Add `Array.map_inplace`, `Array.mapi_inplace`,
`Float.Array.mapi_inplace` and `Float.Array.mapi_inplace`.
(Léo Andrès, review by Gabriel Scherer, KC Sivaramakrishnan and
Nicolás Ojeda Bär)
- #10967: Add Filename.temp_dir.
(David Turner, review by Anil Madhavapeddy, Valentin Gatien-Baron, Nicolás
Ojeda Bär, Gabriel Scherer, and Daniel Bünzli)
- #11246: Add "hash" and "seeded_hash" functions to Bool, Int, Char, Float,
Int32, Int64, and Nativeint.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)
- #11488: Add `Mutex.protect: Mutex.t -> (unit -> 'a) -> 'a`
for resource-safe critical sections protected by a mutex.
(Simon Cruanes, review by Gabriel Scherer, Xavier Leroy,
Guillaume Munch-Maccagnoni)
- #11581: Add type equality witness
`type (_, _) eq = Equal: ('a, 'a) eq`
in a new module Stdlib.Type.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Jacques Garrigue, Florian
Angeletti, Alain Frisch, Gabriel Scherer, Jeremy Yallop and Xavier Leroy)
- #11843: Add `In_channel.input_lines` and `In_channel.fold_lines`.
(Xavier Leroy, review by Nicolás Ojeda Bär and Wiktor Kuchta).
- #11856, #11859: Using TRMC, the following `Stdlib` functions are now
tail-recursive:
Stdlib.(@), List.append,
List.concat_map.
(Jeremy Yallop, review by Daniel Bünzli, Anil Madhavapeddy, Nicolás Ojeda Bär,
Gabriel Scherer, and Bannerets)
- #11362, #11402: Using TRMC, the following `Stdlib` functions are now
tail-recursive:
List.map, List.mapi, List.map2,
List.filter, List.filteri, List.filter_map,
List.init,
List.of_seq.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)
- #11878, #11965: Prevent seek_in from marking buffer data as valid after
closing the channel. This could lead to inputting uninitialized bytes.
(Samuel Hym, review by Xavier Leroy and Olivier Nicole)
- #11128: Add In_channel.isatty, Out_channel.isatty.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Florian Angeletti)
- #10859: Add `Format.pp_print_iter` and `Format.pp_print_array`.
(Léo Andrès and Daniel Bünzli, review by David Allsopp and Hugo Heuzard)
- #10789: Add `Stack.drop`
(Léo Andrès, review by Gabriel Scherer)
* #10899: Change Stdlib.nan from signaling NaN to quiet NaN.
(Greta Yorsh, review by Xavier Leroy, Guillaume Melquiond and
Gabriel Scherer)
- #11026, #11667, #11858: Rename the type of the accumulator
of fold functions to 'acc:
fold_left : ('acc -> 'a -> 'acc) -> 'acc -> 'a list -> 'acc
fold_right : ('a -> 'acc -> 'acc) -> 'a list -> 'acc -> 'acc
fold_left_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a list -> 'acc * 'b list
...
(Valentin Gatien-Baron and François Berenger,
review by Gabriel Scherer and Nicolás Ojeda Bär)
- #11354: Hashtbl.find_all is now tail-recursive.
(Fermín Reig, review by Gabriel Scherer)
- #11500: Make Hashtbl.mem non-allocating.
(Simmo Saan, review by Nicolás Ojeda Bär)
- #11412: Add Sys.is_regular_file
(Xavier Leroy, review by Anil Madhavapeddy, Nicolás Ojeda Bär, David Allsopp)
- #11322, #11329: serialization functions Random.State.{of,to}_binary_string
between Random.State.t and string
(Gabriel Scherer, report by Yotam Barnoy,
review by Daniel Bünzli, Damien Doligez, Hugo Heuzard and Xavier Leroy)
- #11830: Add Type.Id with
`val provably_equal : 'a Type.Id.t -> 'b Type.Id.t -> ('a, 'b) Type.eq option`
(Daniel Bünzli, review by Jeremy Yallop, Gabriel Scherer, Wiktor Kuchta,
Nicolás Ojeda Bär)
- #12184, #12320: Sys.rename Windows fixes on directory corner cases.
(Jan Midtgaard, review by Anil Madhavapeddy)
* #11565: Enable -strict-formats by default. Some incorrect format
specifications (for `printf`) where silently ignored and now fail.
Those new failures occur at compile-time, except if you use advanced
format features like `%(...%)` that parse format strings dynamically.
Pass -no-strict-formats to revert to the previous lenient behavior.
(Nicolás Ojeda Bär, review by David Allsopp)
### Installation size
Specific efforts have been made during this release to reduce the filesystem
size of installed artifacts of the compiler distribution.
The installation size of 5.1 is 272 MiB compared to 521 MiB for 5.0.
Some of those changes will benefit all OCaml packages.
- ocaml/RFCs#23, #12006: use compressed marshaled format from #12006 for .cmi,
.cmt, .cmti files, and for debug info in .cmo and .cma files, resulting in
major reduction in size.
(Xavier Leroy, review by Edwin Török and Gabriel Scherer,
RFC by Simon Cruanes)
- #11981: Reduce size of OCaml installations by removing debugging information
from installed bytecode executables. It is no longer possible to
run ocamldebug over these installed bytecode executables, nor to get
exception backtraces for them.
(Xavier Leroy, review by David Allsopp, report by Fabrice Le Fessant)
* #11993: install only bytecode executables for the `ocamlmklib`, `ocamlcmt`,
`ocamlprof`, `ocamlcp`, `ocamloptp`, and `ocamlmktop` tools, but no
native-code executables. A tool like `ocamlmklib` for example is now
installed directly to `$BINDIR/ocamlmklib`; `ocamlmklib.byte` and
`ocamlmklib.opt` are no longer installed to `$BINDIR`.
(Xavier Leroy, review by Gabriel Scherer)
### Runtime system:
- #11589, #11903: Modify the GC pacing code to make sure the GC keeps
up with allocations in the presence of idle domains.
(Damien Doligez and Stephen Dolan, report by Florian Angeletti,
review by KC Sivaramakrishnan and Sadiq Jaffer)
- #11743: Speed up weak array operations
(KC Sivaramakrishnan, review by François Bobot and Sadiq Jaffer)
- #12131: Simplify implementation of weak hash sets, fixing a
performance regression. (Nick Barnes, review by François Bobot,
Alain Frisch and Damien Doligez).
- #11474, #11998, #12065: Add support for user-defined events in the runtime
event tracing system.
(Lucas Pluvinage, review by Sadiq Jaffer, Guillaume Munch-Maccagnoni,
Enguerrand Decorne, Gabriel Scherer and Anil Madhavapeddy)
- #11827, #12249: Restore prefetching for GC marking
(Fabrice Buoro and Stephen Dolan, review by Gabriel Scherer and Sadiq Jaffer)
- #11144: Restore frame-pointers support for amd64
(Fabrice Buoro, review by Frédéric Bour and KC Sivaramakrishnan)
- #11935: Load frametables of dynlink'd modules in batch
(Stephen Dolan, review by David Allsopp and Guillaume Munch-Maccagnoni)
- #11284, #12525: Use compression of entries scheme when pruning mark stack.
Can decrease memory usage for some workloads, otherwise should be
unobservable.
(Tom Kelly, review by Sabine Schmaltz, Sadiq Jaffer and Damien Doligez)
* #11865, #11868, #11876: Clarify that the operations of a custom
block must never access the OCaml runtime. The previous
documentation only mentioned the main illicit usages. In particular,
since OCaml 5.0, it is no longer safe to call
`caml_remove_global_root` or `caml_remove_generational_global_root`
from within the C finalizer of a custom block, or within the
finalization function passed to `caml_alloc_final`. As a workaround,
such a finalization operation can be registered with `Gc.finalize`
instead, which guarantees to run the finalizer at a safe point.
(Report by Timothy Bourke, discussion by Yotam Barnoy, Timothy
Bourke, Sadiq Jaffer, Xavier Leroy, Guillaume Munch-Maccagnoni, and
Gabriel Scherer)
- #12130: Fix multicore crashes with weak hash sets. Fixes #11934.
(Nick Barnes, review by François Bobot)
- #12099: Add ocamlrund option, -events, to produce a trace of
debug events during bytecode interpretation. Fixes #12098.
(Richard L Ford, review by Gabriel Scherer)
- #12001: Fix book keeping for last finalisers during the minor cycle
(KC Sivaramakrishnan and Enguerrand Decorne, report by Guillaume Bury
and Vincent Laviron, review by Sadiq Jaffer and KC Sivaramakrishnan)
- #11919: New runtime events counters for major heap stats and minor heap
resizing.
(Sadiq Jaffer, review by Gabriel Scherer and David Allsopp)
- #11287, #11872, #11955: Clean up reserved header bits (once used for
Spacetime profiling).
(Nick Barnes, review by Gabriel Scherer and Damien Doligez)
- #11750: Decouple major slice from minor GC.
(KC Sivaramakrishnan, review by Sadiq Jaffer, Guillaume Munch-Maccagnoni and
Damien Doligez)
- #11796: protect lazy computation of code fragment digest by a mutex.
This makes the thread sanitizer happier, and avoids duplicating
the hashing work.
(Gabriel Scherer, review by Xavier Leroy, report by Olivier Nicole)
- #11137: new `Unsafe_store_tag(val, new_tag)` macro to stop using
`Tag_val(val)` as lvalue.
(Gabriel Scherer, review by Xavier Leroy, Guillaume Munch-Maccagnoni
and Nicolás Ojeda Bär)
- #11880: Restore the correct sigmask in systhreads.
(Christiano Haesbaert, review by Guillaume Munch-Maccagnoni and
Sébastien Hinderer)
- #11881: Fix thread-unsafety of registration of operations for "custom"
values.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer and KC
Sivaramakrishnan)
- #11980: fix quadratic behavior in natdynlink by using a STW section
for frame-descriptor updates.
(Gabriel Scherer, review by Sadiq Jaffer, report by André Maroneze
for Frama-C and Guillaume Melquiond for Coq)
- #12121: unrooted implementations of caml_callback*_exn
(Gabriel Scherer, review by KC Sivaramakrishnan and Xavier Leroy)
- #3921, #12039, #12128: poll for signals in long-running polymorphic
comparisons.
(B. Szilvasy, Gabriel Scherer and Xavier Leroy, review by
Stefan Muenzel, Guillaume Munch-Maccagnoni and Damien Doligez)
- #12231: Support MinGW-w64 11.0 winpthreads library, where the macro
to set up to get flexdll working changed
(David Allsopp and Samuel Hym, light review by Xavier Leroy)
* #12512: Add volatile casts to FFI macros to enforce memory model (technically
a breaking change although no opam package seemed broken by it.)
(Olivier Nicole, suggested by Guillaume Munch-Maccagnoni, review by Gabriel
Scherer and Xavier Leroy)
### Language features:
* #11694: Add short syntax for generative functor types `() -> ...`
(Jeremy Yallop, review by Gabriel Scherer, Nicolás Ojeda Bär,
Jacques Garrigue)
* #11457: Remove old polymorphic variant syntax.
With ``type t = [ `A | `B ]``, one could use the syntax `#t` in types,
where it means the same thing as `[< t]`, and in patterns, where it means
``(`A | `B)``. The use of `#t` in types for polymorphic variants
was deprecated since 2001, and is now removed. The syntax remains available
in patterns, or for objects -- when `t` is a class type.
(Stefan Muenzel, review by Gabriel Scherer and Jacques Garrigue)
* #11984: Add dedicated syntax for generative functor application.
Previously, OCaml did not distinguish between `F ()` and
`F (struct end)`, even though the latter looks applicative. Instead,
the decision between generative and applicative functor application
was made based on the type of `F`. With this patch, we now distinguish
these two application forms; writing `F (struct end)` for a generative
functor leads to new warning 73.
(Frédéric Bour and Richard Eisenberg, review by Florian Angeletti)
- #9975, #11365: Make empty types (`type t = |`) immediate.
(Antal Spector-Zabusky, review by Gabriel Scherer)
### Type system:
* #6941, #11187, #12483: prohibit using classes through recursive modules
inheriting or including a class belonging to a mutually-recursive module
would previous behave incorrectly, and now results in a clean error.
(Leo White, review by Gabriel Scherer and Florian Angeletti)
* #12189, #12211: anonymous row variables in explicitly polymorphic type
annotation, e.g. `'a. [< X of 'a ] -> 'a`, are now implicitly
universally quantified (in other words, the example above is now read
as `'a 'r. ([< X of 'a ] as 'r) -> 'a`).
(Florian Angeletti and Gabriel Scherer, review by Jacques Garrigue)
### Code generation and optimizations:
- #11967: Remove traces of Obj.truncate, which allows some mutable
loads to become immutable.
(Nick Barnes, review by Vincent Laviron and KC Sivaramakrishnan)
- #9945, #10883: Turn boolean-result float comparisons into primitive operations
Uses the architecture's elementary operations for float comparisons,
when available, rather than branching and then setting the return value.
(Stefan Muenzel, review by Stephen Dolan, Alain Frisch and Vincent Laviron)
- #8998, #11321, #11430: change mangling of OCaml long identifiers
from `camlModule__name_NNN` to `camlModule.name_NNN`. The previous
mangling schema, using `__`, was ambiguous.
(Xavier Leroy, report by sliquister and Michael Bacarella,
review by Gabriel Scherer)
- #10834: The -safer-matching option disables type-based optimizations of
pattern-matching compilation. This allows to produce a match failure if
a pattern-matching was wrongly assumed to be exhaustive. Since the
exhaustiveness check for GADTs has had bugs in the past, it may be
useful if you need extra security with GADTs.
(Jacques Garrigue, review by Gabriel Scherer)
- #11102: Speed up register allocation by permanently spilling registers
(Stephen Dolan, review by Xavier Leroy)
- #11383: Restrict the local function optimisation to forbid moving code
inside a sub-function
(Vincent Laviron, review by Gabriel Scherer)
- #11686: Better spilling heuristic for the Linear Scan allocator for more
efficient stack usage.
(Nicolás Ojeda Bär, Gabriel Scherer, Alain Frisch, review by Gabriel Scherer,
Alain Frisch and Nathanaëlle Courant)
- #11904: Remove arm, i386 native-code backends that were already
disabled at configuration time.
(Nicolás Ojeda Bär, review by Stephen Dolan, Anil Madhavapeddy, and Xavier
Leroy)
- #11134: Optimise 'include struct' in more cases
(Stephen Dolan, review by Leo White and Vincent Laviron)
### Other libraries:
- #11374: Remove pointer cast to a type with stricter alignment requirements
in Windows implementation of Unix.gettimeofday. Windows implementations of
caml_unix_map_file, caml_unix_lseek and caml_unix_lseek_64 now release the
runtime lock. Windows implementation of caml_unix_lockf modernised and
simplified. Where possible, 64 bit integers are used instead of LARGE_INTEGER
structs.
(David Allsopp, review by Jonah Beckford and Xavier Leroy)
- #11475: Make Unix terminal interface bindings domain-safe
(Olivier Nicole and Xavier Leroy, review by Xavier Leroy)
- #11775: Unix.write on a non-blocking socket under Windows will return normally
if the write blocks after some data has already been written (as otherwise
there is no way of knowing how much data has been written before
blocking). The same behaviour was already present under Unix.
(Nicolás Ojeda Bär, review by David Allsopp)
* #11991: Unix on Windows: map ERROR_TOO_MANY_LINKS to EMLINK.
(Nicolás Ojeda Bär)
- #12067: Document Windows specific meanings of `Unix.process_status`
type
(Samuel Hym, review by David Allsopp)
- #12072: Document and test that Sys.rename works over directories too
(Jan Midtgaard, review by Anil Madhavapeddy and Xavier Leroy)
### Tools:
- #11889, #11978: ocamldoc: handle injectivity annotations and wildcards in type
parameters.
(Florian Angeletti, report by Wiktor Kuchta, review by Jules Aguillon)
- #11787: Fix GDB scripts to work with OCaml 5's heap layout. (Nick
Barnes)
- #11772: fix ocamlyacc's handling of raw string literals
(Demi Marie Obenour)
- #9290: Add a directive to switch off debugging in toplevel.
This allows to see optimized bytecode with -dlambda.
(Jacques Garrigue, review by Gabriel Scherer)
- #11166: ocamllex: the union of two character sets "cset1 | cset2" can now be
used in any context where a character set is expected.
(Nicolás Ojeda Bär, Martin Jambon, review by Sébastien Hinderer)
- #11718: ocamlyacc: OCaml-style comments are now supported, in addition to
the C-style comments already supported. The syntax is the same as that used
in OCaml code.
(Demi Marie Obenour, review by Damien Doligez)
- #11728: ocamlyacc: generate line directives for %type declarations
(Demi Marie Obenour, review by Damien Doligez)
- #11773: ocamlyacc: Do not allow quoted literals (such as 'a' or "bc")
in a token name or %type declaration. Previously such literals were
accepted by ocamlyacc, but produced malformed OCaml that was rejected
by the compiler.
(Demi Marie Obenour, review by Gabriel Scherer)
- #11774: ocamlyacc: fail if there is an I/O error
(Demi Marie Obenour, review by Gabriel Scherer)
- #11973: Add support for postfixed mingw host triplets
(Romain Beauxis)
- #12165: ocamldoc, use standard doctype to avoid quirk mode.
(Florian Angeletti, review by Gabriel Scherer)
### Manual and documentation:
- #11476: Add examples in documentation of Hashtbl, Queue, Atomic, Format
(Simon Cruanes, review by Yotam Barnoy, Gabriel Scherer, Daniel Bünzli,
Ulugbek Abdullaev, and Nicolás Ojeda Bär)
- #11883, #11884: Update documentation for In_channel and Out_channel
with examples and sections to group related functions.
(Kiran Gopinathan, review by Daniel Bünzli and Xavier Leroy)
- #12095, #12097: Put the sample code of the user's manual and reference
documentation of the standard library under the CC0 1.0 Universal
(CC0 1.0) Public Domain Dedication license.
- #11892: Document the semantic differences of Unix.exec* between Unix and
Windows.
(Boris Yakobowski, review by Daniel Bünzli, Gabriel Scherer and Nicolás Ojeda
Bär)
- #9430, #11291: Document the general desugaring rules for binding operators.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #11481: Fix the type of Unix.umask to Unix.file_perm -> Unix.file_perm
(Favonia, review by Sébastien Hinderer)
- #11514: Document ocamltest builtin variables and actions
(Olivier Nicole, review by Sébastien Hinderer)
- #11676: Fix missing since annotation in the `Sys` and `Format` modules
(Github user Bukolab99, review by Florian Angeletti)
- #12028: Update format documentation to make it clearer that
`pp_print_newline` flushes its newline
(Florian Angeletti, review by Gabriel Scherer)
- #12201: in the tutorial on modules, replace priority queue example by
a simpler example based on FIFO queues.
(Xavier Leroy, review by Anil Madhavapeddy and Nicolás Ojeda Bär).
- #12352: Fix a typo in the documentation of Arg.write_arg
(Christophe Raffalli, review by Florian Angeletti)
- #7179, #11894: correct the description of CAMLreturn and CAMLreturn0 in
the Interfacing C page and memory.h file.
(Dong An, review by Guillaume Munch-Maccagnoni and Olivier Nicole )
### Compiler user-interface and warnings:
- #10647: Show hints for the "undefined global" error in the toplevel
(Wiktor Kuchta, review by Gabriel Scherer)
- #12116: Don't suggest to insert a semicolon when the type is not unit
(Jules Aguillon, review by Florian Angeletti)
- #11679: Improve the error message about too many arguments to a function
(Jules Aguillon, review by Gabriel Scherer and Florian Angeletti)
- #10009: Improve the error reported by mismatched struct/sig and =/: in module
and module type bindings.
(Jules Aguillon, review by Gabriel Scherer)
- #11530: Include kinds in kind mismatch error message.
"Error: This variant or record definition does not match that of type M.t
The original is abstract, but this is a record".
(Leonhard Markert, review by Gabriel Scherer and Florian Angeletti)
- #11646: Add colors to error message hints.
(Christiana Anthony, review by Florian Angeletti)
- #11235, #11864: usage warnings for constructors and fields can now be disabled
on field-by-field or constructor-by-constructor basis
(Florian Angeletti, review by Gabriel Scherer)
- #11888: Improve the error message when type variables cannot be deduced from
the type parameters:
Before:
"Error: In this definition, a type variable cannot be deduced
from the type parameters."
After:
"Error: In the GADT constructor
T : 'a -> 'a s t
the type variable 'a cannot be deduced from the type parameters."
(Stefan Muenzel, review by Florian Angeletti and Gabriel Scherer)
- #10818: Preserve integer literal formatting in type hint.
(Leonhard Markert, review by Gabriel Scherer and Florian Angeletti)
- #11338: Turn some partial application warnings into hints.
(Leo White, review by Stephen Dolan)
- #10931: Improve warning 14 (illegal backslash) with a better explanation
of the causes and how to fix it.
(David Allsopp, Florian Angeletti, Lucas De Angelis, Gabriel Scherer,
review by Nicolás Ojeda Bär, Florian Angeletti, David Allsopp and
Gabriel Scherer)
- #10911: Improve the location reported by parenthesized assert expressions
(Fabian Hemmer, review by Gabriel Scherer)
- #1391, #7645, #3922: Add an early error when compiling different
modules with mismatching -for-pack
(Pierre Chambart and Vincent Laviron, review by Mark Shinwell)
- #11297: Report "unclosed" error when "done" is missing in a "do .. done"
construct.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #11635, #5461, #10564: turn warning 31 (Module_linked_twice) into a hard error
for ocamlc — this was already an error with ocamlopt.
(Hugo Heuzard, review by Valentin Gatien-Baron and Gabriel Scherer)
- #11653: Add the -no-absname option to ocamlc, ocamlopt and ocamldep.
(Abiola Abdulsalam, review by Sébastien Hinderer and Florian Angeletti)
- #11696: Add the -no-g option to ocamlc and ocamlopt.
(Abiola Abdulsalam, review by Sébastien Hinderer, Nicolás Ojeda Bär and
Florian Angeletti)
- #11722: clearer error messages on non-well-founded type definitions
(Gabriel Scherer, review by Jacques Garrigue)
- #11819: make the `native_compiler` and `native_dynlink` configuration
variables available through ocamlc -config.
(Sébastien Hinderer, review by Gabriel Scherer and David Allsopp)
- #8602, #11863: Add -stop-after lambda flag option
(Douglas Smith and Dmitrii Kosarev, review by Gabriel Scherer)
- #11910: Simplify naming convention for shadowed or ephemeral identifiers in
error messages (eg: `Illegal shadowing of included type t/2 by t`)
(Florian Angeletti, review by Jules Aguillon)
- #12024: insert a blank line between separate compiler messages
(Gabriel Scherer, review by Florian Angeletti, report by David Wong)
- #12088, #9265, #11949: ocamldebug: fix confusing repeating behavior
on blank lines within source scripts
(Damien Doligez, review by Gabriel Scherer, report by Gaëtan Gilbert)
- #12107: use aliases to mark weak row variables: `_[< ... ]`, `< _..>`, `_#ct`
are now rendered as `[< ...] as '_weak1`, `< .. > as '_weak1`,
and `#ct as '_weak1`.
(Florian Angeletti, suggestion by Stefan Muenzel, review by Gabriel Scherer)
- #12051: Improve the error messages when type variables cannot be generalized
(Stefan Muenzel, review by Florian Angeletti)
* #12094: Trigger warning 5 (ignored-partial-application) when the scrutinee of
a pattern matching is of arrow type and all cases match wildcard or exception
patterns.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #11018, #11869: Clean up Types.Variance, adding a description of
the lattice used, and defining explicitly composition.
(Jacques Garrigue, review by Gabriel Scherer and Jeremy Yallop)
- #11536: Introduce wrapper functions for level management
([Ctype.with_level], etc) and for type variable scoping
([Typetexp.with_local_type_variable_scope]).
The older API ([Ctype.(begin_def,end_def)], [Typetexp.(narrow,widen)], etc.)
is now removed.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #11601, #11612, #11628, #11613, #11623, #12120 : Clean up some
global state handling in emitcode, bytepackager, bytegen,
bytesections, spill.
(Hugo Heuzard, Stefan Muenzel, review by Vincent Laviron, Gabriel Scherer
and Nathanaëlle Courant)
- #12119, #12188, #12191: mirror type constraints on value binding in the
parsetree:
the constraint `typ` in `let pat : typ = exp` is now directly stored
in the value binding node in the parsetree.
(Florian Angeletti, review by Richard Eisenberg)
- #11912: Refactoring handling of scoped type variables
(Richard Eisenberg, review by Gabriel Scherer and Florian Angeletti)
- #11691, #11706: use __asm__ instead of asm for strict ISO C conformance
(Xavier Leroy, report by Gregg Reynolds , review by Sadiq Jaffer)
- #11693: Remove use of C99 Variable Length Arrays (VLAs) in the runtime.
(David Allsopp, review by Xavier Leroy, Guillaume Munch-Maccagnoni,
Stefan Muenzel and Gabriel Scherer)
- #12138: Generalise interface for BUILD_PATH_PREFIX_MAP mapping.
Absolute paths are now rewritten too.
(Richard L Ford, suggestions and review by Gabriel Scherer)
- #10512: explain the compilation strategy for switches on constructors
(Gabriel Scherer, review by Vincent Laviron)
- #11990: Improve comments and macros around frame descriptors.
(Nick Barnes, review by Gabriel Scherer)
- #11847, #11849, #11851, #11898: small refactorings in the type checker
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #11027: Separate typing counter-examples from type_pat into retype_pat;
type_pat is no longer in CPS.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #11286, #11515: disambiguate identifiers by using how recently they have
been bound in the current environment
(Florian Angeletti, review by Gabriel Scherer)
- #11364: Allow `make -C testsuite promote` to take `TEST` and `LIST` variables
(Antal Spector-Zabusky, review by Gabriel Scherer and David Allsopp)
- #11446: document switch compilation (lambda/switch.ml)
(Gabriel Scherer, review by Luc Maranget and Vincent Laviron)
- #11568: Encode inline record types in Path.t
(Leo White and Hyunggyu Jang, review by Gabriel Scherer)
- #11569: Remove hash type encoding
(Hyunggyu Jang, review by Gabriel Scherer and Florian Angeletti)
- #11627: use return values instead of globals for linear scan intervals
(Stefan Muenzel, review by Nicolás Ojeda Bär)
- #11634: Dll.open_dll now properly handles opening for execution while already
opened for checking
(Hugo Heuzard, review by Nicolás Ojeda Bär)
* #11745, #12358: Debugger and toplevels: embed printer types rather than
reading their representations from topdirs.cmi at runtime.
This change also removes the ocamlmktop initialization module introduced
in #11382 which was no longer useful.
This change breaks toplevel scripts relying on the visibility of `Topdirs`
in the initial toplevel environment without loading `topfind`.
Since the opam default `.ocamlinit` file loads `topfind`, it is expected
that only scripts run with `ocaml -noinit` are affected.
For those scripts, accessing `Topdirs` now requires the `compiler-libs`
directory to be added to the toplevel search path with
```
#directory "+compiler-libs";;
````
as was already the case for the other modules in the toplevel interface
library.
(Sébastien Hinderer, review by Florian Angeletti, Nicolás Ojeda Bär and
Gabriel Scherer)
- #11615: remove global variables form asmcomp/linearize.ml
(Stefan Muenzel, review by Nicolás Ojeda Bär
- #10856: Add location, attribute(s) visitors to Tast_mapper/Tast_iterator
(Yan Dong, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #11933: Use the correct machtype when reading the code pointer from closures
(Nathanaëlle Courant, review by Gabriel Scherer and Vincent Laviron)
- #11972: refactor runtime/frame_descriptors.c
in preparation for quadratic-time fix
(Gabriel Scherer, review by Enguerrand Decorne)
- #11997: translate structured constants into their Obj.t representation
at compile time rather than link time. Changes the way dumpobj prints
these constants because their representation becomes untyped.
(Sébastien Hinderer, review by Xavier Leroy, Nicolás Ojeda Bär and
Hugo Heuzard)
- #12011: remove Ctype.reified_var_counter
(Takafumi Saikawa and Jacques Garrigue, review by Gabriel Scherer)
- #12012: move calls to Typetexp.TyVarEnv.reset inside with_local_level etc.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #12034: a logarithmic algorithm to find the next free variable
(Gabriel Scherer, review by Stefan Muenzel)
- #12092: remove Lev_module_definition from lambda
(Nick Roberts, review by Gabriel Scherer)
- #12117: Remove arity-interrupting elaboration of module unpacks
(Nick Roberts, review by Richard Eisenberg and Jacques Garrigue)
- #12118: stop storing names of predefined exceptions in the
cu_required_globals field of compilation unit descriptors.
(Sébastien Hinderer, review by Vincent Laviron)
- #12125: Add Misc.print_see_manual and modify [@manual_ref] to accept
lists for simpler printing of manual references
(Stefan Muenzel, review by Florian Angeletti)
### Build system:
- #11844: Reduce verbosity of `make` logs by printing program invocations in
shorthand (eg `OCAMLC foo.cmo`). Setting `V=1` recovers the old style (with
full command-lines).
(Xavier Leroy, Nicolás Ojeda Bär, review by Sébastien Hinderer)
- #11243, #11248, #11268, #11420, #11675: merge the sub-makefiles into
the root Makefile.
(Sébastien Hinderer, review by David Allsopp and Florian Angeletti)
- #11828: Compile otherlibs/ C stubs in two version for native and bytecode
(Olivier Nicole, review by Sébastien Hinderer and Xavier Leroy)
- #12265: Stop adding -lexecinfo to cclibs (leftover debugging code from the
multicore project). Harden the feature probe for -lm in configure so -lm is
only added if strictly necessary. configure.ac now correctly propagates
library flags for the Windows ports, allowing Windows OCaml to be configured
with ZSTD support.
(David Allsopp, review by Sébastien Hinderer)
### Bug fixes:
- #8813, #12029: In the toplevel, let the user type several phrases in one line
(Damien Doligez, report by Daniel Bünzli, review by Gabriel Scherer and
Wiktor Kuchta)
- #12062: fix runtime events consumer: when events are dropped they shouldn't be
parsed. (Lucas Pluvinage)
- #12132: Fix overcounting of minor collections in GC stats.
(Damien Doligez, review by Gabriel Scherer)
- #12017: Re-register finaliser only after calling user alarm in Gc.create_alarm
(Fabrice Buoro, report by Sam Goldman, review by Guillaume Munch-Maccagnoni)
- #11887, #11893: Code duplication in pattern-matching compilation
(Vincent Laviron, report par Greta Yorsh, review by Luc Maranget and
Gabriel Scherer)
- #10664, #11600: Unsoundness in the typing of polymorphic methods
involving polymorphic variants
(Jacques Garrigue, report by Mike Shulman, review by Gabriel Scherer)
- #11302, #11412: `ocamlc` and `ocamlopt` should not remove generated files
when they are not regular files.
(Xavier Leroy, report by Thierry Martinez, review by
Anil Madhavapeddy, Nicolás Ojeda Bär, David Allsopp)
- #10348, #10560, #11561: Expand GADT equations lazily during unification to
avoid ambiguity
(Jacques Garrigue, review by Leo White)
- #11436: Fix wrong stack backtrace for out-of-bound exceptions raised
by leaf functions.
(Tom Kelly and Xavier Leroy, review by Mark Shinwell)
- #11450, #12018: Fix erroneous functor error messages that were too eager to
cast `struct end` functor arguments as unit modules in `F(struct end)`.
(Florian Angeletti, review by Gabriel Scherer)
- #11643: Add missing test declaration to float_compare test, so that it will
run.
(Stefan Muenzel, review by David Allsopp)
- #11630: Use correct location when reporting record labels with non-existent
paths.
(Nicolás Ojeda Bär, report by Jason Gross, review by Gabriel Scherer)
- #11727: Ensure push_defaults can push past module patterns, fixing an
currying optimisation accidentally disabled by #10340.
(Stephen Dolan, review by Gabriel Scherer)
- #11771: Use a more relaxed mode for unification in Ctype.subst
(Leo White, review by Jacques Garrigue and Gabriel Scherer)
- #11803, #11808: on x86, the destination of an integer comparison must be
a register, it cannot be a stack slot.
(Vincent Laviron, review by Xavier Leroy, report by
Emilio Jesús Gallego Arias)
- #11809: Protect Parmatch.pats_of_type from missing cmis
(Jacques Garrigue, review by Stephen Dolan and Gabriel Scherer)
- #11824: Fix a crash when calling `ocamlrun -b`
(Florian Angeletti, review by Sébastien Hinderer)
- #11815: Marshalling continuations raises invalid argument exception.
(Jérôme Vouillon, review by Nicolás Ojeda Bär, Stephen Dolan and
Hugo Heuzard)
- #11846: Mark rbx as destroyed at C call for Win64 (mingw-w64 and Cygwin64).
Reserve the shadow store for the ABI in the c_stack_link struct instead of
explicitly when calling C functions. This simultaneously reduces the number of
stack pointer manipulations and also fixes a bug when calling noalloc
functions where the shadow store was not being reserved.
(David Allsopp, report by Vesa Karvonen, review by Xavier Leroy and
KC Sivaramakrishnan)
- #11850: When stopping before the `emit` phase (using `-stop-after`), an empty
temporary assembly file is no longer left in the file system.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)
- #11866: Fix the result of `caml_read_directory()` on non-existent paths.
(Andrei Paskevich and Charlène Gros, review by David Allsopp and
Nicolás Ojeda Bär)
- #11879: Bugfix for Ctype.nondep_type
(Stephen Dolan, review by Gabriel Scherer)
- #12004: Don't ignore function attributes on lambdas with locally abstract
types.
(Chris Casinghino, review by Gabriel Scherer)
- #12037: Fix some data races by using volatile when necessary
(Fabrice Buoro and Olivier Nicole, review by Guillaume Munch-Maccagnoni,
Gabriel Scherer and Luc Maranget)
- #12046: Flush stderr when tracing the parser
(Hugo Heuzard, review by David Allsopp and Nicolás Ojeda Bär)
- #12061, #12063: don't add inconsistent equalities when computing
high-level error messages for functor applications and inclusions.
(Florian Angeletti, review by Gabriel Scherer)
- #12075: auto-detect whether `ar` support @FILE arguments at
configure-time to avoid using this feature with toolchains
that do not support it (eg FreeBSD/Darwin).
(Nicolás Ojeda Bär, review by Xavier Leroy, David Allsopp, Javier
Chávarri, Anil Madhavapeddy)
- #12103, 12104: fix a concurrency memory-safety bug in Buffer
(Gabriel Scherer, review by Florian Angeletti, report by Samuel Hym)
- #12112: Fix caml_callback{2,3}_exn when used with effect handlers.
(Lucas Pluvinage, review by Gabriel Scherer, David Allsopp and Xavier Leroy)
- #12134: Use ghost location for nodes created when handling defaults in
optional arguments.
(Paul-Elliot Anglès d'Auriac, review by Gabriel Scherer)
- #12153: Fix segfault in bytecode programs involving recursive value
definitions of values of size 0
(Vincent Laviron, Xavier Leroy, Gabriel Scherer,
review by Xavier Leroy, report by Nick Roberts)
- #12162: Fix miscompilation on amd64 backends involving integer overflows
(Vincent Laviron and Greta Yorsh, review by Stefan Muenzel)
- #12170: fix pthread_geaffinity_np configure check for android
(David Allsopp, review by Sébastien Hinderer)
- #12178: Fix runtime events consumer poll function returning an invalid value
instead of an OCaml integer value. (Lucas Pluvinage)
- #12252: Fix shared library build error on RISC-V.
(Edwin Török, review by Nicolás Ojeda Bär and Xavier Leroy)
- #12255, #12256: Handle large signal numbers correctly (Nick Barnes,
review by David Allsopp).
- #12277: ARM64, fix a potential assembler error for very large functions by
emitting stack reallocation code before the body of the function.
(Xavier Leroy, review by KC Sivaramakrishnan)
- #12253, #12342: Fix infinite loop in signal handling.
(Guillaume Munch-Maccagnoni, report by Thomas Leonard, review by
KC Sivaramakrishnan and Sadiq Jaffer)
- #12445: missing GC root registrations in runtime/io.c
(Gabriel Scherer, review by Xavier Leroy and Jeremy Yallop)
- #12481, #12505: Fix incorrect initialization of array expressions
`[|e1;...;eN|]` when `N` is large enough to require major heap allocation.
(Xavier Leroy, report by Andrey Popp, analysis by KC Sivaramakrishnan
and Vincent Laviron, review by Gabriel Scherer)
- #11150, #11207, #11936: Avoid recomputation in Typedecl.check_wellfounded
(Jacques Garrigue, report by Boris Yakobowski, review by Gabriel Scherer)
- #11186, #11188: Fix composition of coercions with aliases
(Vincent Laviron, report and review by Leo White)
- #12486: Fix delivery of unhandled effect exceptions on s390x
(Miod Vallat, report by Jan Midtgaard, review by Vincent Laviron and Xavier
Leroy)
OCaml 5.0.0 (15 December 2022)
------------------------------
- #10831: Multicore OCaml
(Enguerrand Decorne, Stephen Dolan, Tom Kelly, Sadiq Jaffer,
Anil Madhavapeddy, Sudha Parimala, KC Sivaramakrishnan,
Leo White, the Tarides multicore team,
review by Florian Angeletti, Damien Doligez, Xavier Leroy,
Guillaume Munch-Maccagnoni, Olivier Nicole, Nicolás Ojeda Bär,
Gabriel Scherer, the OCaml core development team, and many
other valued reviewers.)
### Language features:
### Runtime system:
- #11400: Runtime events counters fixes
Fixes mismatch between OCaml and C APIs, removes events from 4.x that
are not present in the 5.0 GC and adds some missing probes.
(Sadiq Jaffer, review by Gabriel Scherer, Florian Angeletti)
- #11368: Runtime events buffer size OCAMLRUNPARAMS fix
The runtime events buffer size can now be set via the 'e' OCAMLRUNPARAM.
This is previously mistakenly enabled/disabled tracing instead.
(Sadiq Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien Doligez)
- #11308: Add environment variable to preserve runtime_events after exit
If the environment variable OCAML_RUNTIME_EVENTS_PRESERVE exists then the
runtime will not remove the runtime events ring buffers at exit. This
makes tracing very short running programs more reliable.
(Sadiq Jaffer, review by KC Sivaramakrishnan)
- #10964: Ring-buffer based runtime tracing (runtime_events)
Runtime_events is a very low overhead runtime tracing system designed for
continuous monitoring of OCaml applications.
(Sadiq Jaffer, review by Anil Madhavapeddy, Enguerrand Decorne,
Richard Warburton, Gabriel Scherer, Sabine Schmaltz, Florian Angeletti,
Patrick Ferris, Tom Kelly)
* #10723: do not use `-flat-namespace` linking for macOS.
(Carlo Cabrera, review by Damien Doligez)
* #10863, #10933: Remove support for old, unprefixed C runtime function names
such as `alloc`. The new names prefixed with `caml_` must be used instead,
such as `caml_alloc`. Consequently, it is no longer needed to define
`CAML_NAME_SPACE` to avoid bringing unprefixed names into scope: this is now
the default behavior.
(Nicolás Ojeda Bär, review by Xavier Leroy)
- #10902: Do not register empty code fragments in natdynlink.
(David Allsopp, review by Xavier Leroy and Damien Doligez)
- #10965: `caml_fatal_error_hook`, GC timing hooks, and
`caml_scan_roots_hook` are now atomic variables. Restore GC timing
hooks in multicore.
(Guillaume Munch-Maccagnoni, review by Enguerrand Decorne, Xavier
Leroy, Gabriel Scherer, and KC Sivaramakrishnan)
- #11209: Add a public and thread-safe timing hook running at domain
termination, after this domain has stopped running any OCaml code:
`caml_domain_terminated_hook`. This can be useful for implementing
domain-local state in C.
(Guillaume Munch-Maccagnoni, review by Xavier Leroy and Gabriel
Scherer)
- #10875, #11731: Add option to allocate fiber stacks and sigaltstacks with
mmap(MAP_STACK) instead of malloc. This is exposed via a configure
--enable-mmap-map-stack option, and is enabled by default on OpenBSD where
it is mandatory.
(Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly,
Michael Hendricks and KC Sivaramakrishnan).
- #10950: Do not use mmap to allocate Caml_state.
In order to reduce virtual memory usage, we dynamically allocate
the domain_state structure.
(Enguerrand Decorne, KC Sivaramakrishnan and Tom Kelly,
review by Anil Madhavapeddy and Gabriel Scherer)
- #11010: Use strerror_r for reentrant error string conversion.
(Anil Madhavapeddy and Xavier Leroy, review by same and Edwin Török)
- #11002, #11066, #11086: Do not use Begin_roots/End_roots macros in
the runtime system. Also fix a missing root registration in the
implementation of Unix.write on Windows.
(Nicolás Ojeda Bär, Daniel Bünzli and Antonin Décimo,
review by Xavier Leroy and David Allsopp)
- #11022: Track GC work for all managed bigarray allocations
(Stephen Dolan, report by Andrew Hunter, review by Damien Doligez)
- #10802: Use 4.12 value macros and helpers in C code
(Antonin Décimo, review by Gabriel Scherer)
- #11105: Fix handling of fiber stack cache with multiple domains
(Jon Ludlam, KC Sivaramakrishnan and Tom Kelly)
- #11054: Respect user provided maximum stack space
Make sure the stack we initially request is sized accordingly to
the user provided settings. tmc/stack_space is also updated by
this PR in order to account for this change.
(Enguerrand Decorne, report by Jon Ludlam,
review by Tom Kelly, KC Sivaramakrishnan and Gabriel Scherer)
- #11238: Increase the default limit for the stack size to 128 Mi words,
i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.
(Xavier Leroy, review by Sébastien Hinderer)
* #11295: An ISO C 2011 compliant compiler, including full support for atomic
types, is now required to build the OCaml runtime system.
(Xavier Leroy, review by David Allsopp and Sébastien Hinderer)
- #10915, #11039, #11057, #11095, #11190: Implement quality treatment for
asynchronous actions in multicore. Reimplement the old behaviour of
`caml_process_pending*` for multicore.
(Guillaume Munch-Maccagnoni, review by Sadiq Jaffer and Gabriel Scherer)
- #11303: Ensure that GC is not invoked from bounds check failures
(Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy)
- #11304: Fix data race on Windows file descriptors
(Olivier Nicole and Xavier Leroy, review by Xavier Leroy, David Allsopp,
and Sadiq Jaffer)
* #11337: pass 'flags' metadata to root scanners, to optimize stack
scanning in the bytecode interpreter.
Changes the interface of user-provided root-scanning hooks.
(Gabriel Scherer, review by Xavier Leroy,
Guillaume Munch-Maccagnoni, Sadiq Jaffer and Tom Kelly)
* #11255: in the C interface, `&Field(v, i)` now has type `volatile value *`
instead of `value *` in OCaml 4. This makes the memory model
for mixed OCaml/C code better defined, but can cause warnings or type
errors in user C code.
(KC Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and
Guillaume Munch-Maccagnoni, additional discussions with Stephen
Dolan and Luc Maranget)
- #5299, #4787, #11138, #11272, #11506: To help debugging, `Caml_state`
now dynamically checks that the domain lock is held, and fails
otherwise (with a fatal error at most entry points of the C API, or
systematically in debug mode). A new variable `Caml_state_opt` is
introduced, and is `NULL` when the domain lock is not held. This
allows to test from C code if the current thread holds the lock of
its domain.
(Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien
Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer)
- #11223: The serialization format of custom blocks changed in 4.08,
but the deserializer would still support the pre-4.08 format. OCaml
5.x removed support for this old format; provide a clear error message
in this case.
(Hugo Heuzard, review by Gabriel Scherer)
- #11504, #11522: Use static allocation in `caml_make_float_vect` in
no-flat-float-array mode, it's more efficient and avoids a a race condition
(Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp)
- #11652: Fix benign off-by-one error in Windows implementation of caml_mem_map.
(David Allsopp, review by Gabriel Scherer)
- #11669, #11704: Fix construction of Effect.Unhandled exceptions in the
bytecode interpreter.
(David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy
and Gabriel Scherer)
### Code generation and optimizations:
- #10972: ARM64 multicore support: OCaml & C stack separation;
dynamic stack size checks; fiber and effects support.
(Tom Kelly and Xavier Leroy, review by KC Sivaramakrishnan, Xavier Leroy,
Guillaume Munch-Maccagnoni, Eduardo Rafael, Stephen Dolan and
Gabriel Scherer)
### Standard library:
- #10742: Use LXM as the pseudo-random number generator for module Random.
Add `Random.State.split` and `Random.split` to "split" a PRNG off
another PRNG.
(Xavier Leroy, review by Gabriel Scherer and Hugo Heuzard)
* #10867, #11345: Remove deprecated values: Array.create, Array.make_float,
Array.create_matrix, Bytes.uppercase, Bytes.lowercase, Bytes.capitalize,
Bytes.uncapitalize, Char.lowercase, Char.uppercase, Filename.temp_dir_name,
Int32.format, Int64.format, Nativeint.format, Format.bprintf, Format.kprintf,
Format.set_all_formatter_output_functions,
Format.get_all_formatter_output_functions,
Format.pp_set_all_formatter_output_functions,
Format.pp_get_all_formatter_output_functions, Format.pp_open_tag,
Format.pp_close_tag, Format.open_tag, Format.close_tag,
Format.formatter_tag_functions, Format.pp_set_formatter_tag_functions,
Format.pp_get_formatter_tag_functions, Format.set_formatter_tag_functions,
Format.get_formatter_tag_functions, Gc (mutability of the fields of type
Gc.control), Lazy.lazy_from_fun, Lazy.lazy_from_val, Lazy.lazy_is_val,
Obj.set_tag, Obj.truncate, Obj.final_tag, Obj.extension_constructor,
Obj.extension_name, Obj.extension_id, Scanf.stdib, Scanf.fscanf,
Scanf.kfscanf, Stdlib.( & ), Stdlib.( or ), String.set, String.copy,
String.fill, String.unsafe_set, String.unsafe_fill, String.uppercase,
String.lowercase, String.capitalize, String.uncapitalize, Thread.kill,
Thread.wait_write, Thread.wait_read, the whole ThreadUnix module, the
infix operator (.[]<-).
(Nicolás Ojeda Bär, review by Damien Doligez)
* #10896: Remove Stream, Genlex and Pervasives. Also remove legacy standalone
bigarray library (the Bigarray module is now part of the standard library).
(Nicolás Ojeda Bär, review by Kate Deplaix and Anil Madhavapeddy)
- #10921: Use getentropy, when available, to seed the generator during
`Random.self_init`
(Michael Hendricks, review by Gabriel Scherer, Xavier Leroy, and
Anil Madhavapeddy)
* #10924: Add deprecated attribute to Printexc.catch, Printf.kprintf and
Unix.SO_ERROR.
(Nicolás Ojeda Bär, review by Damien Doligez)
- #10986: Add Scanf.sscanf_opt, Scanf.bscanf_opt and Scanf.scanf_opt.
(Nicolás Ojeda Bär, review by Florian Angeletti and Gabriel Scherer)
* #11157: Rename "hash" in the "Hashtbl.SeededHashedType" signature to
"seeded_hash". This allows defining both seeded and unseeded hash functions in
the same module.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)
- #8878: Add String.hash and String.seeded_hash.
(Tom Kelly, review by Alain Frisch and Nicolás Ojeda Bär)
- #11279, #11585, #11742: ensure that the unsafe Buffer code
remains memory-safe in concurrent settings.
Unsynchronized access to Buffer is a programming error and may
result in wrong behavior, but it should preserve memory-safety.
(Florian Angeletti and Gabriel Scherer, review by Gabriel Scherer
and Vincent Laviron, report by David Allsopp)
### Other libraries:
* #9071, #9100, #10935: Reimplement `Thread.exit()` as raising the
exception `Thread.Exit`, and mark `Thread.exit` as deprecated.
The new implementation changes the behavior compared with
the OCaml 4 implementation. For example, the new implementation
causes `Fun.finally` finalizers to be run and catch-all exception
handlers to prevent termination.
(Jacques-Henri Jourdan and Xavier Leroy, review by Damien Doligez,
Guillaume Munch-Maccagnoni, Gabriel Scherer, and Enguerrand Decorne)
- #11034: Dynlink library, add a global lock to make dynlinking
thread-safe.
(Florian Angeletti, review by Gabriel Scherer)
- #11087: deprecate Thread.wait_timed_read, Thread.wait_timed_write,
Thread.select, Thread.wait_pid. The same functionality is available in the
Unix module.
(Nicolás Ojeda Bär, review by Anil Madhavapeddy)
- #11309, #11424, #11427, #11545: Add Domain.recommended_domain_count.
(Christiano Haesbaert, Konstantin Belousov, review by David Allsopp,
KC Sivaramakrishnan, Gabriel Scherer, Nicolás Ojeda Bär)
- #11461, #11466: Fix gethostbyaddr for IPv6 arguments and make it domain-safe
(Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy,
review by the same)
- #11479: Make Unix.symlink domain-safe on Windows
(Olivier Nicole, review by Xavier Leroy and David Allsopp)
### Tools:
* #11004: Litmus tests for checking the implementation of the
memory model.
(Luc Maranget, review by Gabriel Scherer and Xavier Leroy)
- #11024: Handle alerts in ocamldoc.
The alert `[@@alert deprecated]` is handled specifically and it's no longer
needed to duplicate the deprecated annotation (the alert for the compiler and
the tag for the documentation). Every other alerts also appear in the
documentation.
(Jules Aguillon, review by Florian Angeletti)
- #11065: Port the bytecode debugger to 5.0, adding support for effect handlers.
(Damien Doligez and @fabbing, review by @fabbing and Xavier Leroy)
- #11079: Add the -nobanners option to dumpobj.
(Sébastien Hinderer, review by Gabriel Scherer and Vincent Laviron)
- #11100: Fix ocamltest to make sure failed tests are not counted as
"unexpected error".
(Damien Doligez, review by Sébastien Hinderer)
- #11245: Merge the common code of ocamlcp and ocamloptp into a single module.
(David Allsopp, review by Sébastien Hinderer)
- #11382: OCamlmktop use a new initialization module "OCamlmktop_init" to
preserve backward-compatibility with user-module provided modules that install
toplevel printers.
(Florian Angeletti, review by Gabriel Scherer and David Allsopp)
### Manual and documentation:
- #11058: runtime/HACKING.adoc tips on debugging the runtime
(Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)
- #11093: Add an effect handlers tutorial
(KC Sivaramakrishnan, review by François Pottier, Gabriel Scherer, François
Bobot and Wiktor Kuchta)
- #11192: Better documentation for condition variables.
(François Pottier, review by Luc Maranget, Xavier Leroy, and Wiktor Kuchta)
- #11093: Add tutorials on parallelism features and the relaxed memory model
(KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel
Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice
Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan)
- #11640, #11647: Add missing options to the man pages:
flambda commonly-used options, and negative options (`-no-rectypes`, ... ).
(Amandine Nangah, review by David Allsopp, Florian Angeletti,
Sébastien Hinderer, and Vincent Laviron)
- #11676: Fix missing since annotation in the `Sys` and `Format` modules
(Github user Bukolab99, review by Florian Angeletti)
- #11813: Make new multicore chapters easier to discover, and emphasize impact
on C bindings.
(Edwin Török, review by KC Sivaramakrishnan, and Florian Angeletti)
### Compiler user-interface and warnings:
- #9140, #11131: New command-line flag -nocwd to not include implicit
the current directory to the load path.
(Thomas Roglin, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #11089: Add 'since <version>' information to compiler warnings.
(André Maroneze, review by Florian Angeletti and Gabriel Scherer)
- #10909: Disable warning 59 (assignment to immutable blocks) unless flambda
invariant checks are enabled.
(Vincent Laviron, review by Gabriel Scherer)
- #10981, #11276: Implement a -cmi-file option for ocamlc and ocamlopt.
(Sébastien Hinderer, review by Damien Doligez, Daniel Bünzli and
Florian Angeletti)
* #11049: Stop padding 1-digit compiler minor version numbers.
(So for instance OCaml 5.0 rather than 5.00)
(Sébastien Hinderer, review by David Allsopp, Florian Angeletti and
Xavier Leroy)
- #11253: Deprecate `ocaml script` and `ocamlnat` script where `script` has no
extension and is an implicit basename.
(David Allsopp, review by Florian Angeletti and Sébastien Hinderer)
### Internal/compiler-libs changes:
- #10878, #10909: restore flambda after the Multicore merge.
(Vincent Laviron, review by Gabriel Scherer and Xavier Leroy)
- #10864, #10888: restore afl-fuzz mode for sequential programs.
(Jan Midtgaard, review by Xavier Leroy and Gabriel Scherer)
- #11008, #11047: rework GC statistics in the Multicore runtime
(Gabriel Scherer, review by Enguerrand Decorne)
- #11058: basic debugging documentation in runtime/HACKING.adoc
(Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)
- #11199: Stop installing topdirs.cmi twice. The toplevel now reads topdirs.cmi
from +compiler-libs, as the debugger does.
(David Allsopp, review by Sébastien Hinderer)
- #11007, #11399: META files for the stdlib, compiler-libs and other libraries
(unix, dynlink, str, runtime_events, threads, ocamldoc) are now installed
along with the compiler.
(David Allsopp, Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer,
review by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel Scherer)
### Build system:
* #10893: Remove configuration options --disable-force-safe-string and
DEFAULT_STRING=unsafe as well as --enable-force-safe-string and
DEFAULT_STRING=safe which are now the default unconditionally.
(Kate Deplaix, review by Gabriel Scherer and David Allsopp)
- #11092: Build native-code compilers on OpenBSD/aarch64.
(Christopher Zimmermann, review by Anil Madhavapeddy)
- #11126: Build system: make it possible to choose which ocamldep
(and flags) to use when computing dependencies for the compiler.
Add a -no-slash option to ocamldep to let users override -slash.
(Sébastien Hinderer, review by David Allsopp)
- #11147: Factorize the stdlib-related compilation flags. Make it
possible to control them consistently through the STDLIBFLAGS
build variable. Make sure ocamldoc and ocamllex get compiled and
linked with debugging information (-g).
(Sébastien Hinderer, review by Gabriel Scherer)
- #11149: Make the bootstrap process reproducible on systems with non-big-endian
floating point. If the boot/ artefacts are up-to-date, this means that running
make bootstrap on any platform should not change the images in boot/ and paves
the way for automated testing that the bootstrap is repeatable.
(David Allsopp, review by Damien Doligez and Sébastien Hinderer)
- #11160: otherlibs: merge win32unix into unix.
(Sébastien Hinderer, review by David Allsopp, Nicolás Ojeda Bär,
Xavier Leroy, Vincent Laviron and Antonin Décimo)
* #11198, #11298: Install the Dynlink, Str and Unix libraries to individual
subdirectories of LIBDIR. The compiler, debugger and toplevel automatically
add `-I +lib` if required, but display an alert.
(David Allsopp, review by Florian Angeletti, Nicolás Ojeda Bär,
Valentin Gatien-Baron and Sébastien Hinderer)
- #11200: Install ocamlprof's Profiling runtime module to a +profiling,
removing it from the default namespace.
(David Allsopp, review by Sébastien Hinderer)
- #11294: Switch minimum required autoconf to 2.71.
(David Allsopp, review by Xavier Leroy)
- #11097: Build native-code compilers on NetBSD/aarch64
(Kate Deplaix, review by Anil Madhavapeddy)
### Bug fixes:
- #10790: don't drop variance and injectivity annotations when pretty printing
`with` constraints (for example, `with type +!'a t = ...`).
(Florian Angeletti, report by Luke Maurer, review by Matthew Ryan and
Gabriel Scherer)
- #11167: Fix memory leak from signal stack.
(Antoni Żewierżejew, review by Gabriel Scherer and Enguerrand Decorne)
- #11112: harden -use-runtime against spaces or quotes in the provided path
(Gabriel Scherer, report by Brahima Dibassi, review by David Allsopp)
- #11068, #11070: Fix typo in function name given in Unix_error exception for
Unix.readlink on Windows.
(David Allsopp, report by Xia Li-yao)
- #10807: Don't duplicate standard handles in the child process
spawned by win32unix Unix.create_process if the handles were already
inheritable. Fix broken signalling of EOF on standard handles if
they were already inheritable.
(Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär)
- #10868: Fix off-by-1 bug when initializing frame hashtables
(Jonah Beckford, review by Tom Kelly, Nicolás Ojeda Bär and
KC Sivaramakrishnan)
- #11077: Make dumpobj compatible with absence of naked pointer support
(Olivier Nicole and Jan Midtgaard, review by Gabriel Scherer)
- #11111: fix fork() usage in ocamltest C code.
When calling fork() from C code with the Multicore runtime active,
one needs to call caml_atfork_hook() on the forked child before it
can use the OCaml runtime.
(Gabriel Scherer, review by Xavier Leroy, report by Brahima Dibassi)
- #10809: Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating
sockets with WSASocket if the cloexec (non-inheritable) parameter is
true. Fixes a race condition where a child process could inherit the
socket and deadlock the parent.
(Antonin Décimo, review by Xavier Leroy)
- #11289, #11405: fix some leaks on systhread termination
(Fabrice Buoro, Enguerrand Decorne, Gabriel Scherer,
review by Xavier Leroy and Florian Angeletti, report by Romain Beauxis)
- #11314, #11416: fix non-informative error message for module inclusion
(Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
- #11358, #11379: Refactor the initialization of bytecode threading,
This avoids a "dangling pointer" warning of GCC 12.1.
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
- #11387, module type with constraints no longer crash the compiler in presence
of both shadowing warnings and the `-bin-annot` compiler flag.
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
- #11482, #11542: Fix random crash in large closure allocation
(Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by
Xavier Leroy)
- #11508, #11509: make Bytes.escaped domain-safe
(Christiano Haesbaert and Gabriel Scherer,
review by Xavier Leroy,
report by Jan Midtgaard and Tom Kelly)
- #11576: Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional
arrays.
(Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy
Yallop and Florian Angeletti)
- #11587: Prevent integer comparison from being used on pointers
(Vincent Laviron, review by Gabriel Scherer)
- #11662, #11673: fix a memory leak when using Dynlink,
the bug was only present in development version of OCaml 5.
(Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)
OCaml 4.14 maintenance version
------------------------------
### Runtime system:
- #11764, #12577: Add prototypes to old-style C function definitions
and declarations.
(Antonin Décimo, review by Xavier Leroy and Nick Barnes)
- #11763, #11759, #11861, #12509, #12577: Use strict prototypes on primitives.
(Antonin Décimo, review by Xavier Leroy, David Allsopp, Sébastien
Hinderer and Nick Barnes)
### Build system:
- #11590: Allow installing to a destination path containing spaces.
(Élie Brami, review by Sébastien Hinderer and David Allsopp)
- #12372: Pass option -no-execute-only to the linker for OpenBSD >= 7.3
so that code sections remain readable, as needed for closure marshaling.
(Xavier Leroy and Anil Madhavapeddy, review by Anil Madhavapeddy and
Sébastien Hinderer)
- #12903: Disable control flow integrity on OpenBSD >= 7.4 to avoid
illegal instruction errors on certain CPUs.
(Michael Hendricks, review by Miod Vallat)
### Bug fixes:
- #12878: fix incorrect treatment of injectivity for private recursive types.
(Jeremy Yallop, review by Gabriel Scherer and Jacques Garrigue)
- #12971, #12974: fix an uncaught Ctype.Escape exception on some
invalid programs forming recursive types.
(Gabriel Scherer, review by Florian Angeletti, report by Neven Villani)
- #12264, #12289: Fix compact_allocate to avoid a pathological case
that causes very slow compaction.
(Damien Doligez, report by Arseniy Alekseyev, review by Sadiq Jaffer)
* #10845 Emit frametable size on amd64 BSD (OpenBSD, FreeBSD, NetBSD) systems
(emitted for Linux in #8805)
(Hannes Mehnert, review by Nicolás Ojeda Bär)
- #13448, #13449: fix a code-generation bug on unsafe array accesses
at type int32, int64, nativeint, which has been introduced in OCaml 4.04.
(Gabriel Scherer, review by Nicolás Ojeda Bär and Vincent Laviron,
report by Raphaël Bocquet and Simon Cruanes)
OCaml 4.14.1 (20 December 2022)
------------------------------
### Compiler user-interface and warnings:
- #11184, #11670: Stop calling ranlib on created / installed libraries
(Sébastien Hinderer and Xavier Leroy, review by the same)
### Build system:
- #11370, #11373: Don't pass CFLAGS to flexlink during configure.
(David Allsopp, report by William Hu, review by Xavier Leroy and
Sébastien Hinderer)
- #11487: Thwart FMA test optimization during configure
(William Hu, review by David Allsopp and Sébastien Hinderer)
### Bug fixes:
- #10768, #11340: Fix typechecking regression when combining first class
modules and GADTs.
(Jacques Garrigue, report by François Thiré, review by Matthew Ryan)
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
calling virtual methods introduced by constraining the self type from within
the class definition.
(Nicolás Ojeda Bär, review by Leo White)
- #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined
before using it to ensure that the headers can always be used in code which
turns on -Wundef (or equivalent).
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
Sébastien Hinderer)
- #11392, #11392: assertion failure with -rectypes and external definitions
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
- #11417: Fix regression allowing virtual methods in non-virtual classes.
(Leo White, review by Florian Angeletti)
- #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for
mingw-w64 i686 port.
(David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
- #11489, #11496: More prudent deallocation of alternate signal stack
(Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
- #11516, #11524: Fix the `deprecated_mutable` attribute.
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
- #11194, #11609: Fix inconsistent type variable names in "unbound type var"
messages
(Ulysse Gérard and Florian Angeletti, review Florian Angeletti and
Gabriel Scherer)
- #11622: Prevent stack overflow when printing a constructor or record
mismatch error involving recursive types.
(Florian Angeletti, review by Gabriel Scherer)
- #11732: Ensure that types from packed modules are always generalised
(Stephen Dolan and Leo White, review by Jacques Garrigue)
- #11737: Fix segfault condition in Unix.stat under Windows in the presence of
multiple threads.
(Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
- #11776: Extend environment with functor parameters in `strengthen_lazy`.
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)
- #11533, #11534: follow synonyms again in #show_module_type
(this had stopped working in 4.14.0)
(Gabriel Scherer, review by Jacques Garrigue and Florian Angeletti,
report by Yaron Minsky)
- #11768, #11788: Fix crash at start-up of bytecode programs in
no-naked-pointers mode caused by wrong initialization of caml_global_data
(Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)
- #11803, #11808: on x86, the destination of an integer comparison must be
a register, it cannot be a stack slot.
(Vincent Laviron, review by Xavier Leroy, report by
Emilio Jesús Gallego Arias)
OCaml 4.14.0 (28 March 2022)
----------------------------
### Language features:
- #10462: Add attribute to produce a compiler error for polls.
(Sadiq Jaffer, review by Mark Shinwell, Stephen Dolan
and Guillaume Munch-Maccagnoni)
- #10437: Allow explicit binders for type variables.
(Stephen Dolan, review by Leo White)
- #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)
- #181, #9760, #10740: opt-in tail-modulo-cons (TMC) transformation
let[@tail_mod_cons] rec map f li = ...
(Frédéric Bour, Gabriel Scherer, Basile Clément,
review by Basile Clément and Pierre Chambart,
tested by Konstantin Romanov)
### 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)
- #10195, #10680: Speed up GC by prefetching during marking
(Stephen Dolan, review by Xavier Leroy, Guillaume Munch-Maccagnoni,
Jacques-Henri Jourdan, Damien Doligez and Leo White)
- #10549: Stack overflow detection and naked pointers checking for ARM64
(Xavier Leroy, review by Stephen Dolan)
* #10675: Emit deprecation warnings when old C runtime function names
are used. This will break C stub code that uses these old names and
treats warnings as errors. The workaround is to use the new names.
(Xavier Leroy and David Allsopp, review by Sébastien Hinderer and
Damien Doligez)
- #10698, #10726: Free the alternate signal stack when the main OCaml
code or an OCaml thread stops
(Xavier Leroy, review by David Allsopp and Damien Doligez)
- #10730, 10731: Fix bug in `Obj.reachable_words` causing a slowdown when called
multiple time (Alain Frisch, report by ygrek, review by Xavier Leroy)
- #10926: Rename the two internal Windows Unicode functions with `caml_` prefix
instead of `win_`.
(David Allsopp, review by Kate Deplaix, Damien Doligez and Xavier Leroy)
### 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)
- #10591, #10615: Tune the heuristic for CSE of integer constants
so as to avoid excessive CSE on compiler-generated constants
and long register allocation times.
(Xavier Leroy, report by Edwin Török, review by Nicolás Ojeda Bär)
- #10595: Tail calls with up to 64 arguments are guaranteed to be compiled
as tail calls. To this end, memory locations in the domain state
are used for passing arguments that do not fit in registers.
(Xavier Leroy, review by Vincent Laviron)
- #10681: Enforce boolean conditions for the native backend
(Vincent Laviron, review by Gabriel Scherer)
- #10719: Ensure that build_apply respects Lambda.max_arity
(Stephen Dolan, review by Xavier Leroy)
- #10728: Ensure that functions are evaluated after their arguments
(Stephen Dolan, review by Mark Shinwell)
- #10732: Ensure right-to-left evaluation of arguments in cmm_helpers
(Greta Yorsh, review by Xavier Leroy)
### Standard library:
* #10710: Add UTF tools, codecs and validations to the Uchar, Bytes and
String modules.
(Daniel Bünzli, review by Florian Angeletti, Nicolás Ojeda Bär, Alain
Frisch and Gabriel Scherer)
* #10622: Annotate `Uchar.t` with immediate attribute
(Hongbo Zhang, reivew by Gabriel Scherer and Nicolás Ojeda Bär)
* #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)
- #10538: add Out_channel.set_buffered and Out_channel.is_buffered to control
the buffering mode of output channels.
(Nicolás Ojeda Bär, review by John Whitington, Daniel Bünzli, David Allsopp
and Xavier Leroy)
* #10583, #10998: Add over 40 new functions in Seq.
(François Pottier and Simon Cruanes, review by Nicolás Ojeda Bär,
Daniel Bünzli, Nathanaëlle Courant, Craig Ferguson, Wiktor Kuchta,
Xavier Leroy, Guillaume Munch-Maccagnoni, Raphaël Proust, Gabriel Scherer
and Thierry Martinez)
- #10596, #10978: Add with_open_bin, with_open_text and with_open_gen to
In_channel and Out_channel. Also, add In_channel.input_all.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Jérémie Dimino, Damien Doligez
and Xavier Leroy)
- #10658: add detailed information about the current version of OCaml
to the Sys module of the standard library.
(Sébastien Hinderer, review by Damien Doligez, Gabriel Scherer, David
Allsopp, Nicolás Ojeda Bär, Vincent Laviron)
- #10642: On Windows, Sys.remove and Unix.unlink now remove symlinks
to directories instead of raising EACCES. Introduce
caml/winsupport.h to hold more common code between the runtime,
lib-sys, and win32unix.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
- #10737: add new ephemeron API for forward compatibility with Multicore
OCaml.
(Damien Doligez, review by Stephen Dolan)
- #10786: The implementation of Complex.norm now uses Float.hypot.
(Christophe Troestler, review by David Allsopp 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)
- #10697: Bindings of dup and dup2 in win32unix now correctly call
WSADuplicateSocket on sockets instead of DuplicateHandle.
(Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär)
* #10926, #11336: Ensure all C functions in the Unix library are prefixed with
`caml_`.
(David Allsopp, review by Kate Deplaix, Damien Doligez and Xavier Leroy)
- #10951: Introduce the Thread.Exit exception as an alternative way to
terminate threads prematurely. This alternative way will become
the standard way in 5.0.
(Xavier Leroy, review by Florian Angeletti)
### Tools:
- #9701: Release bytecode only after collecting backtrace information
for exceptions, same for dynamic loaded code compiled from toplevel on
ocamlnat.
(Renato Alencar, reported by Krzysztof Leśniak, reviewed by Gabriel Scherer)
- #10839: Fix regression of #show when printing class type
(Élie Brami, review by Florian Angeletti)
- #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)
- #10438: add a new toplevel cli argument `-e <script>` to
run script passed to the toplevel.
(Pavlo Khrystenko, 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)
- #10527: Show "#help;; for help" at toplevel startup
(Wiktor Kuchta, review by David Allsopp and Florian Angeletti)
- #10846: add the `-shape` command-line option to ocamlobjinfo. When reading a
`cmt` file, shape information will only be shown if that option is used.
(Ulysse Gérard, review by Florian Angeletti)
### 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)
- #9621: Pack the ocamldebug modules to minimize clashes
(Raphael Sousa Santos, review by Vincent Laviron and 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)
- #8697, #10666: add M, m, n options of the OCAMLRUNPARAM to manual and man page
for ocamlrun command line options
(Dong An and Anukriti Kumar, review by David Allsopp, Gabriel Scherer
and Damien Doligez)
- #10281, #10685: Add description of C compiler on macOS and Windows platforms.
(Dong An, review by Xavier Leroy and David Allsopp)
- #10397: Document exceptions raised by Unix module functions on Windows
(Martin Jambon, review by Daniel Bünzli, David Allsopp, Damien Doligez,
Xavier Leroy, and Florian Angeletti)
- #10589: Fix many typos (excess/inconsistent spaces) in the HTML manual.
(Wiktor Kuchta, review by Florian Angeletti)
- #10605: manual, name few css classes to ease styling and maintainability.
(Florian Angeletti, review by Wiktor Kuchta and Gabriel Scherer)
- #10668, #10669: the changelog (this file), LICENSE and README files are now
installed as part of the distribution. The destination directory can be
customized using the `--docdir` argument to `./configure`.
(Nicolás Ojeda Bär, report by Daniel Bünzli, review by David Allsopp,
Sébastien Hinderer, and Daniel Bünzli)
- #10671, #10672: webman: Fix misalignments in unordered lists by changing the
CSS for coloring bullets
(Wiktor Kuchta, review by Florian Angeletti)
- #11107: Lifted comments in the Parsetree module into actual documentation.
(Paul-Elliot Anglès d'Auriac, review by Florian Angeletti)
- #11120, #11133: man pages, add missing warning entries and add mnemonic names
to the list of warnings.
(Florian Angeletti, report by Kate Deplaix, review by Gabriel Scherer)
### Compiler user-interface and warnings:
- #10328, #10780: 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)
- #9116, #9118, #10582: Fix single-line source highlighting in the
presence of tabs
(Armaël Guéneau, review by Gabriel Scherer,
split off from #9118 by Kate Deplaix, report by Ricardo M. Correia)
- #10488: Improve type variable name generation and recursive type detection
when printing type errors; this ensures that the names given to type variables
are always reused in the following portion of the trace and also removes
spurious `as 'a`s in types.
(Antal Spector-Zabusky, review by Florian Angeletti)
- #10794: Clarify warning 57 (Ambiguous or-pattern variables under guard)
(Wiktor Kuchta, review by 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)
- #8516: Change representation of class signatures
(Leo White, review by Thomas Refis)
- #9444: -dtypedtree, print more explicitly extra nodes in pattern ast.
(Frédéric Bour, review by Gabriel Scherer)
- #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)
- #10474: Force normalization on access to row_desc
Similar to #10337. Make row_desc an abstract types, with constructor
create_row and accessors defined in Types rather than Btype.
A normalized view row_desc_repr is provided for convenience.
(Jacques Garrigue and Takafumi Saikawa,
review by Leo White and Florian Angeletti)
- #10541: Make field_kind and commutable abstract, enforcing correct access
(Jacques Garrigue and Takafumi Saikawa,
review by Thomas Refis and Florian Angeletti)
- #10575: add a -dump-dir flag, which redirects all debugging printer
(`-dprofile`, `-dlambda`, ...) to the target directory
(Florian Angeletti, review by Thomas Refis and Gabriel Scherer)
* #10627: Make row_field abstract
Completes #10474 by making row_field abstract too.
An immutable view row_field_view is provided, and one converts between it
and row_field via inj_row_field and row_field_repr.
(Jacques Garrigue and Takafumi Saikawa, review by Florian Angeletti)
- #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)
- #10382: Don't repeat environment entries in Typemod.check_type_decl
(Leo White, review by Gabriel Scherer and Florian Angeletti)
- #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)
- #10598, #10616: fix an exponential blow-up when typechecking nested module
types
(Florian Angeletti, report and review by Stephen Dolan)
- #10559: Evaluate signature substitutions lazily
(Stephen Dolan, review by Leo White)
- #8776, #10624: Fix compilation time regression introduced in 4.08
(Nicolás Ojeda Bär, fix by Leo White, report by Alain Frisch, review by Thomas
Refis)
- #10618: Expose more Pprintast functions
(Guillaume Petiot, review by Gabriel Scherer)
- #10637: Outcometree: introduce a record type for constructors
(Gabriel Scherer, review by Thomas Refis)
- #10516: refactor the compilation of the 'switch' construct
(Gabriel Scherer, review by Wiktor Kuchta and Luc Maranget)
- #10670: avoid global C state in the RE engine for the "str" library
(Xavier Leroy, review by Gabriel Scherer)
- #10678: Expose descriptions in Warnings module
(Leo White, review by Gabriel Scherer and Alain Frisch)
- #10690: Always build ocamltoplevel.cmxa
(David Allsopp, review by Gabriel Scherer)
- #10692: Expose Parse.module_type and Parse.module_expr
(Guillaume Petiot, review by Gabriel Scherer)
- #10714: Add X86_proc.with_internal_assembler for temporarily changing the
assembler used by the backend.
(David Allsopp, review by Gabriel Scherer)
- #10715: Allow the assembler and loader to be substituted in ocamlnat, for
example to be replaced with a binary emitter.
(David Allsopp and Nathan Rebours, review by Louis Gesbert,
Nicolás Ojeda Bär and Gabriel Scherer)
- #10718, #11012: Add "Shape" information to the cmt files. Shapes are an
abstraction of modules that can be used by external tooling to perform
definition-aware operations.
(Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti)
- #10742: strong call-by-need reduction for shapes
(Gabriel Scherer and Nathanaëlle Courant,
review by Florian Angeletti, Ulysse Gérard and Thomas Refis)
### Build system:
- #10835 Disable DT_TEXTREL warnings on x86 32 bit architecture by passing
-Wl,-z,notext in mksharedlib and mkmaindll. Fixes relocation issues, reported
in #9800, making local patches in Debian, Alpine, and FreeBSD superfluous.
(Hannes Mehnert with Kate Deplaix and Stéphane Glondu, review by Xavier Leroy)
- #10717: Simplify the installation of man pages
(Sébastien Hinderer, review by David Allsopp)
- #10739: Stop installing extract_crc
(Sébastien Hinderer, review by David Allsopp, Daniel Bünzli, Xavier Leroy
and Gabriel Scherer)
- #10797: Compile with -d2VolatileMetadata- on supporting versions of Visual
Studio. This suppresses the addition of .voltbl sections and eliminates
linking errors in systhreads.
(David Allsopp, review by Jonah Beckford and Sébastien Hinderer)
### Bug fixes:
- #9214, #10709: Wrong unmarshaling of function pointers in debugger mode.
This was causing ocamldebug to crash when running some user-defined printers.
(Xavier Leroy, report by Rehan Malak, review by Gabriel Scherer and
Vincent Laviron)
- #10364: Improve detection of ambiguity in case bodies.
(Jacques Garrigue, review by Thomas Refis)
- #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)
- #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)
- #10633: Stack overflow recovery in ocamlopt for AMD64/Linux and ARM/Linux
was not restoring the minor heap pointer correctly
(Stephen Dolan, review by Xavier Leroy)
- #10659: Fix freshening substitutions on imported modules
(Leo White and Stephen Dolan, review by Matthew Ryan)
- #10677, #10679: Fix detection of CC as gcc in configure (allow for
triplet-prefixed GCC) and fix all C compiler detection when CC is a path
rather than a basename.
(David Allsopp, report by Fabian @copy, review by Gabriel Scherer)
- #10690: Add --enable-native-toplevel to configure to enable installing
ocamlnat as part of the main build (default is not to install it)
(David Allsopp, review by Gabriel Scherer)
- #10693: Fix ident collision in includemod
(Leo White, review by Matthew Ryan)
- #10702: Fix cast of more strictly aligned pointer in win32unix
implementation of stat
(Antonin Décimo, review by David Allsopp)
- #10712: Type-check toplevel terms in the native toplevel in the same way as
the bytecode toplevel. In particular, this fixes the loss of type variable
names in the native toplevel.
(Leo White, review by David Allsopp and Gabriel Scherer)
- #10735: Uncaught unify exception from `build_as_type`
(Jacques Garrigue, report and review by Leo White)
- #10763, #10764: fix miscompilation of method delegation
(Alain Frisch, review by Vincent Laviron and Jacques Garrigue)
- #10822, #10823: Bad interaction between ambivalent types and subtyping
coercions (Jacques Garrigue, report and review by Frédéric Bour)
- #10836, #10952: avoid internal typechecker errors when checking signature
inclusion in presence of incompatible types.
(Florian Angeletti, report by Craig Ferguson, review by Gabriel Scherer)
- #10849: Display the result of `let _ : <type> = <expr>` in the native
toplevel, as in the bytecode toplevel.
(David Allsopp, report by Nathan Rebours, review by Gabriel Scherer)
- #10853: `Obj.reachable_words` could crash if called after a marshaling
operation in `NO_SHARING` mode.
(Xavier Leroy, report by Anil Madhavapeddy, review by Alain Frisch)
- #10907, #10959: Wrong type inferred from existential types
(Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by Leo White)
- #10688: Move frame descriptor table from `rodata` to `data` section on
RISC-V. Improves support for building DLLs and PIEs. In particular, this
applies to all binaries in distributions that build PIEs by default (eg
Gentoo and Alpine).
(Alex Fan, review by Gabriel Scherer)
- #11031: Exception handlers restore the rbp register when using frame-pointers
on amd64.
(Fabrice Buoro, with help from Stephen Dolan, Tom Kelly and Mark Shinwell,
review by Xavier Leroy)
- #11025, #11036: Do not pass -no-pie to the C compiler on musl/arm64
(omni, Kate Deplaix and Antonio Nuno Monteiro, review by Xavier Leroy)
- #11101, #11109: A recursive type constraint fails on 4.14
(Jacques Garrigue, report and review by Florian Angeletti)
- #11118: Fix integer overflow on 64-bit Windows when indexing bigarrays (which
could lead to a segmentation fault).
(Roven Gabriel, review by Nicolás Ojeda Bär and Xavier Leroy)
OCaml 4.13 maintenance branch
-----------------------------
### Bug fixes
- #10661, #10662: fix a bug with classes named "row"
(Gabriel Scherer, report by Nicolás Ojeda Bär)
OCaml 4.13.0 (24 September 2021)
--------------------------------
### Progress towards Multicore:
- #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)
- #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)
### Language features (highlights):
- #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)
### Compiler user-interface and warnings (highlights):
- #9331: Improve error messages for functor application and functor types.
(Florian Angeletti and Gabriel Radanne, review by Leo White)
* #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)
### Manual and documentation (highlights):
- #10247: Add initial tranche of examples to reference manual.
Adds some eighty examples to the reference manual, principally to the
expressions and patterns sections.
https://ocaml.org/releases/4.13/manual/patterns.html
(John Whitington, review by Xavier Leroy, Gabriel Scherer, @Fourchaux, and
Florian Angeletti)
- #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)
### Standard library (highlights):
- #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, Runhang Li, Gabriel Scherer, Mark Shinwell,
Bernhard Schommer and Christophe Troestler)
- #9582: Add Array.{find_opt,find_map,split,combine}.
(Nicolás Ojeda Bär, review by Daniel Bünzli and Gabriel Scherer)
- #9533: Added String.starts_with and String.ends_with.
(Bernhard Schommer, review by Daniel Bünzli, Gabriel Scherer and
Alain Frisch)
### Code generation and optimizations (highlights):
- #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)
### Internal typechecker changes (highlights):
- #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 Turaev, review by Leo White,
Florian Angeletti, and Jacques Garrigue)
- #9994: Make Types.type_expr a private type, and abstract marking mechanism
(Jacques Garrigue and Takafumi Saikawa,
review by Gabriel Scherer and Leo White)
### Runtime system (highlights):
- #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)
- #10549: Stack overflow detection and naked pointers checking for ARM64
(Xavier Leroy, review by Stephen Dolan)
- #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)
- #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)
- #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)
### Language features:
- #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)
- #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)
### Type system:
* #10081: Typecheck `x |> f` and `f @@ x` as `(f x)`
(Alain Frisch, review by Jacques Garrigue, Josh Berdine and Thomas Refis)
### Runtime system:
- #10318: Windows Unicode runtime functions are no longer marked as
experimental.
(Nicolás Ojeda Bär, review by David Allsopp)
- #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)
- #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)
(David Allsopp, review by Xavier Leroy)
- #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)
* #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)
- #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 Richard Jones, review by Anil
Madhavapeddy, Stephen Dolan, and Florian Angeletti)
### 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 Sébastien Hinderer, review by Stephen Dolan
and David Allsopp)
- #9562, #367: Allow CSE of immutable loads across stores
(Stephen Dolan, review by Mark Shinwell)
- #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)
- #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:
- #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 François Berenger, review by Xavier Leroy and
Damien Doligez)
- #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)
- #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:
* #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)
- #10047: Add `Unix.realpath`
(Daniel Bünzli, review by David Allsopp, Josh Berdine and Gabriel Scherer)
- #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:
- #10139: Adds a -nonavbar option to ocamldoc, to remove confusing
'Up', 'Previous' and 'Next' links
(John Whitington, review by David Allsopp)
- #8645, #10363: ocamldoc: escape `<`, `>`, and `&` in html backend.
(Florian Angeletti, report by Wim Lewis, review by Gabriel Scherer)
### Manual and documentation:
- #9525, #10402: document that ocamldoc only creates paragraphs
at the toplevel of documentation comments
(Florian Angeletti, report by Hendrik Tews, review by Gabriel Scherer)
- #10206: Split labels and polymorphic variants tutorials in two.
Moves the GADTs tutorial from the Language Extensions chapter
to the tutorials.
(John Whitington, review by Florian Angeletti and Xavier Leroy)
- #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: Use the new -nonavbar option to improve navigation within
the reference manual stdlib 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)
- #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)
- #10605: manual, name few css classes to ease styling and maintainability.
(Florian Angeletti, review by Wiktor Kuchta and Gabriel Scherer)
### 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: optional warning for missing mli interface file
(Anukriti Kumar, review by Florian Angeletti)
- #9960, #10619: 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: minor simplifications to some syntax error messages.
(François Pottier, review by Gabriel Scherer and Frédéric Bour.)
- #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:
- #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 Allsopp)
- #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.
(Louis Gesbert, review by Jeremie Dimino, Mark Shinwell and Gabriel Radanne)
- #10124: remove duplicated code from the native toplevel, split toplevel
implementation into the shared part (`Topcommon`, etc.) and specific ones
(`Topeval`, `Trace`, `Topmain`).
(Louis Gesbert, review by Jeremie Dimino and Gabriel Radanne)
- #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)
* #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)
- #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)
- #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)
### Internal typechecker changes:
- #10174: Make Tsubst more robust by avoiding strange workarounds
(Takafumi Saikawa and Jacques Garrigue, review by Gabriel Scherer and
Florian Angeletti)
- #10265: Move type_unboxed.unboxed into type_kind
(Stephen Dolan, review by Gabriel Scherer)
- #10307: Refactor type_description in the typing env
(Nicolas Chataing, review by Takafumi Saikawa, Florian Angeletti and Thomas
Refis)
- #10311: Separate the constraint-solving part of Typecore.type_pat into
specific solver functions.
(Jacques Garrigue and Takafumi Saikawa, review by Gabriel Scherer)
- #10428: Make build_other_constrs work with names instead of tags.
(Nicolas Chataing, review by Florian Angeletti)
### Build system:
- #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)
- #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, #10632: 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)
- #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, #10635: 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: Stop generating 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)
- #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)
- #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)
- #10511: Cygwin ports now correctly configure when flexdll is not available.
(David Allsopp, 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)
- #10603, #10611: Fix if condition marked as inconstant in flambda
(Vincent Laviron and Pierre Chambart, report by Marcello Seri)
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)
- #10626, #10628: Wrong reloading of the x86-64 instruction for
integer multiplication by a constant, causing the assembler to
reject the ocamlopt-generated code.
(Xavier Leroy, report by Dave Aitken, review by Vincent Laviron)
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)
- #9951: Ensure that the mark stack push optimisation handles naked pointers
(KC Sivaramakrishnan, reported by Enguerrand Decorne, review by Gabriel
Scherer, and Xavier Leroy)
- #9678: Reimplement `Obj.reachable_words` using a hash table to
detect sharing, instead of temporary in-place modifications. This
is a prerequisite for Multicore OCaml.
(Xavier Leroy, review by Jacques-Henri Jourdan and Sébastien Hinderer)
- #1795, #9543: modernize signal handling on Linux i386, PowerPC, and s390x,
adding support for Musl ppc64le along the way.
(Xavier Leroy and Anil Madhavapeddy, review by Stephen Dolan)
- #9648, #9689: Update the generic hash function to take advantage
of the new representation for function closures
(Xavier Leroy, review by Stephen Dolan)
- #9649: Update the marshaler (output_value) to take advantage
of the new representation for function closures
(Xavier Leroy, review by Damien Doligez)
- #10050: update {PUSH,}OFFSETCLOSURE* bytecode instructions to match new
representation for closures
(Nathanaëlle Courant, review by Xavier Leroy)
- #9728: Take advantage of the new closure representation to simplify the
compaction algorithm and remove its dependence on the page table
(Damien Doligez, review by Jacques-Henri Jourdan and Xavier Leroy)
- #2195: Improve error message in bytecode stack trace printing and load
debug information during bytecode startup if OCAMLRUNPARAM=b=2.
(David Allsopp, review by Gabriel Scherer and Xavier Leroy)
- #9466: Memprof: optimize random samples generation.
(Jacques-Henri Jourdan, review by Xavier Leroy and Stephen Dolan)
- #9628: Memprof: disable sampling when memprof is suspended.
(Jacques-Henri Jourdan, review by Gabriel Scherer and Stephen Dolan)
- #10056: Memprof: ensure young_trigger is within the bounds of the minor
heap in caml_memprof_renew_minor_sample (regression from #8684)
(David Allsopp, review by Guillaume Munch-Maccagnoni and
Jacques-Henri Jourdan)
- #9506: Remove support for FreeBSD prior to 4.0R, that required explicit
floating-point initialization to behave like IEEE standard
(Hannes Mehnert, review by David Allsopp)
- #8807, #9503: Use different symbols for do_local_roots on bytecode and native
(Stephen Dolan, review by David Allsopp and Xavier Leroy)
- #9670: Report full major collections in Gc stats.
(Leo White, review by Gabriel Scherer)
- #9675: Remove the caml_static_{alloc,free,resize} primitives, now unused.
(Xavier Leroy, review by Gabriel Scherer)
- #9710: Drop "support" for an hypothetical JIT for OCaml bytecode
which has never existed.
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #9742, #9989: Ephemerons are now compatible with infix pointers occurring
when using mutually recursive functions.
(Jacques-Henri Jourdan, review by François Bobot)
- #9888, #9890: Fixes a bug in the `riscv` backend where register t0 was not
saved/restored when performing a GC. This could potentially lead to a
segfault.
(Nicolás Ojeda Bär, report by Xavier Leroy, review by Xavier Leroy)
- #9907: Fix native toplevel on native Windows.
(David Allsopp, review by Florian Angeletti)
- #9909: Remove caml_code_area_start and caml_code_area_end globals (no longer
needed as the pagetable heads towards retirement).
(David Allsopp, review by Xavier Leroy)
- #9949: Clarify documentation of GC message 0x1 and make sure it is
displayed every time a major cycle is forcibly finished.
(Damien Doligez, review by Xavier Leroy)
- #10062: set ARCH_INT64_PRINTF_FORMAT correctly for both modes of mingw-w64
(David Allsopp, review by Xavier Leroy)
### Code generation and optimizations:
- #9551: ocamlc no longer loads DLLs at link time to check that
external functions referenced from OCaml code are defined.
Instead, .so/.dll files are parsed directly by pure OCaml code.
(Nicolás Ojeda Bär, review by Daniel Bünzli, Gabriel Scherer,
Anil Madhavapeddy, and Xavier Leroy)
- #9620: Limit the number of parameters for an uncurried or untupled
function. Functions with more parameters than that are left
partially curried or tupled.
(Xavier Leroy, review by Mark Shinwell)
- #9752: Revised handling of calling conventions for external C functions.
Provide a more precise description of the types of unboxed arguments,
so that the ARM64 iOS/macOS calling conventions can be honored.
(Xavier Leroy, review by Mark Shinwell and Eduardo Rafael)
- #9838: Ensure that Cmm immediates are generated as Cconst_int where
possible, improving instruction selection.
(Stephen Dolan, review by Leo White and Xavier Leroy)
- #9864: Revised recognition of immediate arguments to integer operations.
Fixes several issues that could have led to producing assembly code
that is rejected by the assembler.
(Xavier Leroy, review by Stephen Dolan)
- #9969, #9981: Added mergeable flag to ELF sections containing mergeable
constants. Fixes compatibility with the integrated assembler in clang 11.0.0.
(Jacob Young, review by Nicolás Ojeda Bär)
### Standard library:
- #9781: add injectivity annotations to parameterized abstract types
(Jeremy Yallop, review by Nicolás Ojeda Bär)
* #9554: add primitive __FUNCTION__ that returns the name of the current method
or function, including any enclosing module or class.
(Nicolás Ojeda Bär, Stephen Dolan, review by Stephen Dolan)
- #9075: define to_rev_seq in Set and Map modules.
(Sébastien Briais, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #9561: Unbox Unix.gettimeofday and Unix.time
(Stephen Dolan, review by David Allsopp)
- #9570: Provide an Atomic module with a trivial purely-sequential
implementation, to help write code that is compatible with Multicore
OCaml.
(Gabriel Scherer, review by Xavier Leroy)
- #10035: Make sure that flambda respects atomicity in the Atomic module.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer)
- #9571: Make at_exit and Printexc.register_printer thread-safe.
(Guillaume Munch-Maccagnoni, review by Gabriel Scherer and Xavier Leroy)
- #9587: Arg: new Rest_all spec to get all rest arguments in a list
(this is similar to Rest, but makes it possible to detect when there
are no arguments (an empty list) after the rest marker)
(Gabriel Scherer, review by Nicolás Ojeda Bär and David Allsopp)
- #9655: Obj: introduce type raw_data and functions raw_field, set_raw_field
to manipulate out-of-heap pointers in no-naked-pointer mode,
and more generally all other data that is not a well-formed OCaml value
(Xavier Leroy, review by Damien Doligez and Gabriel Scherer)
- #9663: Extend Printexc API for raw backtrace entries.
(Stephen Dolan, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #9763: Add function Hashtbl.rebuild to convert from old hash table
formats (that may have been saved to persistent storage) to the
current hash table format. Remove leftover support for the hash
table format and generic hash function that were in use before OCaml 4.00.
(Xavier Leroy, review by Nicolás Ojeda Bär)
- #10070: Fix Float.Array.blit when source and destination arrays coincide.
(Nicolás Ojeda Bär, review by Alain Frisch and Xavier Leroy)
### Other libraries:
- #8796: On Windows, make Unix.utimes use FILE_FLAG_BACKUP_SEMANTICS flag
to allow it to work with directories.
(Daniil Baturin, review by Damien Doligez)
- #9593: Use new flag for non-elevated symbolic links and test for Developer
Mode on Windows
(Manuel Hornung, review by David Allsopp and Nicolás Ojeda Bär)
* #9601: Return EPERM for EUNKNOWN -1314 in win32unix (principally affects
error handling when Unix.symlink is unavailable)
(David Allsopp, review by Xavier Leroy)
- #9338, #9790: Dynlink: make sure *_units () functions report accurate
information before the first load.
(Daniel Bünzli, review by Xavier Leroy and Nicolás Ojeda Bär)
* #9757, #9846, #10161: check proper ownership when operating over mutexes.
Now, unlocking a mutex held by another thread or not locked at all
reliably raises a Sys_error exception. Before, it was undefined
behavior, but the documentation did not say so.
Likewise, locking a mutex already locked by the current thread
reliably raises a Sys_error exception. Before, it could
deadlock or succeed (and do recursive locking), depending on the OS.
(Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by
Guillaume Munch-Maccagnoni, David Allsopp, and Stephen Dolan)
- #9802: Ensure signals are handled before Unix.kill returns
(Stephen Dolan, review by Jacques-Henri Jourdan)
- #9869, #10073: Add Unix.SO_REUSEPORT
(Yishuai Li, review by Xavier Leroy, amended by David Allsopp)
- #9906, #9914: Add Unix._exit as a way to exit the process immediately,
skipping any finalization action
(Ivan Gotovchits and Xavier Leroy, review by Sébastien Hinderer and
David Allsopp)
- #9958: Raise exception in case of error in Unix.setsid.
(Nicolás Ojeda Bär, review by Stephen Dolan)
- #9971, #9973: Make sure the process can terminate when the last thread
calls Thread.exit.
(Xavier Leroy, report by Jacques-Henri Jourdan, review by David Allsopp
and Jacques-Henri Jourdan).
### Tools:
- #9551: ocamlobjinfo is now able to display information on .cmxs shared
libraries natively; it no longer requires libbfd to do so
(Nicolás Ojeda Bär, review by Daniel Bünzli, Gabriel Scherer,
Anil Madhavapeddy, and Xavier Leroy)
* #9299, #9795: ocamldep: do not process files during cli parsing. Fixes
various broken cli behaviours.
(Daniel Bünzli, review by Nicolás Ojeda Bär)
### Debugging and profiling:
- #9606, #9635, #9637: fix 4.10 performance regression in the debugger
(behaviors quadratic in the size of the debugged program)
(Xavier Leroy, report by Jacques Garrigue and Virgile Prevosto,
review by David Allsopp and Jacques-Henri Jourdan)
- #9948: Remove Spacetime.
(Nicolás Ojeda Bär, review by Stephen Dolan and Xavier Leroy)
### Manual and documentation:
- #10142, #10154: improved rendering and latex code for toplevel code examples.
(Florian Angeletti, report by John Whitington, review by Gabriel Scherer)
- #9745: Manual: Standard Library labeled and unlabeled documentation unified
(John Whitington, review by Nicolás Ojeda Bär, David Allsopp,
Thomas Refis, and Florian Angeletti)
- #9877: manual, warn that multi-index indexing operators should be defined in
conjunction of single-index ones.
(Florian Angeletti, review by Hezekiah M. Carty, Gabriel Scherer,
and Marcello Seri)
- #10233: Document `-save-ir-after scheduling` and update `-stop-after` options.
(Greta Yorsh, review by Gabriel Scherer and Florian Angeletti)
### Compiler user-interface and warnings:
- #1931: rely on levels to enforce principality in patterns
(Thomas Refis and Leo White, review by Jacques Garrigue)
* #9011: Do not create .a/.lib files when creating a .cmxa with no modules.
macOS ar doesn't support creating empty .a files (#1094) and MSVC doesn't
permit .lib files to contain no objects. When linking with a .cmxa containing
no modules, it is now not an error for there to be no .a/.lib file.
(David Allsopp, review by Xavier Leroy)
- #9560: Report partial application warnings on type errors in applications.
(Stephen Dolan, report and testcase by whitequark, review by Gabriel Scherer
and Thomas Refis)
- #9583: when bytecode linking fails due to an unavailable module, the module
that requires it is now included in the error message.
(Nicolás Ojeda Bär, review by Vincent Laviron)
- #9615: Attach package type attributes to core_type.
When parsing constraints on a first class module, attributes found after the
module type were parsed but ignored. Now they are attached to the
corresponding core_type.
(Etienne Millon, review by Thomas Refis)
- #6633, #9673: Add hint when a module is used instead of a module type or
when a module type is used instead of a module or when a class type is used
instead of a class.
(Xavier Van de Woestyne, report by whitequark, review by Florian Angeletti
and Gabriel Scherer)
- #9754: allow [@tailcall true] (equivalent to [@tailcall]) and
[@tailcall false] (warns if on a tailcall)
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #9751: Add warning 68. Pattern-matching depending on mutable state
prevents the remaining arguments from being uncurried.
(Hugo Heuzard, review by Leo White)
- #9783: Widen warning 16 (Unerasable optional argument) to more cases.
(Leo White, review by Florian Angeletti)
- #10008: Improve error message for aliases to the current compilation unit.
(Leo White, review by Gabriel Scherer)
- #10046: Link all DLLs with -static-libgcc on mingw32 to prevent dependency
on libgcc_s_sjlj-1.dll with mingw-w64 runtime 8.0.0 (previously this was
only needed for dllunix.dll).
(David Allsopp, report by Andreas Hauptmann, review by Xavier Leroy)
- #9634: Allow initial and repeated commas in `OCAMLRUNPARAM`.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- #8987: Make some locations more accurate
(Thomas Refis, review by Gabriel Scherer)
- #9216: add Lambda.duplicate which refreshes bound identifiers
(Gabriel Scherer, review by Pierre Chambart and Vincent Laviron)
- #9376: Remove spurious Ptop_defs from #use
(Leo White, review by Damien Doligez)
- #9604: refactoring of the ocamltest codebase.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Sébastien Hinderer)
- #9498, #9511: make the pattern-matching analyzer more robust to
or-pattern explosion, by stopping after the first counter-example to
exhaustivity
(Gabriel Scherer, review by Luc Maranget, Thomas Refis and Florian Angeletti,
report by Alex Fedoseev through Hongbo Zhang)
- #9514: optimize pattern-matching exhaustivity analysis in the single-row case
(Gabriel Scherer, review by Stephen Dolan)
- #9442: refactor the implementation of the [@tailcall] attribute
to allow for a structured attribute payload
(Gabriel Scherer, review by Vladimir Keleshev and Nicolás Ojeda Bär)
- #9688: Expose the main entrypoint in compilerlibs
(Stephen Dolan, review by Nicolás Ojeda Bär, Greta Yorsh and David Allsopp)
- #9715: recheck scope escapes after normalising paths
(Matthew Ryan, review by Gabriel Scherer and Thomas Refis)
- #9778: Fix printing for bindings where polymorphic type annotations and
attributes are present.
(Matthew Ryan, review by Nicolás Ojeda Bär)
- #9797, #9849: Eliminate the routine use of external commands in ocamltest.
ocamltest no longer calls the mkdir, rm and ln external commands (at present,
the only external command ocamltest uses is diff).
(David Allsopp, review by Nicolás Ojeda Bär, Sébastien Hinderer and
Xavier Leroy)
- #9801: Don't ignore EOL-at-EOF differences in ocamltest.
(David Allsopp, review by Damien Doligez, much input and thought from
Daniel Bünzli, Damien Doligez, Sébastien Hinderer, and Xavier Leroy)
- #9889: more caching when printing types with -short-path.
(Florian Angeletti, review by Gabriel Scherer)
- #9591: fix pprint of polyvariants that start with a core_type, closed,
not low (Chet Murthy, review by Florian Angeletti)
- #9590: fix pprint of extension constructors (and exceptions) that rebind
(Chet Murthy, review by Florian Angeletti)
- #9963: Centralized tracking of frontend's global state
(Frédéric Bour and Thomas Refis, review by Gabriel Scherer)
- #9631: Named text sections for caml_system__code_begin/end symbols
(Greta Yorsh, review by Frédéric Bour)
- #9896: Share the strings representing scopes, fixing some regression
on .cmo/.cma sizes
(Alain Frisch and Xavier Clerc, review by Gabriel Scherer)
### Build system:
- #9332, #9518, #9529: Cease storing C dependencies in the codebase. C
dependencies are generated on-the-fly in development mode. For incremental
compilation, the MSVC ports require GCC to be present.
(David Allsopp, review by Sébastien Hinderer, YAML-fu by Stephen Dolan)
- #7121, #9558: Always have the autoconf-discovered ld in PACKLD, with
extra flags in new variable PACKLD_FLAGS. For
cross-compilation, this means the triplet-prefixed version will always be
used.
(David Allsopp, report by Adrian Nader, review by Sébastien Hinderer)
- #9527: stop including configuration when running 'clean' rules
to avoid C dependency recomputation.
(Gabriel Scherer, review by David Allsopp)
- #9804: Build C stubs of libraries in otherlibs/ with debug info.
(Stephen Dolan, review by Sébastien Hinderer and David Allsopp)
- #9938, #9939: Define __USE_MINGW_ANSI_STDIO=0 for the mingw-w64 ports to
prevent their C99-compliant snprintf conflicting with ours.
(David Allsopp, report by Michael Soegtrop, review by Xavier Leroy)
- #9895, #9523: Avoid conflict with C++20 by not installing VERSION to the OCaml
Standard Library directory.
(Bernhard Schommer, review by David Allsopp)
- #10044: Always report the detected ARCH, MODEL and SYSTEM, even for bytecode-
only builds (fixes a "configuration regression" from 4.08 for the Windows
builds)
(David Allsopp, review by Xavier Leroy)
- #10071: Fix bug in tests/misc/weaklifetime.ml that was reported in #10055
(Damien Doligez and Gabriel Scherer, report by David Allsopp)
### Bug fixes:
- #7538, #9669: Check for misplaced attributes on module aliases
(Leo White, report by Thomas Leonard, review by Florian Angeletti)
- #7813, #9955: make sure the major GC cycle doesn't get stuck in Idle state
(Damien Doligez, report by Anders Fugmann, review by Jacques-Henri Jourdan)
- #7902, #9556: Type-checker infers recursive type, even though -rectypes is
off.
(Jacques Garrigue, report by François Pottier, review by Leo White)
- #8746: Hashtbl: Restore ongoing traversal status after filter_map_inplace
(Mehdi Bouaziz, review by Alain Frisch)
- #8747, #9709: incorrect principality warning on functional updates of records
(Jacques Garrigue, report and review by Thomas Refis)
* #8907, #9878: `Typemod.normalize_signature` uses wrong environment
(Jacques Garrigue, report and review by Leo White)
- #9421, #9427: fix printing of (::) in ocamldoc
(Florian Angeletti, report by Yawar Amin, review by Damien Doligez)
- #9440: for a type extension constructor with parameterised arguments,
REPL displayed <poly> for each as opposed to the concrete values used.
(Christian Quinn, review by Gabriel Scherer)
- #9433: Fix package constraints for module aliases
(Leo White, review by Jacques Garrigue)
- #9469: Better backtraces for lazy values
(Leo White, review by Nicolás Ojeda Bär)
- #9521, #9522: correctly fail when comparing functions
with Closure and Infix tags.
(Gabriel Scherer and Jeremy Yallop and Xavier Leroy,
report by Twitter user @st_toHKR through Jun Furuse)
- #9611: maintain order of load path entries in various situations: when passing
them to system linker, ppx contexts, etc.
(Nicolás Ojeda Bär, review by Jérémie Dimino and Gabriel Scherer)
- #9633: ocamltest: fix a bug when certain variables set in test scripts would
be ignored (eg `ocamlrunparam`).
(Nicolás Ojeda Bär, review by Sébastien Hinderer)
- #9681, #9690, #9693: small runtime changes
for the new closure representation (#9619)
(Xavier Leroy, Sadiq Jaffer, Gabriel Scherer,
review by Xavier Leroy and Jacques-Henri Jourdan)
- #9739, #9747: Avoid calling type variables, types that are not variables in
recursive occurrence error messages
(for instance, "Type variable int occurs inside int list")
(Florian Angeletti, report by Stephen Dolan, review by Armaël Guéneau)
- #9759, #9767: Spurious GADT ambiguity without -principal
(Jacques Garrigue, report by Thomas Refis,
review by Thomas Refis and Gabriel Scherer)
- #9799, #9803: make pat_env point to the correct environment
(Thomas Refis, report by Alex Fedoseev, review by Gabriel Scherer)
- #9825, #9830: the C global variable caml_fl_merge and the C function
caml_spacetime_my_profinfo (bytecode version) were declared and
defined with different types. This is undefined behavior and
cancause link-time errors with link-time optimization (LTO).
(Xavier Leroy, report by Richard Jones, review by Nicolás Ojeda Bär)
- #9753: fix build for Android
(Eduardo Rafael, review by Xavier Leroy)
- #9848, #9855: Fix double free of bytecode in toplevel
(Stephen Dolan, report by Sampsa Kiiskinen, review by Gabriel Scherer)
- #9858, #9861: Compiler fails with Ctype.Nondep_cannot_erase exception
(Thomas Refis, report by Philippe Veber, review by Florian Angeletti)
- #9860: wrong range constraint for subtract immediate on zSystems / s390x
(Xavier Leroy, review by Stephen Dolan)
- #9868, #9872, #9892: bugs in {in,out}_channel_length and seek_in
for files opened in text mode under Windows
(Xavier Leroy, report by Alain Frisch, review by Nicolás Ojeda Bär
and Alain Frisch)
- #9925: Correct passing -fdebug-prefix-map to flexlink on Cygwin by prefixing
it with -link.
(David Allsopp, review by Xavier Leroy)
- #9927: Restore Cygwin64 support.
(David Allsopp, review by Xavier Leroy)
- #9940: Fix unboxing of allocated constants from other compilation units
(Vincent Laviron, report by Stephen Dolan, review by Xavier Leroy and
Stephen Dolan)
- #9991: Fix reproducibility for `-no-alias-deps`
(Leo White, review by Gabriel Scherer and Florian Angeletti)
- #9998: Use Sys.opaque_identity in CamlinternalLazy.force
This removes extra warning 59 messages when compiling afl-instrumented
code with flambda -O3.
(Vincent Laviron, report by Louis Gesbert, review by Gabriel Scherer and
Pierre Chambart)
- #9999: fix -dsource printing of the pattern (`A as x | (`B as x)).
(Gabriel Scherer, report by Anton Bachin, review by Florian Angeletti)
- #9970, #10010: fix the declaration scope of extensible-datatype constructors.
A regression that dates back to 4.08 makes extensible-datatype constructors
with inline records very fragile, for example:
type 'a t += X of {x : 'a}
(Gabriel Scherer, review by Thomas Refis and Leo White,
report by Nicolás Ojeda Bär)
- #10048: Fix bug with generalized local opens.
(Leo White, review by Thomas Refis)
- #10106, #10112: some expected-type explanations where forgotten
after some let-bindings
(Gabriel Scherer, review by Thomas Refis and Florian Angeletti,
report by Daniil Baturin)
OCaml 4.11 maintenance branch
-----------------------------
### Bug fixes:
- #9096, #10096: fix a 4.11.0 performance regression in classes/objects
declared within a function
(Gabriel Scherer, review by Leo White, report by Sacha Ayoun)
OCaml 4.11.1 (31 August 2020)
-----------------------------
### Bug fixes:
- #9856, #9857: Prevent polymorphic type annotations from generalizing
weak polymorphic variables.
(Leo White, review by Jacques Garrigue)
- #9859, #9862: Remove an erroneous assertion when inferred function types
appear in the right hand side of an explicit :> coercion
(Florian Angeletti, review by Thomas Refis)
OCaml 4.11.0 (19 August 2020)
-----------------------------
(Changes that can break existing programs are marked with a "*")
### Runtime system:
- #9096: Print function names in backtraces.
Old output:
> Called from file "foo.ml", line 16, characters 42-53
New output:
> Called from Foo.bar in file "foo.ml", line 16, characters 42-53
(Stephen Dolan, review by Leo White and Mark Shinwell)
- #9082: The instrumented runtime now records logs in the CTF format.
A new API is available in the runtime to collect runtime statistics,
replacing the previous instrumented runtime macros.
Gc.eventlog_pause and Gc.eventlog_resume were added to allow user to control
instrumentation in a running program.
See the manual for more information on how to use this instrumentation mode.
(Enguerrand Decorne and Stephen Dolan, with help and review from
David Allsopp, Sébastien Hinderer, review by Anil Madhavapeddy,
Nicolás Ojeda Bär, Shakthi Kannan, KC Sivaramakrishnan, Gabriel Scherer,
Guillaume Munch-Maccagnoni, Damien Doligez, Leo White, Daniel Bünzli
and Xavier Leroy)
- #9230, #9362: Memprof support for native allocations.
(Jacques-Henri Jourdan and Stephen Dolan, review by Gabriel Scherer)
- #8920, #9238, #9239, #9254, #9458: New API for statistical memory profiling
in Memprof.Gc. The new version does no longer use ephemerons and allows
registering callbacks for promotion and deallocation of memory
blocks.
The new API no longer gives the block tags to the allocation callback.
(Stephen Dolan and Jacques-Henri Jourdan, review by Damien Doligez
and Gabriel Scherer)
- #9353: Reimplement `output_value` and the `Marshal.to_*` functions
using a hash table to detect sharing, instead of temporary in-place
modifications. This is a prerequisite for Multicore OCaml.
(Xavier Leroy and Basile Clément, review by Gabriel Scherer and
Stephen Dolan)
- #9119: Make [caml_stat_resize_noexc] compatible with the [realloc]
API when the old block is NULL.
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #9233: Restore the bytecode stack after an allocation.
(Stephen Dolan, review by Gabriel Scherer and Jacques-Henri Jourdan)
- #9249: restore definition of ARCH_ALIGN_INT64 in m.h if the architecture
requires 64-bit integers to be double-word aligned (autoconf regression)
(David Allsopp, review by Sébastien Hinderer)
- #9259: Made `Ephemeron.blit_key` and `Weak.blit` faster. They are now
linear in the size of the range being copied instead of depending on the
total sizes of the ephemerons or weak arrays involved.
(Arseniy Alekseyev, design advice by Leo White, review by François Bobot
and Damien Doligez)
- #9279: Memprof optimisation.
(Stephen Dolan, review by Jacques-Henri Jourdan)
- #9280: Micro-optimise allocations on amd64 to save a register.
(Stephen Dolan, review by Xavier Leroy)
- #9426: build the Mingw ports with higher levels of GCC optimization
(Xavier Leroy, review by Sébastien Hinderer)
* #9483: Remove accidental inclusion of <stdio.h> in <caml/misc.h>
The only release with the inclusion of stdio.h has been 4.10.0
(Christopher Zimmermann, review by Xavier Leroy and David Allsopp)
- #9282: Make Cconst_symbol have typ_int to fix no-naked-pointers mode.
(Stephen Dolan, review by Mark Shinwell, Xavier Leroy and Vincent Laviron)
- #9497: Harmonise behaviour between bytecode and native code for
recursive module initialisation in one particular case (fixes #9494).
(Mark Shinwell, David Allsopp, Vincent Laviron, Xavier Leroy,
Geoff Reedy, original bug report by Arlen Cox)
- #8791: use a variable-length encoding when marshalling bigarray dimensions,
avoiding overflow.
(Jeremy Yallop, Stephen Dolan, review by Xavier Leroy)
### Code generation and optimizations:
- #9441: Add RISC-V RV64G native-code backend.
(Nicolás Ojeda Bär, review by Xavier Leroy and Gabriel Scherer)
- #9316, #9443, #9463, #9782: Use typing information from Clambda
for mutable Cmm variables.
(Stephen Dolan, review by Vincent Laviron, Guillaume Bury, Xavier Leroy,
and Gabriel Scherer; temporary bug report by Richard Jones)
- #8637, #8805, #9247, #9296: Record debug info for each allocation.
(Stephen Dolan and Jacques-Henri Jourdan, review by Damien Doligez,
KC Sivaramakrishnan and Xavier Leroy)
- #9193: Make tuple matching optimisation apply to Lswitch and Lstringswitch.
(Stephen Dolan, review by Thomas Refis and Gabriel Scherer)
- #9392: Visit registers at most once in Coloring.iter_preferred.
(Stephen Dolan, review by Pierre Chambart and Xavier Leroy)
- #9412: Keep Sys.opaque_identity in Cmm and Mach
(Stephen Dolan, review by Mark Shinwell and Gabriel Scherer)
- #9549, #9557: Make -flarge-toc the default for PowerPC and introduce
-fsmall-toc to enable the previous behaviour.
(David Allsopp, report by Nathaniel Wesley Filardo, review by Xavier Leroy)
### Language features
- #8820, #9166: quoted extensions: {%foo|...|} is lighter syntax for
[%foo {||}], and {%foo bar|...|bar} for [%foo {bar|...|bar}].
(Gabriel Radanne, Leo White, Gabriel Scherer and Pieter Goetschalckx,
request by Bikal Lem)
- #7364, #2188, #9592, #9609: improvement of the unboxability check for types
with a single constructor. Mutually-recursive type declarations can
now contain unboxed types. This is based on the paper
https://arxiv.org/abs/1811.02300
(Gabriel Scherer and Rodolphe Lepigre,
review by Jeremy Yallop, Damien Doligez and Frédéric Bour)
- #1154, #1706: spellchecker hints and type-directed disambiguation
for extensible sum type constructors
(Florian Angeletti, review by Alain Frisch, Gabriel Radanne, Gabriel Scherer
and Leo White)
- #6673, #1132, #9617: Relax the handling of explicit polymorphic types.
This improves error messages in some polymorphic recursive definition,
and requires less polymorphic annotations in some cases of
mutually-recursive definitions involving polymorphic recursion.
(Leo White, review by Jacques Garrigue and Gabriel Scherer)
- #9232: allow any class type paths in #-types,
For instance, "val f: #F(X).t -> unit" is now allowed.
(Florian Angeletti, review by Gabriel Scherer, suggestion by Leo White)
### Standard library:
- #9077: Add Seq.cons and Seq.append
(Sébastien Briais, review by Yawar Amin and Florian Angeletti)
- #9235: Add Array.exists2 and Array.for_all2
(Bernhard Schommer, review by Armaël Guéneau)
- #9226: Add Seq.unfold.
(Jeremy Yallop, review by Hezekiah M. Carty, Gabriel Scherer and
Gabriel Radanne)
- #9059: Added List.filteri function, same as List.filter but
with the index of the element.
(Léo Andrès, review by Alain Frisch)
- #8894: Added List.fold_left_map function combining map and fold.
(Bernhard Schommer, review by Alain Frisch and github user @cfcs)
- #9365: Set.filter_map and Map.filter_map
(Gabriel Scherer, review by Stephen Dolan and Nicolás Ojeda Bär)
- #9248: Add Printexc.default_uncaught_exception_handler
(Raphael Sousa Santos, review by Daniel Bünzli)
- #8771: Lexing: add set_position and set_filename to change (fake)
the initial tracking position of the lexbuf.
(Konstantin Romanov, Miguel Lumapat, review by Gabriel Scherer,
Sébastien Hinderer, and David Allsopp)
- #9237: `Format.pp_update_geometry ppf (fun geo -> {geo with ...})`
for formatter geometry changes that are robust to new geometry fields.
(Gabriel Scherer, review by Josh Berdine and Florian Angeletti)
- #7110: Added Printf.ikbprintf and Printf.ibprintf
(Muskan Garg, review by Gabriel Scherer and Florian Angeletti)
- #9266: Install pretty-printer for the exception Fun.Finally_raised.
(Guillaume Munch-Maccagnoni, review by Daniel Bünzli, Gabriel Radanne,
and Gabriel Scherer)
### Other libraries:
- #9106: Register printer for Unix_error in win32unix, as in unix.
(Christopher Zimmermann, review by David Allsopp)
- #9183: Preserve exception backtrace of exceptions raised by top-level phrases
of dynlinked modules.
(Nicolás Ojeda Bär, review by Xavier Clerc and Gabriel Scherer)
- #9320, #9550: under Windows, make sure that the Unix.exec* functions
properly quote their argument lists.
(Xavier Leroy, report by André Maroneze, review by Nicolás Ojeda Bär
and David Allsopp)
- #9490, #9505: ensure proper rounding of file times returned by
Unix.stat, Unix.lstat, Unix.fstat.
(Xavier Leroy and Guillaume Melquiond, report by David Brown,
review by Gabriel Scherer and David Allsopp)
### Tools:
- #9283, #9455, #9457: add a new toplevel directive `#use_output "<command>"` to
run a command and evaluate its output.
(Jérémie Dimino, review by David Allsopp)
- #6969: Argument -nocwd added to ocamldep
(Muskan Garg, review by Florian Angeletti)
- #8676, #9594: turn debugger off in programs launched by the program
being debugged
(Xavier Leroy, report by Michael Soegtrop, review by Gabriel Scherer)
- #9057: aid debugging the debugger by preserving backtraces of unhandled
exceptions.
(David Allsopp, review by Gabriel Scherer)
- #9276: objinfo: cm[x]a print extra C options, objects and dlls in
the order given on the cli. Follow up to #4949.
(Daniel Bünzli, review by Gabriel Scherer)
- #463: objinfo: better errors on object files coming
from a different (older or newer), incompatible compiler version.
(Gabriel Scherer, review by Gabriel Radanne and Damien Doligez)
* #9197: remove compatibility logic from #244 that was designed to
synchronize toplevel printing margins with Format.std_formatter,
but also resulted in unpredictable/fragile changes to formatter
margins.
Setting the margins on the desired formatters should now work.
typically on `Format.std_formatter`.
Note that there currently is no robust way to do this from the
toplevel, as applications may redirect toplevel printing. In
a compiler/toplevel driver, one should instead access
`Location.formatter_for_warnings`; it is not currently exposed
to the toplevel.
(Gabriel Scherer, review by Armaël Guéneau)
- #9207, #9210: fix ocamlyacc to work correctly with up to 255 entry
points to the grammar.
(Andreas Abel, review by Xavier Leroy)
- #9482, #9492: use diversions (@file) to work around OS limitations
on length of Sys.command argument.
(Xavier Leroy, report by Jérémie Dimino, review by David Allsopp)
### Manual and documentation:
- #9141: beginning of the ocamltest reference manual
(Sébastien Hinderer, review by Gabriel Scherer and Thomas Refis)
- #9228: Various Map documentation improvements: add missing key argument in
the 'merge' example; clarify the relationship between input and output keys
in 'union'; note that find and find_opt return values, not bindings.
(Jeremy Yallop, review by Gabriel Scherer and Florian Angeletti)
- #9255, #9300: reference chapter, split the expression grammar
(Florian Angeletti, report by Harrison Ainsworth, review by Gabriel Scherer)
- #9325: documented base case for `List.for_all` and `List.exists`
(Glenn Slotte, review by Florian Angeletti)
- #9410, #9422: replaced naive fibonacci example with gcd
(Anukriti Kumar, review by San Vũ Ngọc, Florian Angeletti, Léo Andrès)
- #9541: Add a documentation page for the instrumented runtime;
additional changes to option names in the instrumented runtime.
(Enguerrand Decorne, review by Anil Madhavapeddy, Gabriel Scherer,
Daniel Bünzli, David Allsopp, Florian Angeletti,
and Sébastien Hinderer)
- #9610: manual, C FFI: naked pointers are deprecated, detail the
forward-compatible options for handling out-of-heap pointers.
(Xavier Leroy, review by Mark Shinwell, David Allsopp and Florian Angeletti)
- #9618: clarify the Format documentation on the margin and maximum indentation
limit
(Florian Angeletti, review by Josh Berdine)
- #8644: fix formatting comment about @raise in stdlib's mli files
(Élie Brami, review by David Allsopp)
- #9327, #9401: manual, fix infix attribute examples
(Florian Angeletti, report by David Cadé, review by Gabriel Scherer)
- #9403: added a description for warning 67 and added a "." at the end of
warnings for consistency.
(Muskan Garg, review by Gabriel Scherer and Florian Angeletti)
- #7708, #9580: Ensure Stdlib documentation index refers to Stdlib.
(Stephen Dolan, review by Florian Angeletti, report by Hannes Mehnert)
### Compiler user-interface and warnings:
- #9712: Update the version format to allow "~".
The new format is "major.minor[.patchlevel][(+|~)additional-info]",
for instance "4.12.0~beta1+flambda".
This is a documentation-only change for the 4.11 branch, the new format
will be used starting with the 4.12 branch.
(Florian Angeletti, review by Damien Doligez and Xavier Leroy)
- #1664: make -output-complete-obj link the runtime native c libraries when
building shared libraries like `-output-obj`.
(Florian Angeletti, review by Nicolás Ojeda Bär)
- #9349: Support [@inlined hint] attribute.
(Leo White, review by Stephen Dolan)
- #2141: generate .annot files from cmt data; deprecate -annot.
(Nicolás Ojeda Bär, review by Alain Frisch, Gabriel Scherer and Damien
Doligez)
* #7678, #8631: ocamlc -c and ocamlopt -c pass same switches to the C
compiler when compiling .c files (in particular, this means ocamlopt
passes -fPIC on systems requiring it for shared library support).
(David Allsopp, report by Daniel Bünzli, review by Sébastien Hinderer)
- #9074: reworded error message for non-regular structural types
(Florian Angeletti, review by Jacques Garrigue and Leo White,
report by Chas Emerick)
- #8938: Extend ocamlopt option "-stop-after" to handle "scheduling" argument.
(Greta Yorsh, review by Florian Angeletti and Sébastien Hinderer)
- #8945, #9086: Fix toplevel show directive to work with constructors
(Simon Parry, review by Gabriel Scherer, Jeremy Yallop,
Alain Frisch, Florian Angeletti)
- #9107: improved error message for exceptions in module signature errors
(Gabriel Scherer, review by Florian Angeletti)
- #9208: -dno-locations option to hide source locations (and debug events)
from intermediate-representation dumps (-dfoo).
(Gabriel Scherer, review by Vincent Laviron)
- #9393: Improve recursive module usage warnings
(Leo White, review by Thomas Refis)
- #9486: Fix configuration for the Haiku operating system
(Sylvain Kerjean, review by David Allsopp and Sébastien Hinderer)
### Internal/compiler-libs changes:
- #9021: expose compiler Longident.t parsers
(Florian Angeletti, review by Gabriel Scherer)
- #9452: Add locations to docstring attributes
(Leo White, review by Gabriel Scherer)
- #463: a new Misc.Magic_number module for user-friendly parsing
and validation of OCaml magic numbers.
(Gabriel Scherer, review by Gabriel Radanne and Damien Doligez)
- #1176: encourage better compatibility with older Microsoft C compilers by
using GCC's -Wdeclaration-after-statement when available. Introduce
Caml_inline to stop abuse of the inline keyword on MSVC and to help ensure
that only static inline is used in the codebase (erroneous instance in
runtime/win32.c removed).
(David Allsopp, review by Olivier Andrieu and Xavier Leroy)
- #8934: Stop relying on location to track usage
(Thomas Refis, review by Gabriel Radanne)
- #8970: separate value patterns (matching on values) from computation patterns
(matching on the effects of a copmutation) in the typedtree.
(Gabriel Scherer, review by Jacques Garrigue and Alain Frisch)
- #9060: ensure that Misc.protect_refs preserves backtraces
(Gabriel Scherer, review by Guillaume Munch-Maccagnoni and David Allsopp)
- #9078: make all compilerlibs/ available to ocamltest.
(Gabriel Scherer, review by Sébastien Hinderer)
- #9079: typecore/parmatch: refactor ppat_of_type and refine
the use of backtracking on wildcard patterns
(Florian Angeletti, Jacques Garrigue, Gabriel Scherer,
review by Thomas Refis)
- #9081: typedtree, make the pat_env field of pattern data immutable
(Gabriel Scherer, review by Jacques Garrigue, report by Alain Frisch)
- #9178, #9182, #9196: refactor label-disambiguation (Typecore.NameChoice)
(Gabriel Scherer, Thomas Refis, Florian Angeletti and Jacques Garrigue,
reviewing each other without self-loops)
- #9321, #9322, #9359, #9361, #9417, #9447: refactor the
pattern-matching compiler
(Thomas Refis and Gabriel Scherer, review by Florian Angeletti)
- #9211, #9215, #9222: fix Makefile dependencies in
compilerlibs, dynlink, ocamltest.
(Gabriel Scherer, review by Vincent Laviron and David Allsopp)
- #9275: Short circuit simple inclusion checks
(Leo White, review by Thomas Refis)
- #9305: Avoid polymorphic compare in Ident
(Leo White, review by Xavier Leroy and Gabriel Scherer)
- #7927: refactor val_env met_env par_env to class_env
(Muskan Garg, review by Gabriel Scherer and Florian Angeletti)
- #2324, #9613: Replace the caml_int_compare and caml_float_compare
(C functions) with primitives.
(Greta Yorsh, review by Stephen Dolan and Vincent Laviron)
- #9246: Avoid rechecking functor applications
(Leo White, review by Jacques Garrigue)
- #9402: Remove `sudo:false` from .travis.yml
(Hikaru Yoshimura)
* #9411: forbid optional arguments reordering with -nolabels
(Thomas Refis, review by Frédéric Bour and Jacques Garrigue)
- #9414: testsuite, ocamltest: keep test artifacts only on failure.
Use KEEP_TEST_DIR_ON_SUCCESS=1 to keep all artifacts.
(Gabriel Scherer, review by Sébastien Hinderer)
### Build system:
- #9250: Add --disable-ocamltest to configure and disable building for
non-development builds.
(David Allsopp, review by Sébastien Hinderer)
### Bug fixes:
- #7520, #9547: Odd behaviour of refutation cases with polymorphic variants
(Jacques Garrigue, report by Leo White, reviews by Gabriel Scherer and Leo)
- #7562, #9456: ocamlopt-generated code crashed on Alpine Linux on
ppc64le, arm, and i386. Fixed by turning PIE off for musl-based Linux
systems except amd64 (x86_64) and s390x.
(Xavier Leroy, review by Gabriel Scherer)
- #7683, #1499: Fixes one case where the evaluation order in native-code
may not match the one in bytecode.
(Nicolás Ojeda Bär, report by Pierre Chambart, review by Gabriel Scherer)
- #7696, #6608: Record expression deleted when all fields specified
(Jacques Garrigue, report by Jeremy Yallop)
- #7741, #9645: Failure to report escaping type variable
(Jacques Garrigue, report by Gabriel Radanne, review by Gabriel Scherer)
- #7817, #9546: Unsound inclusion check for polymorphic variant
(Jacques Garrigue, report by Mikhail Mandrykin, review by Gabriel Scherer)
- #7897, #9537: Fix warning 38 for rebound extension constructors
(Leo White, review by Florian Angeletti)
- #7917, #9426: Use GCC option -fexcess-precision=standard when available,
avoiding a problem with x87 excess precision in Float.round.
(Xavier Leroy, review by Sébastien Hinderer)
- #9011: Allow linking .cmxa files with no units on MSVC by not requiring the
.lib file to be present.
(David Allsopp, report by Dmitry Bely, review by Xavier Leroy)
- #9064: Relax the level handling when unifying row fields
(Leo White, review by Jacques Garrigue)
- #9097: Do not emit references to dead labels introduced by #2321 (spacetime).
(Greta Yorsh, review by Mark Shinwell)
- #9163: Treat loops properly in un_anf
(Leo White, review by Mark Shinwell, Pierre Chambart and Vincent Laviron)
- #9189, #9281: fix a conflict with Gentoo build system
by removing an one-letter Makefile variable.
(Florian Angeletti, report by Ralph Seichter, review by David Allsopp
and Damien Doligez)
- #9225: Do not drop bytecode debug info after C calls.
(Stephen Dolan, review by Gabriel Scherer and Jacques-Henri Jourdan)
- #9231: Make sure a debug event (and the corresponding debug
information) is inserted after every primitive that can appear in a
collected call stack, and make sure ocamlc preserves such events
even if they are at tail position.
(Jacques-Henri Jourdan, review by Gabriel Scherer)
- #9244: Fix some missing usage warnings
(Leo White, review by Florian Angeletti)
- #9274, avoid reading cmi file while printing types
(Florian Angeletti, review by Gabriel Scherer)
- #9307, #9345: reproducible env summaries for reproducible compilation
(Florian Angeletti, review by Leo White)
- #9309, #9318: Fix exhaustivity checking with empty types
(Florian Angeletti, Stefan Muenzel and Thomas Refis, review by Gabriel Scherer
and Thomas Refis)
- #9335: actually have --disable-stdlib-manpages not build the manpages
(implementation conflicted with #8837 which wasn't picked up in review)
(David Allsopp, review by Florian Angeletti and Sébastien Hinderer)
- #9343: Re-enable `-short-paths` for some error messages
(Leo White, review by Florian Angeletti)
- #9355, #9356: ocamldebug, fix a fatal error when printing values
whose type involves a functor application.
(Florian Angeletti, review by Gabriel Scherer, report by Cyril Six)
- #9367: Make bytecode and native-code backtraces agree.
(Stephen Dolan, review by Gabriel Scherer)
- #9375, #9477: add forgotten substitution when compiling anonymous modules
(Thomas Refis, review by Frédéric Bour, report by Andreas Hauptmann)
- #9384, #9385: Fix copy scope bugs in substitutions
(Leo White, review by Thomas Refis, report by Nick Roberts)
* #9388: Prohibit signature local types with constraints
(Leo White, review by Jacques Garrigue)
- #7141, #9389: returns exit_code for better user response on linking_error
(Anukriti Kumar, review by Gabriel Scherer and Valentin Gatien-Baron)
- #9406, #9409: fix an error with packed module types from missing
cmis.
(Florian Angeletti, report by Thomas Leonard, review by Gabriel Radanne
and Gabriel Scherer)
- #9415: Treat `open struct` as `include struct` in toplevel
(Leo White, review by Thomas Refis)
- #9416: Avoid warning 58 in flambda ocamlnat
(Leo White, review by Florian Angeletti)
- #9420: Fix memory leak when `caml_output_value_to_block` raises an exception
(Xavier Leroy, review by Guillaume Munch-Maccagnoni)
- #9428: Fix truncated exception backtrace for C->OCaml callbacks
on Power and Z System
(Xavier Leroy, review by Nicolás Ojeda Bär)
- #9623, #9642: fix typing environments in Typedecl.transl_with_constraint
(Gabriel Scherer, review by Jacques Garrigue and Leo White,
report by Hugo Heuzard)
- #9695, #9702: no error when opening an alias to a missing module
(Jacques Garrigue, report and review by Gabriel Scherer)
- #9714, #9724: Add a terminator to the `caml_domain_state` structure
to better ensure that members are correctly spaced.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
OCaml 4.10 maintenance branch
-----------------------------
### Runtime system:
- #9344, #9368: Disable exception backtraces in bytecode programs
built with "-output-complete-exe". At the moment, such programs do
not embed debug information and exception backtraces where causing
them to crash.
(Jérémie Dimino, review by Nicolás Ojeda Bär)
### Build system:
- #9531: fix support for the BFD library on FreeBSD
(Hannes Mehnert, review by Gabriel Scherer and David Allsopp)
### Bug fixes:
- #9068, #9437: ocamlopt -output-complete-obj failure on FreeBSD 12
(Xavier Leroy, report by Hannes Mehnert, review by Sébastien Hinderer)
- #9165, #9840: Add missing -function-sections flag in Makefiles.
(Greta Yorsh, review by David Allsopp)
- #9495: fix a bug where bytecode binaries compiled with `-output-complete-exe`
would not execute `at_exit` hooks at program termination (in particular,
output channels would not be flushed).
(Nicolás Ojeda Bär, review by David Allsopp)
- #9714, #9724: Use the C++ alignas keyword when compiling in C++ in MSVC.
Fixes a bug with MSVC C++ 2015 onwards.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
- #9736, #9749: Compaction must start in a heap where all free blocks are
blue, which was not the case with the best-fit allocator.
(Damien Doligez, report and review by Leo White)
### Tools:
- #9552: restore ocamloptp build and installation
(Florian Angeletti, review by David Allsopp and Xavier Leroy)
OCaml 4.10.0 (21 February 2020)
-------------------------------
(Changes that can break existing programs are marked with a "*")
### Language features
- #7757, #1726: multi-indices for extended indexing operators:
`a.%{0;1;2}` desugars to `( .%{ ;.. } ) a [|0;1;2|]`
(Florian Angeletti, review by Gabriel Radanne)
* #1859, #9117: enforce safe (immutable) strings by removing
the -unsafe-string option by default. This can be overridden by
a configure-time option (available since 4.04 in 2016):
--disable-force-safe-string since 4.08, -no-force-safe-since
between 4.07 and 4.04.
In the force-safe-string mode (now the default), the return type of the
String_val macro in C stubs is `const char*` instead of
`char*`. This change may break C FFI code.
(Kate Deplaix)
- #6662, #8908: allow writing "module _ = E" to ignore module expressions
(Thomas Refis, review by Gabriel Radanne)
### Runtime system:
- #8809, #9292: Add a best-fit allocator for the major heap; still
experimental, it should be much better than current allocation
policies (first-fit and next-fit) for programs with large heaps,
reducing both GC cost and memory usage.
This new best-fit is not (yet) the default; set it explicitly with
OCAMLRUNPARAM="a=2" (or Gc.set from the program). You may also want
to increase the `space_overhead` parameter of the GC (a percentage,
80 by default), for example OCAMLRUNPARAM="o=85", for optimal
speed.
(Damien Doligez, review by Stephen Dolan, Jacques-Henri Jourdan,
Xavier Leroy, Leo White)
* #8713, #8940, #9115, #9143, #9202, #9251:
Introduce a state table in the runtime to contain the global variables.
(The Multicore runtime will have one such state for each domain.)
This changes the status of some internal variables of the OCaml runtime;
in many cases the header file originally defining the internal variable
provides a compatibility macro with the old name, but programs
re-defining those variables by hand need to be fixed.
(KC Sivaramakrishnan and Stephen Dolan,
compatibility hacking by David Allsopp, Florian Angeletti, Kate Deplaix,
Jacques Garrigue, Guillaume Munch-Maccagnoni and Nicolás Ojeda Bär,
review by David Allsopp, Alain Frisch, Nicolás Ojeda Bär,
Gabriel Scherer, Damien Doligez, and Guillaume Munch-Maccagnoni)
- #8993: New C functions caml_process_pending_actions{,_exn} in
caml/signals.h, intended for executing all pending actions inside
long-running C functions (requested minor and major collections,
signal handlers, finalisers, and memprof callbacks). The function
caml_process_pending_actions_exn returns any exception arising
during their execution, allowing resources to be cleaned-up before
re-raising.
(Guillaume Munch-Maccagnoni, review by Jacques-Henri Jourdan,
Stephen Dolan, and Gabriel Scherer)
* #8691, #8897, #9027: Allocation functions are now guaranteed not to
trigger any OCaml callback when called from C. In long-running C
functions, this can be replaced with calls to
caml_process_pending_actions at safe points.
Side effect of this change: in bytecode mode, polling for
asynchronous callbacks is performed at every minor heap allocation,
in addition to function calls and loops as in previous OCaml
releases.
(Jacques-Henri Jourdan, review by Stephen Dolan, Gabriel Scherer and
Guillaume Munch-Maccagnoni)
* #9037: caml_check_urgent_gc is now guaranteed not to trigger any
finaliser. In long-running C functions, this can be replaced
with calls to caml_process_pending_actions at safe points.
(Guillaume Munch-Maccagnoni, review by Jacques-Henri Jourdan and
Stephen Dolan)
- #8619: Ensure Gc.minor_words remains accurate after a GC.
(Stephen Dolan, Xavier Leroy and David Allsopp,
review by Xavier Leroy and Gabriel Scherer)
- #8667: Limit GC credit to 1.0
(Leo White, review by Damien Doligez)
- #8670: Fix stack overflow detection with systhreads
(Stephen Dolan, review by Xavier Leroy, Anil Madhavapeddy, Gabriel Scherer,
Frédéric Bour and Guillaume Munch-Maccagnoni)
* #8711: The major GC hooks are no longer allowed to interact with the
OCaml heap.
(Jacques-Henri Jourdan, review by Damien Doligez)
- #8630: Use abort() instead of exit(2) in caml_fatal_error, and add
the new hook caml_fatal_error_hook.
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #8641: Better call stacks when a C call is involved in byte code mode
(Jacques-Henri Jourdan, review by Xavier Leroy)
- #8634, #8668, #8684, #9103 (originally #847): Statistical memory profiling.
In OCaml 4.10, support for allocations in the minor heap in native
mode is not available, and callbacks for promotions and
deallocations are not available.
Hence, there is not any public API for this feature yet.
(Jacques-Henri Jourdan, review by Stephen Dolan, Gabriel Scherer
and Damien Doligez)
- #9268, #9271: Fix bytecode backtrace generation with large integers present.
(Stephen Dolan and Mark Shinwell, review by Gabriel Scherer and
Jacques-Henri Jourdan)
### Standard library:
- #8760: List.concat_map : ('a -> 'b list) -> 'a list -> 'b list
(Gabriel Scherer, review by Daniel Bünzli and Thomas Refis)
- #8832: List.find_map : ('a -> 'b option) -> 'a list -> 'b option
(Gabriel Scherer, review by Jeremy Yallop, Nicolás Ojeda Bär
and Daniel Bünzli)
- #7672, #1492: Add `Filename.quote_command` to produce properly-quoted
commands for execution by Sys.command.
(Xavier Leroy, review by David Allsopp and Damien Doligez)
- #8971: Add `Filename.null`, the conventional name of the "null" device.
(Nicolás Ojeda Bär, review by Xavier Leroy and Alain Frisch)
- #8651: add '%#F' modifier in printf to output OCaml float constants
in hexadecimal
(Pierre Roux, review by Gabriel Scherer and Xavier Leroy)
- #8657: Optimization in [Array.make] when initializing with unboxed
or young values.
(Jacques-Henri Jourdan, review by Gabriel Scherer and Stephen Dolan)
- #8716: Optimize [Array.fill] and [Hashtbl.clear] with a new runtime primitive
(Alain Frisch, review by David Allsopp, Stephen Dolan and Damien Doligez)
- #8530: List.sort: avoid duplicate work by chop
(Guillaume Munch-Maccagnoni, review by David Allsopp, Damien Doligez and
Gabriel Scherer)
### Other libraries:
- #1939, #2023: Implement Unix.truncate and Unix.ftruncate on Windows.
(Florent Monnier and Nicolás Ojeda Bär, review by David Allsopp)
### Code generation and optimizations:
- #8806: Add an [@@immediate64] attribute for types that are known to
be immediate only on 64 bit platforms
(Jérémie Dimino, review by Vladimir Keleshev)
- #9028, #9032: Fix miscompilation by no longer assuming that
untag_int (tag_int x) = x in Cmmgen; the compilation of `(n lsl 1) + 1`,
for example, would be incorrect if evaluated with a large value for `n`.
(Stephen Dolan, review by Vincent Laviron and Xavier Leroy)
- #8672: Optimise Switch code generation on booleans.
(Stephen Dolan, review by Pierre Chambart)
- #8990: amd64: Emit 32bit registers for Iconst_int when we can
(Xavier Clerc, Tom Kelly and Mark Shinwell, review by Xavier Leroy)
- #2322: Add pseudo-instruction `Ladjust_trap_depth` to replace
dummy Lpushtrap generated in linearize
(Greta Yorsh and Vincent Laviron, review by Xavier Leroy)
- #8707: Simplif: more regular treatment of Tupled and Curried functions
(Gabriel Scherer, review by Leo White and Alain Frisch)
- #8526: Add compile-time option -function-sections in ocamlopt to emit
each function in a separate named text section on supported targets.
(Greta Yorsh, review by Pierre Chambart)
- #2321: Eliminate dead ICatch handlers
(Greta Yorsh, review by Pierre Chambart and Vincent Laviron)
- #8919: lift mutable lets along with immutable ones
(Leo White, review by Pierre Chambart)
- #8909: Graph coloring register allocator: the weights put on
preference edges should not be divided by 2 in branches of
conditional constructs, because it is not good for performance
and because it leads to ignoring preference edges with 0 weight.
(Eric Stavarache, review by Xavier Leroy)
- #9006: int32 code generation improvements
(Stephen Dolan, designed with Greta Yorsh, review by Xavier Clerc,
Xavier Leroy and Alain Frisch)
- #9041: amd64: Avoid stall in sqrtsd by clearing destination.
(Stephen Dolan, with thanks to Andrew Hunter, Will Hasenplaugh,
Spiros Eliopoulos and Brian Nigito. Review by Xavier Leroy)
- #2165: better unboxing heuristics for let-bound identifiers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)
- #8735: unbox across static handlers
(Alain Frisch, review by Vincent Laviron and Gabriel Scherer)
### Manual and documentation:
- #8718, #9089: syntactic highlighting for code examples in the manual
(Florian Angeletti, report by Anton Kochkov, review by Gabriel Scherer)
- #9101: add links to section anchor before the section title,
make the name of those anchor explicit.
(Florian Angeletti, review by Daniel Bünzli, Sébastien Hinderer,
and Gabriel Scherer)
- #9257, cautionary guidelines for using the internal runtime API
without too much updating pain.
(Florian Angeletti, review by Daniel Bünzli, Guillaume Munch-Maccagnoni
and KC Sivaramakrishnan)
- #8950: move local opens in pattern out of the extension chapter
(Florian Angeletti, review and suggestion by Gabriel Scherer)
- #9088, #9097: fix operator character classes
(Florian Angeletti, review by Gabriel Scherer,
report by Clément Busschaert)
- #9169: better documentation for the best-fit allocation policy
(Gabriel Scherer, review by Guillaume Munch-Maccagnoni
and Florian Angeletti)
### Compiler user-interface and warnings:
- #8833: Hint for (type) redefinitions in toplevel session
(Florian Angeletti, review by Gabriel Scherer)
- #2127, #9185: Refactor lookup functions
Included observable changes:
- makes the location of usage warnings and alerts for constructors more
precise
- don't warn about a constructor never being used to build values when it
has been defined as private
(Leo White, Hugo Heuzard review by Thomas Refis, Florian Angeletti)
- #8702, #8777: improved error messages for fixed row polymorphic variants
(Florian Angeletti, report by Leo White, review by Thomas Refis)
- #8844: Printing faulty constructors, inline records fields and their types
during type mismatches. Also slightly changed other type mismatches error
output.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White)
- #8885: Warn about unused local modules
(Thomas Refis, review by Alain Frisch)
- #8872: Add ocamlc option "-output-complete-exe" to build a self-contained
binary for bytecode programs, containing the runtime and C stubs.
(Stéphane Glondu, Nicolás Ojeda Bär, review by Jérémie Dimino and Daniel
Bünzli)
- #8874: add tests for typechecking error messages and pack them into
pretty-printing boxes.
(Oxana Kostikova, review by Gabriel Scherer)
- #8891: Warn about unused functor parameters
(Thomas Refis, review by Gabriel Radanne)
- #8903: Improve errors for first-class modules
(Leo White, review by Jacques Garrigue)
- #8914: clarify the warning on unboxable types used in external primitives (61)
(Gabriel Scherer, review by Florian Angeletti, report on the Discourse forum)
- #9046: disable warning 30 by default
This outdated warning complained on label/constructor name conflicts
within a mutually-recursive type declarations; there is now no need
to complain thanks to type-based disambiguation.
(Gabriel Scherer)
### Tools:
* #6792, #8654 ocamldebug now supports programs using Dynlink. This
changes ocamldebug messages, which may break compatibility
with older emacs modes.
(whitequark and Jacques-Henri Jourdan, review by Gabriel Scherer
and Xavier Clerc)
- #8621: Make ocamlyacc a Windows Unicode application
(David Allsopp, review by Nicolás Ojeda Bär)
* #8834, `ocaml`: adhere to the XDG base directory specification to
locate an `.ocamlinit` file. Reads an `$XDG_CONFIG_HOME/ocaml/init.ml`
file before trying to lookup `~/.ocamlinit`. On Windows the behaviour
is unchanged.
(Daniel Bünzli, review by David Allsopp, Armaël Guéneau and
Nicolás Ojeda Bär)
- #9113: ocamldoc: fix the rendering of multi-line code blocks
in the 'man' backend.
(Gabriel Scherer, review by Florian Angeletti)
- #9127, #9130: ocamldoc: fix the formatting of closing brace in record types.
(David Allsopp, report by San Vũ Ngọc)
- #9181: make objinfo work on Cygwin and look for the caml_plugin_header
symbol in both the static and the dynamic symbol tables.
(Sébastien Hinderer, review by Gabriel Scherer and David Allsopp)
### Build system:
- #8840: use ocaml{c,opt}.opt when available to build internal tools
On my machine this reduces parallel-build times from 3m30s to 2m50s.
(Gabriel Scherer, review by Xavier Leroy and Sébastien Hinderer)
- #8650: ensure that "make" variables are defined before use;
revise generation of config/util.ml to better quote special characters
(Xavier Leroy, review by David Allsopp)
- #8690, #8696: avoid rebuilding the world when files containing primitives
change.
(Stephen Dolan, review by Gabriel Scherer, Sébastien Hinderer and
Thomas Refis)
- #8835: new configure option --disable-stdlib-manpages to disable building
and installation of the library manpages.
(David Allsopp, review by Florian Angeletti and Gabriel Scherer)
- #8837: build manpages using ocamldoc.opt when available
cuts the manpages build time from 14s to 4s
(Gabriel Scherer, review by David Allsopp and Sébastien Hinderer,
report by David Allsopp)
- #8843, #8841: fix use of off_t on 32-bit systems.
(Stephen Dolan, report by Richard Jones, review by Xavier Leroy)
- #8947, #9134, #9302, #9311: fix/improve support for the BFD library
(Sébastien Hinderer, review by Damien Doligez and David Allsopp)
- #8951: let make's default target build the compiler
(Sébastien Hinderer, review by David Allsopp)
- #8995: allow developers to specify frequently-used configure options in
Git (ocaml.configure option) and a directory for host-specific, shareable
config.cache files (ocaml.configure-cache option). See HACKING.adoc for
further details.
(David Allsopp, review by Gabriel Scherer)
- #9136: Don't propagate Cygwin-style prefix from configure to
Makefile.config on Windows ports.
(David Allsopp, review by Sébastien Hinderer)
### Internal/compiler-libs changes:
- #8828: Added abstractions for variants, records, constructors, fields and
extension constructor types mismatch.
(Mekhrubon Turaev, review by Florian Angeletti, Leo White and Gabriel Scherer)
- #7927, #8527: Replace long tuples into records in typeclass.ml
(Ulugbek Abdullaev, review by David Allsopp and Gabriel Scherer)
- #1963: split cmmgen into generic Cmm helpers and clambda transformations
(Vincent Laviron, review by Mark Shinwell)
- #1901: Fix lexing of character literals in comments
(Pieter Goetschalckx, review by Damien Doligez)
- #1932: Allow octal escape sequences and identifiers containing apostrophes
in ocamlyacc actions and comments.
(Pieter Goetschalckx, review by Damien Doligez)
- #2288: Move middle end code from [Asmgen] to [Clambda_middle_end] and
[Flambda_middle_end]. Run [Un_anf] from the middle end, not [Cmmgen].
(Mark Shinwell, review by Pierre Chambart)
- #8692: Remove Misc.may_map and similar
(Leo White, review by Gabriel Scherer and Thomas Refis)
- #8677: Use unsigned comparisons in amd64 and i386 emitter of Lcondbranch3.
(Greta Yorsh, review by Xavier Leroy)
- #8766: Parmatch: introduce a type for simplified pattern heads
(Gabriel Scherer and Thomas Refis, review by Stephen Dolan and
Florian Angeletti)
- #8774: New implementation of Env.make_copy_of_types
(Alain Frisch, review by Thomas Refis, Leo White and Jacques Garrigue)
- #7924: Use a variant instead of an int in Bad_variance exception
(Rian Douglas, review by Gabriel Scherer)
- #8890: in -dtimings output, show time spent in C linker clearly
(Valentin Gatien-Baron)
- #8910, #8911: minor improvements to the printing of module types
(Gabriel Scherer, review by Florian Angeletti)
- #8913: ocamltest: improve 'promote' implementation to take
skipped lines/bytes into account
(Gabriel Scherer, review by Sébastien Hinderer)
- #8908: Use an option instead of a string for module names ("_" becomes None),
and a dedicated type for functor parameters: "()" maps to "Unit" (instead of
"*").
(Thomas Refis, review by Gabriel Radanne)
- #8928: Move contains_calls and num_stack_slots from Proc to Mach.fundecl
(Greta Yorsh, review by Florian Angeletti and Vincent Laviron)
- #8959, #8960, #8968, #9023: minor refactorings in the typing of patterns:
+ refactor the {let,pat}_bound_idents* functions
+ minor bugfix in type_pat
+ refactor the generic pattern-traversal functions
in Typecore and Typedtree
+ restrict the use of Need_backtrack
(Gabriel Scherer and Florian Angeletti,
review by Thomas Refis and Gabriel Scherer)
- #9030: clarify and document the parameter space of type_pat
(Gabriel Scherer and Florian Angeletti and Jacques Garrigue,
review by Florian Angeletti and Thomas Refis)
- #8975: "ocamltests" files are no longer required or used by
"ocamltest". Instead, any text file in the testsuite directory containing a
valid "TEST" block will be automatically included in the testsuite.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Sébastien Hinderer)
- #8992: share argument implementations between executables
(Florian Angeletti, review by Gabriel Scherer)
- #9015: fix fatal error in pprint_ast (#8789)
(Damien Doligez, review by Thomas Refis)
### Bug fixes:
- #5673, #7636: unused type variable causes generalization error
(Jacques Garrigue and Leo White, review by Leo White,
reports by Jean-Louis Giavitto and Christophe Raffalli)
- #6922, #8955: Fix regression with -principal type inference for inherited
methods, allowing to compile ocamldoc with -principal
(Jacques Garrigue, review by Leo White)
- #7925, #8611: fix error highlighting for exceptionally
long toplevel phrases
(Kyle Miller, reported by Armaël Guéneau, review by Armaël Guéneau
and Nicolás Ojeda Bär)
- #8622: Don't generate #! headers over 127 characters.
(David Allsopp, review by Xavier Leroy and Stephen Dolan)
- #8715: minor bugfixes in CamlinternalFormat; removes the unused
and misleading function CamlinternalFormat.string_of_formatting_gen
(Gabriel Scherer and Florian Angeletti,
review by Florian Angeletti and Gabriel Radanne)
- #8792, #9018: Possible (latent) bug in Ctype.normalize_type
removed incrimined Btype.log_type, replaced by Btype.set_type
(Jacques Garrigue, report by Alain Frisch, review by Thomas Refis)
- #8856, #8860: avoid stackoverflow when printing cyclic type expressions
in some error submessages.
(Florian Angeletti, report by Mekhrubon Turaev, review by Leo White)
- #8875: fix missing newlines in the output from MSVC invocation.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #8921, #8924: Fix stack overflow with Flambda
(Vincent Laviron, review by Pierre Chambart and Leo White,
report by Aleksandr Kuzmenko)
- #8892, #8895: fix the definition of Is_young when CAML_INTERNALS is not
defined.
(David Allsopp, review by Xavier Leroy)
- #8896: deprecate addr typedef in misc.h
(David Allsopp, suggestion by Xavier Leroy)
- #8981: Fix check for incompatible -c and -o options.
(Greta Yorsh, review by Damien Doligez)
- #9019, #9154: Unsound exhaustivity of GADTs from incomplete unification
Also fixes bug found by Thomas Refis in #9012
(Jacques Garrigue, report and review by Leo White, Thomas Refis)
- #9031: Unregister Windows stack overflow handler while shutting
the runtime down.
(Dmitry Bely, review by David Allsopp)
- #9051: fix unregistered local root in win32unix/select.c (could result in
`select` returning file_descr-like values which weren't in the original sets)
and correct initialisation of some blocks allocated with caml_alloc_small.
(David Allsopp, review by Xavier Leroy)
- #9073, #9120: fix incorrect GC ratio multiplier when allocating custom blocks
with caml_alloc_custom_mem in runtime/custom.c
(Markus Mottl, review by Gabriel Scherer and Damien Doligez)
- #9209, #9212: fix a development-version regression caused by #2288
(Kate Deplaix and David Allsopp, review by Sébastien Hinderer
and Gabriel Scherer )
- #9218, #9269: avoid a rare wrong module name error with "-annot" and
inline records.
(Florian Angeletti, review by Gabriel Scherer, report by Kate Deplaix)
- #9261: Fix a soundness bug in Rec_check, new in 4.10 (from #8908)
(Vincent Laviron, review by Jeremy Yallop and Gabriel Scherer)
OCaml 4.09 maintenance branch
-----------------------------
### Build system:
- #9383: Don't assume that AWKPATH includes .
(David Allsopp, report by Ian Zimmerman)
OCaml 4.09.1 (16 Mars 2020)
---------------------------
- #8855, #8858: Links for tools not created when installing with
--disable-installing-byecode-programs (e.g. ocamldep.opt installed, but
ocamldep link not created)
(David Allsopp, report by Thomas Leonard)
- #8953, #8954: Fix error submessages in the toplevel: do not display
dummy locations
(Armaël Guéneau, review by Gabriel Scherer)
- #8965, #8979: Alpine build failure caused by check-parser-uptodate-or-warn.sh
(Gabriel Scherer and David Allsopp, report by Anton Kochkov)
- #8985, #8986: fix generation of the primitives when the locale collation is
incompatible with C.
(David Allsopp, review by Nicolás Ojeda Bär, report by Sebastian Rasmussen)
- #9050, #9076: install missing compilerlibs/ocamlmiddleend archives
(Gabriel Scherer, review by Florian Angeletti, report by Olaf Hering)
- #9180: pass -fno-common option to C compiler when available,
so as to detect problematic multiple definitions of global variables
in the C runtime
(Xavier Leroy, review by Mark Shinwell)
- #9144, #9180: multiple definitions of global variables in the C runtime,
causing problems with GCC 10.0 and possibly with other C compilers
(Xavier Leroy, report by Jürgen Reuter, review by Mark Shinwell)
- #9128: Fix a bug in bytecode mode which could lead to a segmentation
fault. The bug was caused by the fact that the atom table shared a
page with some bytecode. The fix makes sure both the atom table and
the minor heap have their own pages.
(Jacques-Henri Jourdan, review by Stephen Dolan, Xavier Leroy and
Gabriel Scherer)
OCaml 4.09.0 (19 September 2019)
--------------------------------
### Runtime system:
* #1725, #2279: Deprecate Obj.set_tag and Obj.truncate
(Stephen Dolan, review by Gabriel Scherer, Damien Doligez and Xavier Leroy)
* #2240: Constify "identifier" in struct custom_operations
(Cedric Cellier, review by Xavier Leroy)
* #2293: Constify "caml_named_value"
(Stephen Dolan, review by Xavier Leroy)
- #8787, #8788: avoid integer overflow in caml_output_value_to_bytes
(Jeremy Yallop, report by Marcello Seri)
- #2075, #7729: rename _T macro used to support Unicode in the (Windows) runtime
in order to avoid compiler warning
(Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
- #2250: Remove extra integer sign-extension in compare functions
(Stefan Muenzel, review by Xavier Leroy)
- #8607: Remove obsolete macros for pre-2002 MSVC support
(Stephen Dolan, review by Nicolás Ojeda Bär and David Allsopp)
- #8656: Fix a bug in [caml_modify_generational_global_root]
(Jacques-Henri Jourdan, review by Gabriel Scherer)
### Standard library:
- #2262: take precision (.<n>) and flags ('+' and ' ') into account
in printf %F
(Pierre Roux, review by Gabriel Scherer)
- #6148, #8596: optimize some buffer operations
(Damien Doligez, reports by John Whitington and Alain Frisch,
review by Jeremy Yallop and Gabriel Scherer)
### Other libraries:
* #2318: Delete the graphics library. This library is now available
as a separate "graphics" package in opam. Its new home is:
https://github.com/ocaml/graphics
(Jérémie Dimino, review by Nicolás Ojeda Bär, Xavier Leroy and
Sébastien Hinderer)
* #2289: Delete the vmthreads library. This library was deprecated in 4.08.0.
(Jérémie Dimino)
- #2112: Fix Thread.yield unfairness with busy threads yielding to each
other.
(Andrew Hunter, review by Jacques-Henri Jourdan, Spiros Eliopoulos, Stephen
Weeks, Mark Shinwell)
- #7903, #2306: Make Thread.delay interruptible by signals again
(Xavier Leroy, review by Jacques-Henri Jourdan and Edwin Török)
- #2248: Unix alloc_sockaddr: Fix read of uninitialized memory for an
unbound Unix socket. Add support for receiving abstract (Linux) socket paths.
(Tim Cuthbertson, review by Sébastien Hinderer and Jérémie Dimino)
### Compiler user-interface and warnings:
* #2276: Remove support for compiler plugins and hooks (also adds
[Dynlink.unsafe_get_global_value])
(Mark Shinwell, Xavier Clerc, review by Nicolás Ojeda Bär,
Florian Angeletti, David Allsopp and Xavier Leroy)
- #2301: Hint on type error on int literal
(Jules Aguillon, review by Nicolás Ojeda Bär , Florian Angeletti,
Gabriel Scherer and Armaël Guéneau)
* #2314: Remove support for gprof profiling.
(Mark Shinwell, review by Xavier Clerc and Stephen Dolan)
- #2190: fix pretty printing (using Pprintast) of "lazy ..." patterns and
"fun (type t) -> ..." expressions.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #2277: Use newtype names as type variable names
The inferred type of (fun (type t) (x : t) -> x)
is now printed as ('t -> 't) rather than ('a -> 'a).
(Matthew Ryan)
- #2309: New options -with-runtime and -without-runtime in ocamlopt/ocamlc
that control the inclusion of the runtime system in the generated program.
(Lucas Pluvinage, review by Daniel Bünzli, Damien Doligez, David Allsopp
and Florian Angeletti)
- #3819, #8546 more explanations and tests for illegal permutation
(Florian Angeletti, review by Gabriel Scherer)
- #8537: fix the -runtime-variant option for bytecode
(Damien Doligez, review by David Allsopp)
- #8541: Correctly print multi-lines locations
(Louis Roché, review by Gabriel Scherer)
- #8579: Better error message for private constructors
of an extensible variant type
(Guillaume Bury, review by many fine eyes)
### Code generation and optimizations:
- #2278: Remove native code generation support for 32-bit Intel macOS,
iOS and other Darwin targets.
(Mark Shinwell, review by Nicolás Ojeda Bär 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 Nicolás Ojeda Bär)
- #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 maintenance branch
-----------------------------
### Bug fixes:
- #9326, #10125: Gc.set incorrectly handles the three `custom_*` fields,
causing a performance regression
(report by Emilio Jesús Gallego Arias, analysis and fix by Stephen Dolan,
code by Xavier Leroy, review by Hugo Heuzard and Gabriel Scherer)
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 Frisch, 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
(François 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 Garrigue, 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)
- #2239: Fix match miscompilation with flambda
(Leo White, review by Alain Frisch)
### Runtime system:
- #7198, #7750, #1738: add a function (caml_alloc_custom_mem)
and three GC parameters to give the user better control of the
out-of-heap memory retained by custom values; use the function to
allocate bigarrays and I/O channels.
(Damien Doligez, review by Alain Frisch)
- #1793: add the -m and -M command-line options to ocamlrun.
Option -m prints the magic number of the bytecode executable passed
as argument, -M prints the magic number expected by ocamlrun.
(Sébastien Hinderer, review by Xavier Clerc and Damien Doligez)
- #1867: Remove the C plugins mechanism.
(Xavier Leroy, review by David Allsopp, Damien Doligez, Sébastien Hinderer)
- #8627: Require SSE2 for 32-bit mingw port to generate correct code
for caml_round with GCC 7.4.
(David Allsopp, review by Xavier Leroy)
- #7676, #2144: Remove old GC heuristic
(Damien Doligez, report and review by Alain Frisch)
* #1683: Change Marshal format to make Custom_tag objects store their
length. Old versions of OCaml will no longer be able to parse new marshalled
files containing custom blocks, but old files will still parse.
(Stephen Dolan)
- #1723: Remove internal Meta.static_{alloc,free} primitives.
(Stephen Dolan, review by Gabriel Scherer)
- #1895: Printexc.get_callstack would return only one frame in native
code in threads other then the initial one
(Valentin Gatien-Baron, review by Xavier Leroy)
- #1900, #7814: avoid exporting non-prefixed identifiers in the debug
and instrumented runtimes.
(Damien Doligez, report by Gabriel Scherer)
- #2079: Avoid page table lookup in Pervasives.compare with
no-naked-pointers
(Sam Goldman, review by Gabriel Scherer, David Allsopp, Stephen Dolan)
- #7829, #8585: Fix pointer comparisons in freelist.c (for 32-bit platforms)
(David Allsopp and Damien Doligez)
- #8567, #8569: on ARM64, use 32-bit loads to access caml_backtrace_active
(Xavier Leroy, review by Mark Shinwell and Greta Yorsh)
- #8568: Fix a memory leak in mmapped bigarrays
(Damien Doligez, review by Xavier Leroy and Jérémie Dimino)
### Tools
- #2182: Split Emacs caml-mode as an independent project.
(Christophe Troestler, review by Gabriel Scherer)
- #1865: support dark themes in Emacs, and clean up usage of
deprecated Emacs APIs
(Wilfred Hughes, review by Clément Pit-Claudel)
- #1590: ocamllex-generated lexers can be instructed not to update
their lex_curr_p/lex_start_p fields, resulting in a significant
performance gain when those fields are not required.
(Alain Frisch, review by Jérémie Dimino)
- #7843, #2013: ocamldoc, better handling of {{!label}text} in the latex
backend.
(Florian Angeletti, review by Nicolás Ojeda Bär and Gabriel Scherer)
- #7844, #2040: Emacs, use built-in detection of comments,
fixes an imenu crash.
(Wilfred Hughes, review by Christophe Troestler)
- #7850: Emacs, use symbol boundaries in regular expressions,
fixes an imenu crash.
(Wilfred Hughes, review by Christophe Troestler)
- #1711: the new 'open' flag in OCAMLPARAM takes a comma-separated list of
modules to open as if they had been passed via the command line -open flag.
(Nicolás Ojeda Bär, review by Mark Shinwell)
- #2000: ocamdoc, extended support for "include module type of ..."
(Florian Angeletti, review by Jérémie Dimino)
- #2045: ocamlmklib now supports options -args and -args0 to provide extra
command-line arguments in a file.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Daniel Bünzli)
- #2189: change ocamldep Makefile-output to print each dependency
on a new line, for more readable diffs of versioned dependencies.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
- #2223: ocamltest: fix the "bsd" and "not-bsd" built-in actions to
recognize all BSD variants
(Damien Doligez, review by Sébastien Hinderer and David Allsopp)
### Compiler distribution build system:
- #1776: add -no-install-bytecode-programs and related configure options to
control (non-)installation of ".byte" executables.
(Mark Shinwell, review by Sébastien Hinderer and Gabriel Scherer)
- #1777: add -no-install-source-artifacts and related configure options to
control installation of .cmt, .cmti, .mli and .ml files.
(Mark Shinwell, review by Nicolás Ojeda Bär and Sébastien Hinderer)
- #1781: cleanup of the manual's build process.
(steinuil, review by Marcello Seri, Gabriel Scherer and Florian Angeletti)
- #1797: remove the deprecated Makefile.nt files.
(Sébastien Hinderer, review by Nicolás Ojeda Bär)
- #1805: fix the bootstrap procedure and its documentation.
(Sébastien Hinderer, Xavier Leroy and Damien Doligez; review by
Gabriel Scherer)
- #1840: build system enhancements.
(Sébastien Hinderer, review by David Allsopp, Xavier Leroy and
Damien Doligez)
- #1852: merge runtime directories
(Sébastien Hinderer, review by Xavier Leroy and Damien Doligez)
- #1854: remove the no longer defined BYTECCCOMPOPTS build variable.
(Sébastien Hinderer, review by Damien Doligez)
- #2024: stop supporting obsolete platforms: Rhapsody (old beta
version of MacOS X, BeOS, alpha*-*-linux*, mips-*-irix6*,
alpha*-*-unicos, powerpc-*-aix, *-*-solaris2*, mips*-*-irix[56]*,
i[3456]86-*-darwin[89].*, i[3456]86-*-solaris*, *-*-sunos* *-*-unicos.
(Sébastien Hinderer, review by Xavier Leroy, Damien Doligez, Gabriel
Scherer and Armaël Guéneau)
- #2053: allow unix, vmthreads and str not to be built.
(David Allsopp, review by Sébastien Hinderer)
* #2059: stop defining OCAML_STDLIB_DIR in s.h.
(Sébastien Hinderer, review by David Allsopp and Damien Doligez)
* #2066: remove the standard_runtime configuration variable.
(Sébastien Hinderer, review by Xavier Leroy, Stephen Dolan and
Damien Doligez)
* #2139: use autoconf to generate the compiler's configuration script
(Sébastien Hinderer, review by Damien Doligez and David Allsopp)
- #2148: fix a parallel build bug involving CamlinternalLazy.
(Stephen Dolan, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #2264, #7904: the configure script now sets the Unicode handling mode
under Windows according to the value of the variable WINDOWS_UNICODE_MODE. If
WINDOWS_UNICODE_MODE is "ansi" then it is assumed to be the current code page
encoding. If WINDOWS_UNICODE_MODE is "compatible" or empty or not set at all,
then encoding is UTF-8 with code page fallback.
(Nicolás Ojeda Bär, review by Sébastien Hinderer and David Allsopp)
- #2266: ensure Cygwin ports configure with `EXE=.exe`, or the compiler is
unable to find the camlheader files (subtle regression of #2139/2041)
(David Allsopp, report and review by Sébastien Hinderer)
- #7919, #2311: Fix assembler detection in configure
(Sébastien Hinderer, review by David Allsopp)
- #2295: Restore support for bytecode target XLC/AIX/Power
(Konstantin Romanov, review by Sébastien Hinderer and David Allsopp)
- #8528: get rid of the direct call to the C preprocessor in the testsuite
(Sébastien Hinderer, review by David Allsopp)
- #7938, #8532: Fix alignment detection for ints on 32-bits platforms
(Sébastien Hinderer, review by Xavier Leroy)
* #8533: Remove some unused configure tests
(Stephen Dolan, review by David Allsopp and Sébastien Hinderer)
- #2207, #8604: Add opam files to allow pinning
(Leo White, Greta Yorsh, review by Gabriel Radanne)
- #8616: configure: use variables rather than arguments for a few options
(Sébastien Hinderer, review by David Allsopp, Gabriel Scherer and
Damien Doligez)
- #8632: Correctly propagate flags for --with-pic in configure.
(David Allsopp, review by Sébastien Hinderer and Damien Doligez)
- #8673: restore SpaceTime and libunwind support in configure script
(Sébastien Hinderer, review by Damien Doligez)
### Internal/compiler-libs changes:
- #7918, #1703, #1944, #2213, #2257: Add the module
Compile_common, which factorizes the common part in Compile and
Optcompile. This also makes the pipeline more modular.
(Gabriel Radanne, help from Gabriel Scherer and Valentin
Gatien-Baron, review by Mark Shinwell and Gabriel Radanne,
regression spotted by Clément Franchini)
- #292: use Menhir as the parser generator for the OCaml parser.
Satellite GPRs: #1844, #1846, #1853, #1850, #1934, #2151,
#2174
(Gabriel Scherer, Nicolás Ojeda Bär, Frédéric Bour, Thomas Refis
and François Pottier,
review by Nicolás Ojeda Bär, Leo White and David Allsopp)
- #374: use Misc.try_finally for resource cleanup in the compiler
codebase. This should fix the problem of catch-and-reraise `try .. with`
blocks destroying backtrace information -- in the compiler.
(François Bobot, help from Gabriel Scherer and Nicolás Ojeda Bär,
review by Gabriel Scherer)
- #1148, #1287, #1288, #1874: significant improvements
of the tools/check-typo script used over the files of the whole repository;
contributors are now expected to check that check-typo passes on their
pull requests; see CONTRIBUTING.md for more details.
(David Allsopp, review by Damien Doligez and Sébastien Hinderer)
- #1610, #2252: Remove positions from paths
(Leo White, review by Frédéric Bour and Thomas Refis)
- #1745: do not generalize the type of every sub-pattern,
only of variables. (preliminary work for GADTs in or-patterns)
(Thomas Refis, review by Leo White)
- #1909: unsharing pattern types (preliminary work for GADTs in or-patterns)
(Thomas Refis, with help from Leo White, review by Jacques Garrigue)
- #1748: do not error when instantiating polymorphic fields in patterns.
(Thomas Refis, review by Gabriel Scherer)
- #2317: type_let: be more careful generalizing parts of the pattern
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1746: remove unreachable error variant: Make_seltype_nongen.
(Florian Angeletti, review by Gabriel Radanne)
- #1747: type_cases: always propagate (preliminary work
for GADTs in or-patterns)
(Thomas Refis, review by Jacques Garrigue)
- #1811: shadow the polymorphic comparison in the middle-end
(Xavier Clerc, review by Pierre Chambart)
- #1833: allow non-val payloads in CMM Ccatch handlers
(Simon Fowler, review by Xavier Clerc)
- #1866: document the release process
(Damien Doligez and Gabriel Scherer, review by Sébastien Hinderer,
Perry E. Metzger, Xavier Leroy and David Allsopp)
- #1886: move the Location.absname reference to Clflags.absname
(Armaël Guéneau, review by Jérémie Dimino)
- #1894: generalize highlight_dumb in location.ml to handle highlighting
several locations
(Armaël Guéneau, review by Gabriel Scherer)
- #1903: parsetree, add locations to all nodes with attributes
(Gabriel Scherer, review by Thomas Refis)
- #1905: add check-typo-since to check the files changed
since a given git reference
(Gabriel Scherer, review by David Allsopp)
- #1910: improve the check-typo use of .gitattributes
(Gabriel Scherer, review by David Allsopp and Damien Doligez)
- #1938: always check ast invariants after preprocessing
(Florian Angeletti, review by Alain Frisch and Gabriel Scherer)
- #1941: refactor the command line parsing of ocamlcp and ocamloptp
(Valentin Gatien-Baron, review by Florian Angeletti)
- #1948: Refactor Stdlib.Format. Notably, use Stdlib.Stack and Stdlib.Queue,
and avoid exceptions for control flow.
(Vladimir Keleshev, review by Nicolás Ojeda Bär and Gabriel Scherer)
* #1952: refactor the code responsible for displaying errors and warnings
`Location.report_error` is removed, use `Location.print_report` instead
(Armaël Guéneau, review by Thomas Refis)
- #7835, #1980, #8548, #8586: separate scope from stamp in idents and explicitly
rescope idents when substituting signatures.
(Thomas Refis, review by Jacques Garrigue and Leo White)
- #1996: expose Pprintast.longident to help compiler-libs users print
Longident.t values.
(Gabriel Scherer, review by Florian Angeletti and Thomas Refis)
- #2030: makefile targets to build AST files of sources
for parser testing. See parsing/HACKING.adoc.
(Gabriel Scherer, review by Nicolás Ojeda Bär)
* #2041: add a cache for looking up files in the load path
(Jérémie Dimino, review by Alain Frisch and David Allsopp)
- #2047, #2269: a new type for unification traces
(Florian Angeletti, report by Leo White (#2269),
review by Thomas Refis and Gabriel Scherer)
- #2055: Add [Linearize.Lprologue].
(Mark Shinwell, review by Pierre Chambart)
- #2056: Use [Backend_var] rather than [Ident] from [Clambda] onwards;
use [Backend_var.With_provenance] for variables in binding position.
(Mark Shinwell, review by Pierre Chambart)
- #2060: "Phantom let" support for the Clambda language.
(Mark Shinwell, review by Vincent Laviron)
- #2065: Add [Proc.destroyed_at_reloadretaddr].
(Mark Shinwell, review by Damien Doligez)
- #2070: "Phantom let" support for the Cmm language.
(Mark Shinwell, review by Vincent Laviron)
- #2072: Always associate a scope to a type
(Thomas Refis, review by Jacques Garrigue and Leo White)
- #2074: Correct naming of record field inside [Ialloc] terms.
(Mark Shinwell, review by Jérémie Dimino)
- #2076: Add [Targetint.print].
(Mark Shinwell)
- #2080: Add [Proc.dwarf_register_numbers] and
[Proc.stack_ptr_dwarf_register_number].
(Mark Shinwell, review by Bernhard Schommer)
- #2088: Add [Clambda.usymbol_provenance].
(Mark Shinwell, review by Damien Doligez)
- #2152, #2517: refactorize the fixpoint to compute type-system
properties of mutually-recursive type declarations.
(Gabriel Scherer and Rodolphe Lepigre, review by Armaël Guéneau)
- #2156: propagate more type information through Lambda and Clambda
intermediate language, as a preparation step for more future optimizations
(Pierre Chambart and Alain Frisch, cross-reviewed by themselves)
- #2160: restore --disable-shared support and ensure testsuite runs correctly
when compiled without shared library support.
(David Allsopp, review by Damien Doligez and Sébastien Hinderer)
* #2173: removed TypedtreeMap
(Thomas Refis, review by Gabriel Scherer)
- #7867: Fix #mod_use raising an exception for filenames with no
extension.
(Geoff Gole)
- #2100: Fix Unix.getaddrinfo when called on strings containing
null bytes; it would crash the GC later on.
(Armaël Guéneau, report and fix by Joe, review by Sébastien Hinderer)
- #7847, #2019: Fix an infinite loop that could occur when the
(Menhir-generated) parser encountered a syntax error in a certain
specific state.
(François Pottier, report by Stefan Muenzel,
review by Frédéric Bour, Thomas Refis, Gabriel Scherer)
- #1626: Do not allow recursive modules in `with module`
(Leo White, review by Gabriel Radanne)
- #7726, #1676: Recursive modules, equi-recursive types and stack overflow
(Jacques Garrigue, report by Jeremy Yallop, review by Leo White)
- #7723, #1698: Ensure `with module` and `with type` do not weaken
module aliases.
(Leo White, review by Gabriel Radanne and Jacques Garrigue)
- #1719: fix Pervasives.LargeFile functions under Windows.
(Alain Frisch)
- #1739: ensure ocamltest waits for child processes to terminate on Windows.
(David Allsopp, review by Sébastien Hinderer)
- #7554, #1751: Lambda.subst: also update debug event environments
(Thomas Refis, review by Gabriel Scherer)
- #7238, #1825: in Unix.in_channel_of_descr and Unix.out_channel_of_descr,
raise an error if the given file description is not suitable for
character-oriented I/O, for example if it is a block device or a
datagram socket.
(Xavier Leroy, review by Jérémie Dimino and Perry E. Metzger)
- #7799, #1820: fix bug where Scanf.format_from_string could fail when
the argument string contained characters that require escaping.
(Gabriel Scherer and Nicolás Ojeda Bär, report by Guillaume Melquiond, review
by Gabriel Scherer)
- #1843: ocamloptp was doing the wrong thing with option -inline-max-unroll.
(Github user @poechsel, review by Nicolás Ojeda Bär).
- #1890: remove last use of Ctype.unroll_abbrev
(Thomas Refis, report by Leo White, review by Jacques Garrigue)
- #1893: dev-branch only, warning 40(name not in scope) triggered spurious
warnings 49(missing cmi) with -no-alias-deps.
(Florian Angeletti, report by Valentin Gatien-Baron,
review by Gabriel Scherer)
- #1912: Allow quoted strings, octal/unicode escape sequences and identifiers
containing apostrophes in ocamllex actions and comments.
(Pieter Goetschalckx, review by Damien Doligez)
- #7828, #1935: correct the conditions that generate warning 61,
Unboxable_type_in_prim_decl
(Stefan Muenzel)
- #1958: allow [module M(_:S) = struct end] syntax
(Hugo Heuzard, review by Gabriel Scherer)
- #1970: fix order of floatting documentation comments in classes
(Hugo Heuzard, review by Nicolás Ojeda Bär)
- #1977: [@@ocaml.warning "..."] attributes attached to type declarations are
no longer ignored.
(Nicolás Ojeda Bär, review by Gabriel Scherer)
- #7830, #1987: fix ocamldebug crash when printing a value in the scope of
an `open` statement for which the `.cmi` is not available.
(Nicolás Ojeda Bär, report by Jocelyn Sérot, review by Gabriel Scherer)
- #7854, #2062: fix an issue where the wrong locale may be used when using
the legacy ANSI encoding under Windows.
(Nicolás Ojeda Bär, report by Tiphaine Turpin)
- #2083: Fix excessively aggressive float unboxing and introduce similar fix
as a preventative measure for boxed int unboxing.
(Thomas Refis, Mark Shinwell, Leo White)
- #2130: fix printing of type variables with a quote in their name
(Alain Frisch, review by Armaël Guéneau and Gabriel Scherer,
report by Hugo Heuzard)
- #2131: fix wrong calls to Env.normalize_path on non-module paths
(Alain Frisch, review by Jacques Garrigue)
- #2175: Apply substitution to all modules when packing
(Leo White, review by Gabriel Scherer)
- #2220: Remove duplicate process management code in
otherlibs/threads/unix.ml
(Romain Beauxis, review by Gabriel Scherer and Alain Frisch)
- #2231: Env: always freshen persistent signatures before using them
(Thomas Refis and Leo White, review by Gabriel Radanne)
- #7851, #8570: Module type of allows to transform a malformed
module type into a vicious signature, breaking soundness
(Jacques Garrigue, review by Leo White)
- #7923, #2259: fix regression in FlexDLL bootstrapped build caused by
refactoring the root Makefile for Dune in #2093)
(David Allsopp, report by Marc Lasson)
- #7929, #2261: Subst.signature: call cleanup_types exactly once
(Thomas Refis, review by Gabriel Scherer and Jacques Garrigue,
report by Daniel Bünzli and Jon Ludlam)
- #8550, #8552: Soundness issue with class generalization
(Jacques Garrigue, review by Leo White and Thomas Refis,
report by Jeremy Yallop)
OCaml 4.07.1 (4 October 2018)
-----------------------------
### Bug fixes:
- #7815, #1896: major GC crash with first-fit policy
(Stephen Dolan and Damien Doligez, report by Joris Giovannangeli)
* #7818, #2051: Remove local aliases in functor argument types,
to prevent the aliasing of their target.
(Jacques Garrigue, report by mandrykin, review by Leo White)
- #7820, #1897: Fix Array.of_seq. This function used to apply a circular
permutation of one cell to the right on the sequence.
(Thierry Martinez, review by Nicolás Ojeda Bär)
- #7821, #1908: make sure that the compilation of extension
constructors doesn't cause the compiler to load more cmi files
(Jérémie Dimino, review by Gabriel Scherer)
- #7824, #1914: subtype_row: filter out absent fields when row is closed
(Leo White and Thomas Refis, report by talex, review by Jacques Garrigue)
- #1915: rec_check.ml is too permissive for certain class declarations.
(Alban Reynaud with Gabriel Scherer, review by Jeremy Yallop)
- #7833, #1946: typecore: only 1k existential per match, not 100k
(Thomas Refis, report by Jerome Simeon, review by Jacques Garrigue)
- #7838: -principal causes assertion failure in type checker
(Jacques Garrigue, report by Markus Mottl, review by Thomas Refis)
OCaml 4.07.0 (10 July 2018)
---------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #6023, #1648: Allow type-based selection of GADT constructors.
(Thomas Refis and Leo White, review by Jacques Garrigue and Gabriel Scherer)
- #1546: Allow empty variants.
(Runhang Li, review by Gabriel Radanne and Jacques Garrigue)
### Standard library:
- #4170, #1674: add the constant `Float.pi`.
(Christophe Troestler, review by Damien Doligez)
- #6139, #1685: Move the Bigarray module to the standard library. Keep the
bigarray library as on overlay adding the deprecated map_file functions.
(Jérémie Dimino, review by Mark Shinwell)
- #7528, #1500: add a Format.pp_set_geometry function to avoid memory
effects in set_margin and set_max_indent.
(Florian Angeletti, review by Richard Bonichon, Gabriel Radanne,
Gabriel Scherer and Pierre Weis)
- #7690, #1528: fix the float_of_string function for hexadecimal floats
with very large values of the exponent.
(Olivier Andrieu)
- #1002: add a new `Seq` module defining a list-of-thunks style iterator.
Also add `{to,of}_seq` to several standard modules.
(Simon Cruanes, review by Alain Frisch and François Bobot)
* #1010: pack all standard library modules into a single module Stdlib
which is the default opened module (Stdlib itself includes Pervasives) to free
up the global namespace for other standard libraries, while still allowing any
OCaml standard library module to be referred to as Stdlib.Module). This is
implemented efficiently using module aliases (prefixing all modules with
Stdlib__, e.g. Stdlib__string).
(Jérémie Dimino, David Allsopp and Florian Angeletti, review by David Allsopp
and Gabriel Radanne)
- #1637: String.escaped is faster and does not allocate when called with a
string that does not contain any characters needing to be escaped.
(Alain Frisch, review by Xavier Leroy and Gabriel Scherer)
- #1638: add a Float module.
(Nicolás Ojeda Bär, review by Alain Frisch and Jeremy Yallop)
- #1697: Tune [List.init] tailrec threshold so that it does not stack
overflow when compiled with the Js_of_ocaml backend.
(Hugo Heuzard, reviewed by Gabriel Scherer)
### Other libraries:
- #7745, #1629: Graphics.open_graph displays the correct window title on
Windows again (fault introduced by 4.06 Unicode changes).
(David Allsopp)
* #1406: Unix.isatty now returns true in the native Windows ports when
passed a file descriptor connected to a Cygwin PTY. In particular, compiler
colors for the native Windows ports now work under Cygwin/MSYS2.
(Nicolás Ojeda Bär, review by Gabriel Scherer, David Allsopp, Xavier Leroy)
- #1451: [getpwuid], [getgrgid], [getpwnam], [getgrnam] now raise Unix error
instead of returning [Not_found] when interrupted by a signal.
(Arseniy Alekseyev, review by Mark Shinwell and Xavier Leroy)
- #1477: raw_spacetime_lib can now be used in bytecode.
(Nicolás Ojeda Bär, review by Mark Shinwell)
- #1533: (a) The implementation of Thread.yield for system thread
now uses nanosleep(1) for enabling better preemption.
(b) Thread.delay is now an alias for Unix.sleepf.
(Jacques-Henri Jourdan, review by Xavier Leroy and David Allsopp)
### Compiler user-interface and warnings:
- #7663, #1694: print the whole cycle and add a reference to the manual in
the unsafe recursive module evaluation error message.
(Florian Angeletti, report by Matej Košík, review by Gabriel Scherer)
- #1166: In OCAMLPARAM, an alternative separator can be specified as
first character (instead of comma) in the set ":|; ,"
(Fabrice Le Fessant)
- #1358: Fix usage warnings with no mli file.
(Leo White, review by Alain Frisch)
- #1428: give a non dummy location for warning 49 (no cmi found).
(Valentin Gatien-Baron)
- #1491: Improve error reporting for ill-typed applicative functor
types, F(M).t.
(Valentin Gatien-Baron, review by Florian Angeletti and Gabriel Radanne)
- #1496: Refactor the code printing explanation for unification type errors,
in order to avoid duplicating pattern matches.
(Armaël Guéneau, review by Florian Angeletti and Gabriel Scherer)
- #1505: Add specific error messages for unification errors involving
functions of type "unit -> _".
(Arthur Charguéraud and Armaël Guéneau, with help from Leo White, review by
Florian Angeletti and Gabriel Radanne)
- #1510: Add specific explanation for unification errors caused by type
constraints propagated by keywords (such as if, while, for...).
(Armaël Guéneau and Gabriel Scherer, original design by Arthur Charguéraud,
review by Frédéric Bour, Gabriel Radanne and Alain Frisch)
- #1515: honor the BUILD_PATH_PREFIX_MAP environment variable
to enable reproducible builds.
(Gabriel Scherer, with help from Ximin Luo, review by Damien Doligez)
- #1534: Extend the warning printed when (*) is used, adding a hint to
suggest using ( * ) instead.
(Armaël Guéneau, with help and review from Florian Angeletti and Gabriel
Scherer)
- #1552, #1577: do not warn about ambiguous variables in guards
(warning 57) when the ambiguous values have been filtered by
a previous clause.
(Gabriel Scherer and Thomas Refis, review by Luc Maranget)
- #1554: warnings 52 and 57: fix reference to manual detailed explanation.
(Florian Angeletti, review by Thomas Refis and Gabriel Scherer)
- #1618: add the -dno-unique-ids and -dunique-ids compiler flags.
(Sébastien Hinderer, review by Leo White and Damien Doligez)
- #1649: change compilation order of toplevel definitions, so that some
warnings emitted by the bytecode compiler appear more in-order than before.
(Luc Maranget, advice and review by Damien Doligez)
- #1806: add linscan to OCAMLPARAM options.
(Raja Boujbel)
### Code generation and optimizations:
- #7630, #1401: Faster compilation of large modules with Flambda.
(Pierre Chambart, report by Emilio Jesús Gallego Arias,
Pierre-Marie Pédrot and Paul Steckler, review by Gabriel Scherer
and Leo White)
- #7630, #1455: Disable CSE for the initialization function.
(Pierre Chambart, report by Emilio Jesús Gallego Arias,
review by Gabriel Scherer and Xavier Leroy)
- #1370: Fix code duplication in Cmmgen.
(Vincent Laviron, with help from Pierre Chambart,
reviews by Gabriel Scherer and Luc Maranget)
- #1486: ARM 32-bit port: add support for ARMv8 in 32-bit mode,
a.k.a. AArch32.
For this platform, avoid ITE conditional instruction blocks and use
simpler IT blocks instead.
(Xavier Leroy, review by Mark Shinwell)
- #1487: Treat negated float comparisons more directly.
(Leo White, review by Xavier Leroy)
- #1573: emitcode: merge events after instructions reordering.
(Thomas Refis and Leo White, with help from David Allsopp, review by Frédéric
Bour)
- #1606: Simplify the semantics of Lambda.free_variables and Lambda.subst,
including some API changes in bytecomp/lambda.mli.
(Pierre Chambart, review by Gabriel Scherer)
- #1613: ensure that set-of-closures are processed first so that other
entries in the let-rec symbol do not get dummy approximations.
(Leo White and Xavier Clerc, review by Pierre Chambart)
* #1617: Make string/bytes distinguishable in the bytecode.
(Hugo Heuzard, reviewed by Nicolás Ojeda Bär)
- #1627: Reduce cmx sizes by sharing variable names (Flambda only).
(Fu Yong Quah, Leo White, review by Xavier Clerc)
- #1665: reduce the size of cmx files in classic mode by dropping the
bodies of functions that will not be inlined.
(Fu Yong Quah, review by Leo White and Pierre Chambart)
- #1666: reduce the size of cmx files in classic mode by dropping the
bodies of functions that cannot be reached from the module block.
(Fu Yong Quah, review by Leo White and Pierre Chambart)
- #1686: Turn off by default flambda invariants checks.
(Pierre Chambart)
- #1707: Add [Closure_origin.t] to trace inlined functions to prevent
infinite loops from repeatedly inlining copies of the same function.
(Fu Yong Quah)
- #1740: make sure startup.o is always linked in when using
"-output-complete-obj". Previously, it was always linked in only on some
platforms, making this option unusable on platforms where it wasn't.
(Jérémie Dimino, review by Sébastien Hinderer and Xavier Leroy)
### Runtime system:
- #515 #676 #7173: Add a public C API for weak arrays and
ephemerons. Update the documentation for a 4.03 change: finalisation
functions are now run before the erasure of the corresponding
values.
(François Bobot and Jacques-Henri Jourdan, review by Mark Shinwell,
Damien Doligez and Frédéric Bour)
- #6411, #1535: don't compile everything with -static-libgcc on mingw32,
only dllbigarray.dll and libbigarray.a. Allows the use of C++ libraries which
raise exceptions.
(David Allsopp)
- #7100, #1476: trigger a minor GC when custom blocks accumulate
in minor heap.
(Alain Frisch, report by talex, review by Damien Doligez, Leo White,
Gabriel Scherer)
- #1431: remove ocamlrun dependencies on curses/terminfo/termcap C library.
(Xavier Leroy, review by Daniel Bünzli)
- #1478: The Spacetime profiler now works under Windows (but it is not yet
able to collect profiling information from C stubs).
(Nicolás Ojeda Bär, review by Xavier Leroy, Mark Shinwell)
- #1483: fix GC freelist accounting for chunks larger than the maximum block
size.
(David Allsopp and Damien Doligez)
- #1526: install the debug and instrumented runtimes
(lib{caml,asm}run{d,i}.a).
(Gabriel Scherer, reminded by Julia Lawall)
- #1563: simplify implementation of LSRINT and ASRINT.
(Max Mouratov, review by Frédéric Bour)
- #1644: remove caml_alloc_float_array from the bytecode primitives list
(it's a native code primitive).
(David Allsopp)
- #1701: fix missing root bug in #1476.
(Mark Shinwell)
- #1752: do not alias function arguments to sigprocmask.
(Anil Madhavapeddy)
- #1753: avoid potential off-by-one overflow in debugger socket path length.
(Anil Madhavapeddy)
### Tools:
- #7643, #1377: ocamldep, fix an exponential blowup in presence of nested
structures and signatures, e.g. "include struct … include(struct … end) … end"
(Florian Angeletti, review by Gabriel Scherer, report by Christophe Raffalli)
- #7687, #1653: deprecate -thread option,
which is equivalent to -I +threads.
(Nicolás Ojeda Bär, report by Daniel Bünzli)
- #7710: `ocamldep -sort` should exit with nonzero code in case of
cyclic dependencies.
(Xavier Leroy, report by Mantis user baileyparker)
- #1537: boot/ocamldep is no longer included in the source distribution;
boot/ocamlc -depend can be used in its place.
(Nicolás Ojeda Bär, review by Xavier Leroy and Damien Doligez)
- #1585: optimize output of "ocamllex -ml".
(Alain Frisch, review by Frédéric Bour and Gabriel Scherer)
- #1667: add command-line options -no-prompt, -no-version, -no-time,
-no-breakpoint-message and -topdirs-path to ocamldebug.
(Sébastien Hinderer, review by Damien Doligez)
- #1695: add the -null-crc command-line option to ocamlobjinfo.
(Sébastien Hinderer, review by David Allsopp and Gabriel Scherer)
- #1710: ocamldoc, improve the 'man' rendering of subscripts and
superscripts.
(Gabriel Scherer)
- #1771: ocamldebug, avoid out of bound access.
(Thomas Refis)
### Manual and documentation:
- #7613: minor rewording of the "refutation cases" paragraph.
(Florian Angeletti, review by Jacques Garrigue)
- #7647, #1384: emphasize ocaml.org website and forum in README.
(Yawar Amin, review by Gabriel Scherer)
- #7698, #1545: improve wording in OCaml manual in several places,
mostly in Chapter 1. This addresses the easier changes suggested in the PR.
(Jim Fehrle, review by Florian Angeletti and David Allsopp)
- #1540: manual, decouple verbatim and toplevel style in code examples.
(Florian Angeletti, review by Gabriel Scherer)
- #1556: manual, add a consistency test for manual references inside
the compiler source code.
(Florian Angeletti, review by Gabriel Scherer)
- #1647: manual, subsection on record and variant disambiguation.
(Florian Angeletti, review by Alain Frisch and Gabriel Scherer)
- #1702: manual, add a signature mode for code examples.
(Florian Angeletti, review by Gabriel Scherer)
- #1741: manual, improve typesetting and legibility in HTML output.
(steinuil, review by Gabriel Scherer)
- #1757: style the html manual, changing type and layout.
(Charles Chamberlain, review by Florian Angeletti, Xavier Leroy,
Gabriel Radanne, Perry E. Metzger, and Gabriel Scherer)
- #1765: manual, ellipsis in code examples.
(Florian Angeletti, review and suggestion by Gabriel Scherer)
- #1767: change html manual to use relative font sizes.
(Charles Chamberlain, review by Daniel Bünzli, Perry E. Metzger,
Josh Berdine, and Gabriel Scherer)
- #1779: integrate the Bigarray documentation into the main manual.
(Perry E. Metzger, review by Florian Angeletti and Xavier Clerc)
### Type system:
- #7611, #1491: reject the use of generative functors as applicative.
(Valentin Gatien-Baron)
- #7706, #1565: in recursive value declarations, track
static size of locally-defined variables.
(Gabriel Scherer, review by Jeremy Yallop and Leo White, report by Leo White)
- #7717, #1593: in recursive value declarations, don't treat
unboxed constructor size as statically known.
(Jeremy Yallop, report by Pierre Chambart, review by Gabriel Scherer)
- #7767, #1712: restore legacy treatment of partially-applied
labeled functions in 'let rec' bindings.
(Jeremy Yallop, report by Ivan Gotovchits, review by Gabriel Scherer)
* #7787, #1652, #1743: Don't remove module aliases in `module type of`
and `with module`.
The old behaviour can be obtained using the `[@remove_aliases]` attribute.
(Leo White and Thomas Refis, review by Jacques Garrigue)
- #1468: Do not enrich type_decls with incoherent manifests.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1469: Use the information from [@@immediate] annotations when
computing whether a type can be [@@unboxed].
(Damien Doligez, report by Stephan Muenzel, review by Alain Frisch)
- #1513: Allow compilation units to shadow sub-modules of Pervasives.
For instance users can now use a largeFile.ml file in their project.
(Jérémie Dimino, review by Nicolás Ojeda Bär, Alain Frisch and Gabriel
Radanne)
- #1516: Allow float array construction in recursive bindings
when configured with -no-flat-float-array.
(Jeremy Yallop, report by Gabriel Scherer)
- #1583: propagate refined ty_arg to Parmatch checks.
(Thomas Refis, review by Jacques Garrigue)
- #1609: Changes to ambivalence scope tracking.
(Thomas Refis and Leo White, review by Jacques Garrigue)
- #1628: Treat reraise and raise_notrace as nonexpansive.
(Leo White, review by Alain Frisch)
* #1778: Fix Soundness bug with non-generalized type variable and
local modules. This is the same bug as #7414, but using local
modules instead of non-local ones.
(Leo White, review by Jacques Garrigue)
### Compiler distribution build system:
- #5219, #1680, #1877: use 'install' instead of 'cp'
in install scripts.
(Gabriel Scherer, review by Sébastien Hinderer and Valentin Gatien-Baron)
- #7679: make sure .a files are erased before calling ar rc, otherwise
leftover .a files from an earlier compilation may contain unwanted modules.
(Xavier Leroy)
- #1571: do not perform architecture tests on 32-bit platforms, allowing
64-bit back-ends to use 64-bit specific constructs.
(Xavier Clerc, review by Damien Doligez)
### Internal/compiler-libs changes:
- #7738, #1624: Asmlink.reset also resets lib_ccobjs/ccopts.
(Cedric Cellier, review by Gabriel Scherer)
- #1488, #1560: Refreshing parmatch.
(Gabriel Scherer and Thomas Refis, review by Luc Maranget)
- #1502: more command line options for expect tests.
(Florian Angeletti, review by Gabriel Scherer)
- #1511: show code at error location in expect-style tests,
using new Location.show_code_at_location function.
(Gabriel Scherer and Armaël Guéneau,
review by Valentin Gatien-Baron and Damien Doligez)
- #1519, #1532, #1570: migrate tests to ocamltest.
(Sébastien Hinderer, review by Gabriel Scherer, Valentin Gatien-Baron
and Nicolás Ojeda Bär)
- #1520: more robust implementation of Misc.no_overflow_mul.
(Max Mouratov, review by Xavier Leroy)
- #1557: Organise and simplify translation of primitives.
(Leo White, review by François Bobot and Nicolás Ojeda Bär)
- #1567: register all idents relevant for reraise.
(Thomas Refis, review by Alain Frisch and Frédéric Bour)
- #1586: testsuite: 'make promote' for ocamltest tests.
(The new "-promote" option for ocamltest is experimental
and subject to change/removal).
(Gabriel Scherer)
- #1619: expect_test: print all the exceptions, even the unexpected ones.
(Thomas Refis, review by Jérémie Dimino)
- #1621: expect_test: make sure to not use the installed stdlib.
(Jérémie Dimino, review by Thomas Refis)
- #1646: add ocamldoc test to ocamltest and
migrate ocamldoc tests to ocamltest.
(Florian Angeletti, review by Sébastien Hinderer)
- #1663: refactor flambda specialise/inlining handling.
(Leo White and Xavier Clerc, review by Pierre Chambart)
- #1679: remove Pbittest from primitives in lambda.
(Hugo Heuzard, review by Mark Shinwell)
* #1704: Make Ident.t abstract and immutable.
(Gabriel Radanne, review by Mark Shinwell)
- #1699: Clean up Maps and Sets throughout the compiler.
Remove the Tbl module in favor of dedicated Maps.
(Gabriel Radanne, review by Mark Shinwell)
### Bug fixes:
- #4499, #1479: Use native Windows API to implement Sys.getenv,
Unix.getenv and Unix.environment under Windows.
(Nicolás Ojeda Bär, report by Alain Frisch, review by David Allsopp, Xavier
Leroy)
- #5250, #1435: on Cygwin, when ocamlrun searches the path
for a bytecode executable file, skip directories and other
non-regular files, like other Unix variants do.
(Xavier Leroy)
- #6394, #1425: fix fatal_error from Parmatch.get_type_path.
(Virgile Prevosto, review by David Allsopp, Thomas Refis and Jacques Garrigue)
* #6604, #931: Only allow directives with filename and at the beginning of
the line.
(Tadeu Zagallo, report by Roberto Di Cosmo,
review by Hongbo Zhang, David Allsopp, Gabriel Scherer, Xavier Leroy)
- #7138, #7701, #1693: Keep documentation comments
even in empty structures and signatures.
(Leo White, Florian Angeletti, report by Anton Bachin)
- #7178, #7253, #7796, #1790: Make sure a function
registered with "at_exit" is executed only once when the program exits.
(Nicolás Ojeda Bär and Xavier Leroy, review by Max Mouratov)
- #7391, #1620: Do not put a dummy method in object types.
(Thomas Refis, review by Jacques Garrigue)
- #7660, #1445: Use native Windows API to implement Unix.utimes in order to
avoid unintended shifts of the argument timestamp depending on DST setting.
(Nicolás Ojeda Bär, review by David Allsopp, Xavier Leroy)
- #7668: -principal is broken with polymorphic variants.
(Jacques Garrigue, report by Jun Furuse)
- #7680, #1497: Incorrect interaction between Matching.for_let and
Simplif.simplify_exits.
(Alain Frisch, report and review by Vincent Laviron)
- #7682, #1495: fix [@@unboxed] for records with 1 polymorphic field.
(Alain Frisch, report by Stéphane Graham-Lengrand, review by Gabriel Scherer)
- #7695, #1541: Fatal error: exception Ctype.Unify(_) with field override
(Jacques Garrigue, report by Nicolás Ojeda Bär)
- #7704, #1564: use proper variant tag in non-exhaustiveness warning.
(Jacques Garrigue, report by Thomas Refis)
- #7711, #1581: Internal typechecker error triggered by a constraint on
self type in a class type.
(Jacques Garrigue, report and review by Florian Angeletti)
- #7712, #1576: assertion failure with type abbreviations.
(Thomas Refis, report by Michael O'Connor, review by Jacques Garrigue)
- #7747: Type checker can loop infinitely and consume all computer memory.
(Jacques Garrigue, report by kantian)
- #7751, #1657: The toplevel prints some concrete types as abstract.
(Jacques Garrigue, report by Matej Košík)
- #7765, #1718: When unmarshaling bigarrays, protect against integer
overflows in size computations.
(Xavier Leroy, report by Maximilian Tschirschnitz,
review by Gabriel Scherer)
- #7760, #1713: Exact selection of lexing engine, that is
correct "Segfault in ocamllex-generated code using 'shortest'".
(Luc Maranget, Frédéric Bour, report by Stephen Dolan,
review by Gabriel Scherer)
- #7769, #1714: calls to Stream.junk could, under some conditions, be
ignored when used on streams based on input channels.
(Nicolás Ojeda Bär, report by Michael Perin, review by Gabriel Scherer)
- #7793, #1766: the toplevel #use directive now accepts sequences of ';;'
tokens. This fixes a bug in which certain files accepted by the compiler were
rejected by ocamldep.
(Nicolás Ojeda Bär, report by Hugo Heuzard, review by Hugo Heuzard)
- #1517: More robust handling of type variables in mcomp.
(Leo White and Thomas Refis, review by Jacques Garrigue)
- #1530, #1574: testsuite, fix 'make parallel' and 'make one DIR=...'
to work on ocamltest-based tests.
(Runhang Li and Sébastien Hinderer, review by Gabriel Scherer)
- #1550, #1555: Make pattern matching warnings more robust
to ill-typed columns.
(Thomas Refis, with help from Gabriel Scherer and Luc Maranget)
- #1614: consider all bound variables when inlining, fixing a compiler
fatal error.
(Xavier Clerc, review by Pierre Chambart, Leo White)
- #1622: fix bug in the expansion of command-line arguments under Windows
which could result in some elements of Sys.argv being truncated in some cases.
(Nicolás Ojeda Bär, review by Sébastien Hinderer)
- #1623: Segfault on Windows 64 bits when expanding wildcards in arguments.
(Marc Lasson, review by David Allsopp, Alain Frisch, Sébastien Hinderer,
Xavier Leroy, Nicolás Ojeda Bär)
- #1661: more precise principality warning regarding record fields
disambiguation.
(Thomas Refis, review by Leo White)
- #1687: fix bug in the printing of short functor types "(S1 -> S2) -> S3".
(Pieter Goetschalckx, review by Gabriel Scherer)
- #1722: Scrape types in Typeopt.maybe_pointer.
(Leo White, review by Thomas Refis)
- #1755: ensure that a bigarray is never collected while reading complex
values.
(Xavier Clerc, Mark Shinwell and Leo White, report by Chris Hardin,
reviews by Stephen Dolan and Xavier Leroy)
- #1764: in byterun/memory.c, struct pool_block, use C99 flexible arrays
if available.
(Xavier Leroy, review by Max Mouratov)
- #1774: ocamlopt for ARM could generate VFP loads and stores with bad
offsets, rejected by the assembler.
(Xavier Leroy, review by Mark Shinwell)
- #1808: handle `[@inlined]` attributes under a module constraint.
(Xavier Clerc, review by Leo White)
- #1810: use bit-pattern comparison when meeting float approximations.
(Xavier Clerc, report by Christophe Troestler, review by Nicolás Ojeda Bär
and Gabriel Scherer)
- #1835: Fix off-by-one errors in Weak.get_copy and Weak.blit.
(KC Sivaramakrishnan)
- #1849: bug in runtime function generic_final_minor_update()
that could lead to crashes when Gc.finalise_last is used.
(report and fix by Yuriy Vostrikov, review by François Bobot)
OCaml 4.06.1 (16 Feb 2018):
---------------------------
### Bug fixes:
- #7661, #1459: fix faulty compilation of patterns
using extensible variants constructors
(Luc Maranget, review by Thomas Refis and Gabriel Scherer, report
by Abdelraouf Ouadjaout and Thibault Suzanne)
- #7702, #1553: refresh raise counts when inlining a function
(Vincent Laviron, Xavier Clerc, report by Cheng Sun)
- #7704, #1559: Soundness issue with private rows and pattern-matching
(Jacques Garrigue, report by Jeremy Yallop, review by Thomas Refis)
- #7705, #1558: add missing bounds check in Bigarray.Genarray.nth_dim.
(Nicolás Ojeda Bär, report by Jeremy Yallop, review by Gabriel Scherer)
- #7713, #1587: Make pattern matching warnings more robust
to ill-typed columns; this is a backport of #1550 from 4.07+dev
(Thomas Refis, review by Gabriel Scherer, report by Andreas Hauptmann)
- #1470: Don't commute negation with float comparison
(Leo White, review by Xavier Leroy)
- #1538: Make pattern matching compilation more robust to ill-typed columns
(Gabriel Scherer and Thomas Refis, review by Luc Maranget)
OCaml 4.06.0 (3 Nov 2017):
--------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #6271, #7529, #1249: Support "let open M in ..."
in class expressions and class type expressions.
(Alain Frisch, reviews by Thomas Refis and Jacques Garrigue)
- #792: fix limitations of destructive substitutions, by
allowing "S with type t := type-expr",
"S with type M.t := type-expr", "S with module M.N := path"
(Valentin Gatien-Baron, review by Jacques Garrigue and Leo White)
* #1064, #1392: extended indexing operators, add a new class of
user-defined indexing operators, obtained by adding at least
one operator character after the dot symbol to the standard indexing
operators: e,g ".%()", ".?[]", ".@{}<-":
let ( .%() ) = List.nth in [0; 1; 2].%(1)
After this change, functions or methods with an explicit polymorphic type
annotation and of which the first argument is optional now requires a space
between the dot and the question mark,
e.g. "<f:'a.?opt:int->unit>" must now be written "<f:'a. ?opt:int->unit>".
(Florian Angeletti, review by Damien Doligez and Gabriel Radanne)
- #1118: Support inherited field in object type expression
type t = < m : int >
type u = < n : int; t; k : int >
(Runhang Li, review by Jeremy Yallop, Leo White, Jacques Garrigue,
and Florian Angeletti)
* #1232: Support Unicode character escape sequences in string
literals via the \u{X+} syntax. These escapes are substituted by the
UTF-8 encoding of the Unicode character.
(Daniel Bünzli, review by Damien Doligez, Alain Frisch, Xavier
Leroy and Leo White)
- #1247: M.(::) construction for expressions
and patterns (plus fix printing of (::) in the toplevel)
(Florian Angeletti, review by Alain Frisch, Gabriel Scherer)
* #1252: The default mode is now safe-string, can be overridden
at configure time or at compile time.
(See #1386 below for the configure-time options)
This breaks the code that uses the 'string' type as mutable
strings (instead of Bytes.t, introduced by 4.02 in 2014).
(Damien Doligez)
* #1253: Private extensible variants
This change breaks code relying on the undocumented ability to export
extension constructors for abstract type in signature. Briefly,
module type S = sig
type t
type t += A
end
must now be written
module type S = sig
type t = private ..
type t += A
end
(Leo White, review by Alain Frisch)
- #1333: turn off warning 40 by default
(Constructor or label name used out of scope)
(Leo White)
- #1348: accept anonymous type parameters in `with` constraints:
S with type _ t = int
(Valentin Gatien-Baron, report by Jeremy Yallop)
### Type system
- #2642, #1225: unique names for weak type variables
# ref [];;
- : '_weak1 list ref = {contents = []}
(Florian Angeletti, review by Frédéric Bour, Jacques Garrigue,
Gabriel Radanne and Gabriel Scherer)
* #6738, #7215, #7231, #556: Add a new check that 'let rec'
bindings are well formed.
(Jeremy Yallop, reviews by Stephen Dolan, Gabriel Scherer, Leo
White, and Damien Doligez)
- #1142: Mark assertions nonexpansive, so that 'assert false'
can be used as a placeholder for a polymorphic function.
(Stephen Dolan)
### Standard library:
- #8223, #7309, #1026: Add update to maps. Allows to update a
binding in a map or create a new binding if the key had no binding
val update: key -> ('a option -> 'a option) -> 'a t -> 'a t
(Sébastien Briais, review by Daniel Bünzli, Alain Frisch and
Gabriel Scherer)
- #7515, #1147: Arg.align now optionally uses the tab character '\t' to
separate the "unaligned" and "aligned" parts of the documentation string. If
tab is not present, then space is used as a fallback. Allows to have spaces in
the unaligned part, which is useful for Tuple options.
(Nicolás Ojeda Bär, review by Alain Frisch and Gabriel Scherer)
* #615: Format, add symbolic formatters that output symbolic
pretty-printing items. New fields have been added to the
formatter_out_functions record, thus this change will break any code building
such record from scratch.
When building Format.formatter_out_functions values redefining the out_spaces
field, "{ fmt_out_funs with out_spaces = f; }" should be replaced by
"{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old
behavior.
(Richard Bonichon and Pierre Weis, review by Alain Frisch, original request by
Spiros Eliopoulos in #506)
* #943: Fixed the divergence of the Pervasives module between the stdlib
and threads implementations. In rare circumstances this can change the
behavior of existing applications: the implementation of Pervasives.close_out
used when compiling with thread support was inconsistent with the manual.
It will now not suppress exceptions escaping Pervasives.flush anymore.
Developers who want the old behavior should use Pervasives.close_out_noerr
instead. The stdlib implementation, used by applications not compiled
with thread support, will now only suppress Sys_error exceptions in
Pervasives.flush_all. This should allow exceedingly unlikely assertion
exceptions to escape, which could help reveal bugs in the standard library.
(Markus Mottl, review by Hezekiah M. Carty, Jérémie Dimino, Damien Doligez,
Alain Frisch, Xavier Leroy, Gabriel Scherer and Mark Shinwell)
- #1034: List.init : int -> (int -> 'a) -> 'a list
(Richard Degenne, review by David Allsopp, Thomas Braibant, Florian
Angeletti, Gabriel Scherer, Nathan Moreau, Alain Frisch)
- #1091 Add the Uchar.{bom,rep} constants.
(Daniel Bünzli, Alain Frisch)
- #1091: Add Buffer.add_utf_{8,16le,16be}_uchar to encode Uchar.t
values to the corresponding UTF-X transformation formats in Buffer.t
values.
(Daniel Bünzli, review by Damien Doligez, Max Mouratov)
- #1175: Bigarray, add a change_layout function to each Array[N]
submodules.
(Florian Angeletti)
* #1306: In the MSVC and Mingw ports, "Sys.rename src dst" no longer fails if
file "dst" exists, but replaces it with file "src", like in the other ports.
(Xavier Leroy)
- #1314: Format, use the optional width information
when formatting a boolean: "%8B", "%-8B" for example
(Xavier Clerc, review by Gabriel Scherer)
- c9cc0f25138ce58e4f4e68c4219afe33e2a9d034: Resurrect tabulation boxes
in module Format. Rewrite/extend documentation of tabulation boxes.
(Pierre Weis)
### Other libraries:
- #7564, #1211: Allow forward slashes in the target of symbolic links
created by Unix.symlink under Windows.
(Nicolás Ojeda Bär, review by David Allsopp)
* #7640, #1414: reimplementation of Unix.execvpe to fix issues
with the 4.05 implementation. The main issue is that the current
directory was always searched (last), even if the current directory
is not listed in the PATH.
(Xavier Leroy, report by Louis Gesbert and Arseniy Alekseyev,
review by Ivan Gotovchits)
- #997, #1077: Deprecate Bigarray.*.map_file and add Unix.map_file as a
first step towards moving Bigarray to the stdlib
(Jérémie Dimino and Xavier Leroy)
* #1178: remove the Num library for arbitrary-precision arithmetic.
It now lives as a separate project https://github.com/ocaml/num
with an OPAM package called "num".
(Xavier Leroy)
- #1217: Restrict Unix.environment in privileged contexts; add
Unix.unsafe_environment.
(Jeremy Yallop, review by Mark Shinwell, Nicolás Ojeda Bär,
Damien Doligez and Hannes Mehnert)
- #1321: Reimplement Unix.isatty on Windows. It no longer returns true for
the null device.
(David Allsopp)
### Compiler user-interface and warnings:
- #7361, #1248: support "ocaml.warning" in all attribute contexts, and
arrange so that "ocaml.ppwarning" is correctly scoped by surrounding
"ocaml.warning" attributes
(Alain Frisch, review by Florian Angeletti and Thomas Refis)
- #7444, #1138: trigger deprecation warning when a "deprecated"
attribute is hidden by signature coercion
(Alain Frisch, report by bmillwood, review by Leo White)
- #7472: ensure .cmi files are created atomically,
to avoid corruption of .cmi files produced simultaneously by a run
of ocamlc and a run of ocamlopt.
(Xavier Leroy, from a suggestion by Gerd Stolpmann)
* #7514, #1152: add -dprofile option, similar to -dtimings but
also displays memory allocation and consumption.
The corresponding addition of a new compiler-internal
Profile module may affect some users of
compilers-libs/ocamlcommon (by creating module conflicts).
(Valentin Gatien-Baron, report by Gabriel Scherer)
- #7620, #1317: Typecore.force_delayed_checks does not run with -i option
(Jacques Garrigue, report by Jun Furuse)
- #7624: handle warning attributes placed on let bindings
(Xavier Clerc, report by dinosaure, review by Alain Frisch)
- #896: "-compat-32" is now taken into account when building .cmo/.cma
(Hugo Heuzard)
- #948: the compiler now reports warnings-as-errors by prefixing
them with "Error (warning ..):", instead of "Warning ..:" and
a trailing "Error: Some fatal warnings were triggered" message.
(Valentin Gatien-Baron, review by Alain Frisch)
- #1032: display the output of -dtimings as a hierarchy
(Valentin Gatien-Baron, review by Gabriel Scherer)
- #1114, #1393, #1429: refine the (ocamlc -config) information
on C compilers: the variables `{bytecode,native}_c_compiler` are deprecated
(the distinction is now mostly meaningless) in favor of a single
`c_compiler` variable combined with `ocaml{c,opt}_cflags`
and `ocaml{c,opt}_cppflags`.
(Sébastien Hinderer, Jeremy Yallop, Gabriel Scherer, review by
Adrien Nader and David Allsopp)
* #1189: allow MSVC ports to use -l option in ocamlmklib
(David Allsopp)
- #1332: fix ocamlc handling of "-output-complete-obj"
(François Bobot)
- #1336: -thread and -vmthread option information is propagated to
PPX rewriters.
(Jun Furuse, review by Alain Frisch)
### Code generation and optimizations:
- #5324, #375: An alternative Linear Scan register allocator for
ocamlopt, activated with the -linscan command-line flag. This
allocator represents a trade-off between worse generated code
performance for higher compilation speed (especially interesting in
some cases graph coloring is necessarily quadratic).
(Marcell Fischbach and Benedikt Meurer, adapted by Nicolás Ojeda Bär, review
by Nicolás Ojeda Bär and Alain Frisch)
- #6927, #988: On macOS, when compiling bytecode stubs, plugins,
and shared libraries through -output-obj, generate dylibs instead of
bundles.
(whitequark)
- #7447, #995: incorrect code generation for nested recursive bindings
(Leo White and Jeremy Yallop, report by Stephen Dolan)
- #7501, #1089: Consider arrays of length zero as constants
when using Flambda.
(Pierre Chambart, review by Mark Shinwell and Leo White)
- #7531, #1162: Erroneous code transformation at partial applications
(Mark Shinwell)
- #7614, #1313: Ensure that inlining does not depend on the order
of symbols (flambda)
(Leo White, Xavier Clerc, report by Alex, review by Gabriel Scherer
and Pierre Chambart)
- #7616, #1339: don't warn on mutation of zero size blocks.
(Leo White)
- #7631, #1355: "-linscan" option crashes ocamlopt
(Xavier Clerc, report by Paul Steckler)
- #7642, #1411: ARM port: wrong register allocation for integer
multiply on ARMv4 and ARMv5; possible wrong register allocation for
floating-point multiply and add on VFP and for floating-point
negation and absolute value on soft FP emulation.
(Xavier Leroy, report by Stéphane Glondu and Ximin Luo,
review and additional sightings by Mark Shinwell)
* #659: Remove support for SPARC native code generation
(Mark Shinwell)
- #850: Optimize away some physical equality
(Pierre Chambart, review by Mark Shinwell and Leo White)
- #856: Register availability analysis
(Mark Shinwell, Thomas Refis, review by Pierre Chambart)
- #1143: tweaked several allocation functions in the runtime by
checking for likely conditions before unlikely ones and eliminating
some redundant checks.
(Markus Mottl, review by Alain Frisch, Xavier Leroy, Gabriel Scherer,
Mark Shinwell and Leo White)
- #1183: compile curried functors to multi-argument functions
earlier in the compiler pipeline; correctly propagate [@@inline]
attributes on such functors; mark functor coercion veneers as
stubs.
(Mark Shinwell, review by Pierre Chambart and Leo White)
- #1195: Merge functions based on partiality rather than
Parmatch.irrefutable.
(Leo White, review by Thomas Refis, Alain Frisch and Gabriel Scherer)
- #1215: Improve compilation of short-circuit operators
(Leo White, review by Frédéric Bour and Mark Shinwell)
- #1250: illegal ARM64 assembly code generated for large combined allocations
(report and initial fix by Steve Walk, review and final fix by Xavier Leroy)
- #1271: Don't generate Ialloc instructions for closures that exceed
Max_young_wosize; instead allocate them on the major heap. (Related
to #1250.)
(Mark Shinwell)
- #1294: Add a configure-time option to remove the dynamic float array
optimization and add a floatarray type to let the user choose when to
flatten float arrays. Note that float-only records are unchanged: they
are still optimized by unboxing their fields.
(Damien Doligez, review by Alain Frisch and Mark Shinwell)
- #1304: Mark registers clobbered by PLT stubs as destroyed across
allocations.
(Mark Shinwell, Xavier Clerc, report and initial debugging by
Valentin Gatien-Baron)
- #1323: make sure that frame tables are generated in the data
section and not in the read-only data section, as was the case
before in the PPC and System-Z ports. This avoids relocations in
the text segment of shared libraries and position-independent
executables generated by ocamlopt.
(Xavier Leroy, review by Mark Shinwell)
- #1330: when generating dynamically-linkable code on AArch64, always
reference symbols (even locally-defined ones) through the GOT.
(Mark Shinwell, review by Xavier Leroy)
### Tools:
- #8395, #973: tools/check-symbol-names checks for globally
linked names not namespaced with caml_
(Stephen Dolan)
- #6928, #1103: ocamldoc, do not introduce an empty <h1> in index.html
when no -title has been provided
(Pierre Boutillier)
- #7048: ocamldoc, in -latex mode, don't escape Latin-1 accented letters
(Xavier Leroy, report by Hugo Herbelin)
* #7351: ocamldoc, use semantic tags rather than <br> tags in the html
backend
(Florian Angeletti, request and review by Daniel Bünzli )
* #7352, #7353: ocamldoc, better paragraphs in html output
(Florian Angeletti, request by Daniel Bünzli)
* #7363, #830: ocamldoc, start heading levels at {1 not {2 or {6.
This change modifies the mapping between ocamldoc heading level and
html heading level, breaking custom css style for ocamldoc.
(Florian Angeletti, request and review by Daniel Bünzli)
* #7478, #1037: ocamldoc, do not use as a module preamble documentation
comments that occur after the first module element. This change may break
existing documentation. In particular, module preambles must now come before
any `open` statement.
(Florian Angeletti, review by David Allsopp and report by Daniel Bünzli)
- #7521, #1159: ocamldoc, end generated latex file with a new line
(Florian Angeletti)
- #7575, #1219: Switch compilers from -no-keep-locs
to -keep-locs by default: produced .cmi files will contain locations.
This provides better error messages. Note that, as a consequence,
.cmi digests now depend on the file path as given to the compiler.
(Daniel Bünzli)
- #7610, #1346: caml.el (the Emacs editing mode) was cleaned up
and made compatible with Emacs 25.
(Stefan Monnier, Christophe Troestler)
- #7635, #1383: ocamldoc, add an identifier to module
and module type elements
(Florian Angeletti, review by Yawar Amin and Gabriel Scherer)
- #681, #1426: Introduce ocamltest, a new test driver for the
OCaml compiler testsuite
(Sébastien Hinderer, review by Damien Doligez)
- #1012: ocamlyacc, fix parsing of raw strings and nested comments, as well
as the handling of ' characters in identifiers.
(Demi Marie Obenour)
- #1045: ocamldep, add a "-shared" option to generate dependencies
for native plugin files (i.e. .cmxs files)
(Florian Angeletti, suggestion by Sébastien Hinderer)
- #1078: add a subcommand "-depend" to "ocamlc" and "ocamlopt",
to behave as ocamldep. Should be used mostly to replace "ocamldep" in the
"boot" directory to reduce its size in the future.
(Fabrice Le Fessant)
- #1036: ocamlcmt (tools/read_cmt) is installed, converts .cmt to .annot
(Fabrice Le Fessant)
- #1180: Add support for recording numbers of direct and indirect
calls over the lifetime of a program when using Spacetime profiling
(Mark Shinwell)
- #1457, ocamldoc: restore label for exception in the latex backend
(omitted since 4.04.0)
(Florian Angeletti, review by Gabriel Scherer)
### Toplevel:
- #7570: remove unusable -plugin option from the toplevel
(Florian Angeletti)
- #1041: -nostdlib no longer ignored by toplevel.
(David Allsopp, review by Xavier Leroy)
- #1231: improved printing of unicode texts in the toplevel,
unless OCAMLTOP_UTF_8 is set to false.
(Florian Angeletti, review by Daniel Bünzli, Xavier Leroy and
Gabriel Scherer)
- #1688: Fix printing of -0.
(Nicolás Ojeda Bär, review by Jérémie Dimino)
### Runtime system:
* #3771, #153, #1200, #1357, #1362, #1363, #1369, #1398,
#1446, #1448: Unicode support for the Windows runtime.
(ygrek, Nicolás Ojeda Bär, review by Alain Frisch, David Allsopp, Damien
Doligez)
* #7594, #1274, #1368: String_val now returns 'const char*', not
'char*' when -safe-string is enabled at configure time. New macro Bytes_val
for accessing bytes values.
(Jeremy Yallop, reviews by Mark Shinwell and Xavier Leroy)
- #71: The runtime can now be shut down gracefully by means of the new
caml_shutdown and caml_startup_pooled functions. The new 'c' flag in
OCAMLRUNPARAM enables shutting the runtime properly on process exit.
(Max Mouratov, review and discussion by Damien Doligez, Gabriel Scherer,
Mark Shinwell, Thomas Braibant, Stephen Dolan, Pierre Chambart,
François Bobot, Jacques Garrigue, David Allsopp, and Alain Frisch)
- #938, #1170, #1289: Stack overflow detection on 64-bit Windows
(Olivier Andrieu, tweaked by David Allsopp)
- #1070, #1295: enable gcc typechecking for caml_alloc_sprintf,
caml_gc_message. Make caml_gc_message a variadic function. Fix many
caml_gc_message format strings.
(Olivier Andrieu, review and 32bit fix by David Allsopp)
- #1073: Remove statically allocated compare stack.
(Stephen Dolan)
- #1086: in Sys.getcwd, just fail instead of calling getwd()
if HAS_GETCWD is not set.
(Report and first fix by Sebastian Markbåge, final fix by Xavier Leroy,
review by Mark Shinwell)
- #1269: Remove 50ms delay at exit for programs using threads
(Valentin Gatien-Baron, review by Stephen Dolan)
* #1309: open files with O_CLOEXEC (or equivalent) in caml_sys_open, thus
unifying the semantics between Unix and Windows and also eliminating race
condition on Unix.
(David Allsopp, report by Andreas Hauptmann)
- #1326: Enable use of CFI directives in AArch64 and ARM runtime
systems' assembly code (asmrun/arm64.S). Add CFI directives to enable
unwinding through [caml_c_call] and [caml_call_gc] with correct termination
of unwinding at [main].
(Mark Shinwell, review by Xavier Leroy and Gabriel Scherer, with thanks
to Daniel Bünzli and Fu Yong Quah for testing)
- #1338: Add "-g" for bytecode runtime system compilation
(Mark Shinwell)
* #1416, #1444: switch the Windows 10 Console to UTF-8 encoding.
(David Allsopp, reviews by Nicolás Ojeda Bär and Xavier Leroy)
### Manual and documentation:
- #6548: remove obsolete limitation in the description of private
type abbreviations
(Florian Angeletti, suggestion by Leo White)
- #6676, #1110: move record notation to tutorial
(Florian Angeletti, review by Gabriel Scherer)
- #6676, #1112: move local opens to tutorial
(Florian Angeletti)
- #6676, #1153: move overriding class definitions to reference
manual and tutorial
(Florian Angeletti)
- #6709: document the associativity and precedence level of
pervasive operators
(Florian Angeletti, review by David Allsopp)
- #7254, #1096: Rudimentary documentation of ocamlnat
(Mark Shinwell)
- #7281, #1259: fix .TH macros in generated manpages
(Olaf Hering)
- #7507: Align the description of the printf conversion
specification "%g" with the ISO C90 description.
(Florian Angeletti, suggestion by Armaël Guéneau)
- #7551, #1194 : make the final ";;" potentially optional in
caml_example
(Florian Angeletti, review and suggestion by Gabriel Scherer)
- #7588, #1291: make format documentation predictable
(Florian Angeletti, review by Gabriel Radanne)
- #7604: Minor Ephemeron documentation fixes
(Miod Vallat, review by Florian Angeletti)
- #594: New chapter on polymorphism troubles:
weakly polymorphic types, polymorphic recursion,and higher-ranked
polymorphism.
(Florian Angeletti, review by Damien Doligez, Gabriel Scherer,
and Gerd Stolpmann)
- #1187: Minimal documentation for compiler plugins
(Florian Angeletti)
- #1202: Fix Typos in comments as well as basic grammar errors.
(JP Rodi, review and suggestions by David Allsopp, Max Mouratov,
Florian Angeletti, Xavier Leroy, Mark Shinwell and Damien Doligez)
- #1220: Fix "-keep-docs" option in ocamlopt manpage
(Etienne Millon)
### Compiler distribution build system:
- #6373, #1093: Suppress trigraph warnings from macOS assembler
(Mark Shinwell)
- #7639, #1371: fix configure script for correct detection of
int64 alignment on Mac OS X 10.13 (High Sierra) and above; fix bug in
configure script relating to such detection.
(Mark Shinwell, report by John Whitington, review by Xavier Leroy)
- #558: enable shared library and natdynlink support on more Linux
platforms
(Felix Janda, Mark Shinwell)
* #1104: remove support for the NeXTStep platform
(Sébastien Hinderer)
- #1130: enable detection of IBM XL C compiler (one need to run configure
with "-cc <path to xlc compiler>"). Enable shared library support for
bytecode executables on AIX/xlc (tested on AIX 7.1, XL C 12).
To enable 64-bit, run both "configure" and "make world" with OBJECT_MODE=64.
(Konstantin Romanov, Enrique Naudon)
- #1203: speed up the manual build by using ocamldoc.opt
(Gabriel Scherer, review by Florian Angeletti)
- #1214: harden config/Makefile against '#' characters in PREFIX
(Gabriel Scherer, review by David Allsopp and Damien Doligez)
- #1216: move Compplugin and friends from BYTECOMP to COMP
(Leo White, review by Mark Shinwell)
* #1242: disable C plugins loading by default
(Alexey Egorov)
- #1275: correct configure test for Spacetime availability
(Mark Shinwell)
- #1278: discover presence of <sys/shm.h> during configure for afl runtime
(Hannes Mehnert)
- #1386: provide configure-time options to fine-tune the safe-string
options and default settings changed by #1252.
The previous configure option -safe-string is now
renamed -force-safe-string.
At configure-time, -force-safe-string forces all module to use
immutable strings (this disables the per-file, compile-time
-unsafe-string option). The new default-(un)safe-string options
let you set the default choice for the per-file compile-time
option. (The new #1252 behavior corresponds to having
-default-safe-string, while 4.05 and older had
-default-unsafe-string).
(Gabriel Scherer, review by Kate Deplaix and Damien Doligez)
- #1409: Fix to enable NetBSD/powerpc to work.
(Håvard Eidnes)
### Internal/compiler-libs changes:
- #6826, #828, #834: improve compilation time for open
(Alain Frisch, review by Frédéric Bour and Jacques Garrigue)
- #7127, #454, #1058: in toplevel, print bytes and strip
strings longer than the size specified by the "print_length" directive
(Fabrice Le Fessant, initial PR by Junsong Li)
- #406: remove polymorphic comparison for Types.constructor_tag in compiler
(Dwight Guth, review by Gabriel Radanne, Damien Doligez, Gabriel Scherer,
Pierre Chambart, Mark Shinwell)
- #1119: Change Set (private) type to inline records.
(Albin Coquereau)
* #1127: move config/{m,s}.h to byterun/caml and install them.
User code should not have to include them directly since they are
included by other header files.
Previously {m,s}.h were not installed but they were substituted into
caml/config.h; they are now just #include-d by this file. This may
break some scripts relying on the (unspecified) presence of certain
#define in config.h instead of m.h and s.h -- they can be rewritten
to try to grep those files if they exist.
(Sébastien Hinderer)
- #1281: avoid formatter flushes inside exported printers in Location
(Florian Angeletti, review by Gabriel Scherer)
### Bug fixes:
- #5927: Type equality broken for conjunctive polymorphic variant tags
(Jacques Garrigue, report by Leo White)
- #6329, #1437: Introduce padding word before "data_end" symbols
to ensure page table tests work correctly on an immediately preceding
block of zero size.
(Mark Shinwell, review by Xavier Leroy)
- #6587: only elide Pervasives from printed type paths in unambiguous context
(Florian Angeletti and Jacques Garrigue)
- #6934: nonrec misbehaves with GADTs
(Jacques Garrigue, report by Markus Mottl)
- #7070, #1139: Unexported values can cause non-generalisable variables
error
(Leo White)
- #7261: Warn on type constraints in GADT declarations
(Jacques Garrigue, report by Didier Le Botlan)
- #7321: Private type in signature clashes with type definition via
functor instantiation
(Jacques Garrigue, report by Markus Mottl)
- #7372, #834: fix type-checker bug with GADT and inline records
(Alain Frisch, review by Frédéric Bour and Jacques Garrigue)
- #7344: Inconsistent behavior with type annotations on let
(Jacques Garrigue, report by Leo White)
- #7468: possible GC problem in caml_alloc_sprintf
(Xavier Leroy, discovery by Olivier Andrieu)
- #7496: Fixed conjunctive polymorphic variant tags do not unify
with themselves
(Jacques Garrigue, report by Leo White)
- #7506: pprintast ignores attributes in tails of a list
(Alain Frisch, report by Kenichi Asai and Gabriel Scherer)
- #7513: List.compare_length_with mishandles negative numbers / overflow
(Fabrice Le Fessant, report by Jeremy Yallop)
- #7519: Incorrect rejection of program due to faux scope escape
(Jacques Garrigue, report by Markus Mottl)
- #7540, #1179: Fixed setting of breakpoints within packed modules
for ocamldebug
(Hugo Herbelin, review by Gabriel Scherer, Damien Doligez)
- #7543: short-paths printtyp can fail on packed type error messages
(Florian Angeletti)
- #7553, #1191: Prevent repeated warnings with recursive modules.
(Leo White, review by Josh Berdine and Alain Frisch)
- #7563, #1210: code generation bug when a module alias and
an extension constructor have the same name in the same module
(Gabriel Scherer, report by Manuel Fähndrich,
review by Jacques Garrigue and Leo White)
- #7591, #1257: on x86-64, frame table is not 8-aligned
(Xavier Leroy, report by Mantis user "voglerr", review by Gabriel Scherer)
- #7601, #1320: It seems like a hidden non-generalized type variable
remains in some inferred signatures, which leads to strange errors
(Jacques Garrigue, report by Mandrikin)
- #7609: use-after-free memory corruption if a program debugged
under ocamldebug calls Pervasives.flush_all
(Xavier Leroy, report by Paul Steckler, review by Gabriel Scherer)
- #7612, #1345: afl-instrumentation bugfix for classes.
(Stephen Dolan, review by Gabriel Scherer and David Allsopp)
- #7617, #7618, #1318: Ambiguous (mistakenly) type escaping the
scope of its equation
(Jacques Garrigue, report by Thomas Refis)
- #7619, #1387: position of the optional last semi-column not included
in the position of the expression (same behavior as for lists)
(Christophe Raffalli, review by Gabriel Scherer)
- #7638: in the Windows Mingw64 port, multithreaded programs compiled
to bytecode could crash when raising an exception from C code.
This looks like a Mingw64 issue, which we work around with GCC builtins.
(Xavier Leroy)
- #7656, #1423: false 'unused type/constructor/value' alarms
in the 4.06 development version
(Alain Frisch, review by Jacques Garrigue, report by Kate Deplaix)
- #7657, #1424: ensures correct call-by-value semantics when
eta-expanding functions to eliminate optional arguments
(Alain Frisch, report by sliquister, review by Leo White and Jacques
Garrigue)
- #7658, #1439: Fix Spacetime runtime system compilation with
-force-safe-string
(Mark Shinwell, report by Christoph Spiel, review by Gabriel Scherer)
- #1155: Fix a race condition with WAIT_NOHANG on Windows
(Jérémie Dimino and David Allsopp)
- #1199: Pretty-printing formatting cleanup in pprintast
(Ethan Aubin, suggestion by Gabriel Scherer, review by David Allsopp,
Florian Angeletti, and Gabriel Scherer)
- #1223: Fix corruption of the environment when using -short-paths
with the toplevel.
(Leo White, review by Alain Frisch)
- #1243: Fix pprintast for #... infix operators
(Alain Frisch, report by Omar Chebib)
- #1324: ensure that flambda warning are printed only once
(Xavier Clerc)
- #1329: Prevent recursive polymorphic variant names
(Jacques Garrigue, fix suggested by Leo White)
- #1308: Only treat pure patterns as inactive
(Leo White, review by Alain Frisch and Gabriel Scherer)
- #1390: fix the [@@unboxed] type check to accept parametrized types
(Leo White, review by Damien Doligez)
- #1407: Fix raw_spacetime_lib
(Leo White, review by Gabriel Scherer and Damien Doligez)
OCaml 4.05.0 (13 Jul 2017):
---------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
### Code generation and optimizations:
- #7201, #954: Correct wrong optimisation of "0 / <expr>"
and "0 mod <expr>" in the case when <expr> was a non-constant
evaluating to zero
(Mark Shinwell, review by Gabriel Scherer, Leo White and Xavier Leroy)
- #7357, #832: Improve compilation time for toplevel
include(struct ... end : sig ... end)
(Alain Frisch, report by Hongbo Zhang, review by Jacques Garrigue)
- #7533, #1173: Correctly perform side effects for certain
cases of "/" and "mod"
(Mark Shinwell, report by Jan Mitgaard)
- #504: Instrumentation support for fuzzing with afl-fuzz.
(Stephen Dolan, review by Alain Frisch, Pierre Chambart, Mark
Shinwell, Gabriel Scherer and Damien Doligez)
- #863, #1068, #1069: Optimise matches with constant
results to lookup tables.
(Stephen Dolan, review by Gabriel Scherer, Pierre Chambart,
Mark Shinwell, and bug report by Gabriel Scherer)
- #1150: Fix typo in arm64 assembler directives
(KC Sivaramakrishnan)
### Runtime system:
- #2784, #953: Add caml_startup_exn
(Mark Shinwell)
- #7423, #946: expose new exception-raising functions
`void caml_{failwith,invalid_argument}_value(value msg)`
in addition to
`void caml_{failwith,invalid_argument}(char const *msg)`.
The previous functions would not free their message argument, so
were inconvient for dynamically-allocated messages; the messages
passed to the new functions are handled by the garbage collector.
(Gabriel Scherer, review by Mark Shinwell, request by Immanuel Litzroth)
- #7557, #1213: More security for getenv
(Damien Doligez, reports by Seth Arnold and Eric Milliken, review by
Xavier Leroy, David Allsopp, Stephen Dolan, Hannes Mehnert)
- #795: remove 256-character limitation on Sys.executable_name
(Xavier Leroy)
- #891: Use -fno-builtin-memcmp when building runtime with gcc.
(Leo White)
### Type system:
- #6608, #901: unify record types when overriding all fields
(Tadeu Zagallo and Gabriel Scherer, report by Jeremy Yallop,
review by David Allsopp, Jacques Garrigue)
* #7414, #929: Soundness bug with non-generalized type variables and
functors.
(compatibility: some code using module-global mutable state will
fail at compile-time and is fixed by adding extra annotations;
see the Mantis and Github discussions.)
(Jacques Garrigue, report by Leo White)
### Compiler user-interface and warnings:
- #7050, #748 #843 #864: new `-args/-args0 <file>` parameters to
provide extra command-line arguments in a file -- see documentation.
User programs may implement similar options using the new `Expand`
constructor of the `Arg` module.
(Bernhard Schommer, review by Jérémie Dimino, Gabriel Scherer
and Damien Doligez, discussion with Alain Frisch and Xavier Leroy,
feature request from the Coq team)
- #7137, #960: "-open" command line flag now accepts
a module path (not a module name)
(Arseniy Alekseyev and Leo White)
- #7172, #970: add extra (ocamlc -config) options
int_size, word_size, ext_exe
(Gabriel Scherer, request by Daniel Bünzli)
- #7315, #736: refine some error locations
(Gabriel Scherer and Alain Frisch, report by Matej Košík)
- #7473, #1025: perform proper globbing for command-line arguments on
Windows
(Jonathan Protzenko)
- #7479: make sure "ocamlc -pack" is only given .cmo and .cmi files,
and that "ocamlopt -pack" is only given .cmx and .cmi files.
(Xavier Leroy)
- #796: allow compiler plugins to declare their own arguments.
(Fabrice Le Fessant)
- #829: better error when opening a module aliased to a functor
(Alain Frisch)
- #911: ocamlc/ocamlopt do not pass warnings-related options to C
compiler when called to compile third-party C source files
(Sébastien Hinderer, review by Adrien Nader and David Allsopp)
- #915: fix -dsource (pprintast.ml) bugs
(Runhang Li, review by Alain Frisch)
* #933: ocamlopt -p now reports an error on platforms that do not
support profiling with gprof; dummy profiling libraries are no longer
installed on such platforms.
This can be tested with ocamlopt -config
(Sébastien Hinderer)
- #1009: "ocamlc -c -linkall" and "ocamlopt -c -linkall" can now be used
to set the "always link" flag on individual compilation units. This
controls linking with finer granularity than "-a -linkall", which sets
the "always link" flag on all units of the given library.
(Xavier Leroy)
- #1015: add option "-plugin PLUGIN" to ocamldep too. Use compilerlibs
to build ocamldep. Add option "-depend" to ocamlc/ocamlopt to behave
as ocamldep. Remove any use of ocamldep to build the distribution.
(Fabrice Le Fessant)
- #1027: various improvements to -dtimings, mostly including time
spent in subprocesses like preprocessors
(Valentin Gatien-Baron, review by Gabriel Scherer)
- #1098: the compiler now takes the boolean "OCAML_COLOR" environment
variable into account if "-color" is not provided. This allows users
to override the default behaviour without modifying invocations of ocaml
manually.
(Hannes Mehnert, Guillaume Bury,
review by Daniel Bünzli, Gabriel Scherer, Damien Doligez)
### Standard library:
- #6975, #902: Truncate function added to stdlib Buffer module
(Dhruv Makwana, review by Alain Frisch and Gabriel Scherer)
- #7279, #710: `Weak.get_copy` `Ephemeron.*_copy` doesn't copy
custom blocks anymore
(François Bobot, Alain Frisch, report by Martin R. Neuhäußer,
review by Thomas Braibant and Damien Doligez)
* #7500, #1081: Remove Uchar.dump
(Daniel Bünzli)
- #760: Add a functions List.compare_lengths and
List.compare_length_with to avoid full list length computations
(Fabrice Le Fessant, review by Leo White, Josh Berdine and Gabriel Scherer)
- #778: Arg: added option Expand that allows to expand a string
argument to a string array of new arguments
(Bernhard Schommer, review by Gabriel Scherer and Jérémie Dimino)
- #849: Expose a Spacetime.enabled value
(Leo White)
- #885: Option-returning variants of stdlib functions
(Alain Frisch, review by David Allsopp and Bart Jacobs)
- #869: Add find_first, find_first_opt, find_last, find_last_opt to
maps and sets. Find the first or last binding or element
satisfying a monotonic predicate.
(Gabriel de Perthuis, with contributions from Alain Frisch, review by
Hezekiah M. Carty and Simon Cruanes, initial report by Gerd Stolpmann)
- #875: Add missing functions to ArrayLabels, BytesLabels,
ListLabels, MoreLabels, StringLabels so they are compatible with
non-labeled counterparts. Also add missing @@ocaml.deprecated attributes
in StringLabels and BytesLabels.
(Roma Sokolov, review by Gabriel Scherer, Jacques Garrigue,
Gabriel Radanne, Alain Frisch)
- #999: Arg, do not repeat the usage message thrice when reporting an error
(this was a regression in 4.03)
(Florian Angeletti, review by Gabriel Scherer)
- #1042: Fix escaping of command-line arguments in
Unix.create_process{,_env} under Windows. Arguments with tabs should now
be received verbatim by the child process.
(Nicolás Ojeda Bär, Andreas Hauptmann review by Xavier Leroy)
### Debugging and profiling:
- #7258: ocamldebug's "install_printer" command had problems with
module aliases
(Xavier Leroy)
- #378: Add [Printexc.raise_with_backtrace] to raise an exception using
an explicit backtrace
(François Bobot, review by Gabriel Scherer, Xavier Leroy, Damien Doligez,
Frédéric Bour)
### Manual and documentation:
- #6597, #1030: add forward references to language extensions
that extend non-terminal symbols in the language reference section.
(Florian Angeletti, review by Gabriel Scherer)
- #7497, #1095: manual, enable numbering for table of contents
(Florian Angeletti, request by Daniel Bünzli)
- #7539, #1181: manual, update dead links in ocamldoc chapter
(Florian Angeletti)
- #633: manpage and manual documentation for the `-opaque` option
(Konstantin Romanov, Gabriel Scherer, review by Mark Shinwell)
- #751, #925: add a HACKING.adoc file to contain various
tips and tricks for people hacking on the repository. See also
CONTRIBUTING.md for advice on sending contributions upstream.
(Gabriel Scherer and Gabriel Radanne, review by David Allsopp,
inspired by John Whitington)
- #916: new tool lintapidiff, use it to update the manual with
@since annotations for API changes introduced between 4.00-4.05.
(Edwin Török, review by Gabriel Scherer, discussion with Alain Frisch,
David Allsopp, Sébastien Hinderer, Damien Doligez and Xavier Leroy)
- #939: activate the caml_example environment in the language
extensions section of the manual. Convert some existing code
examples to this format.
(Florian Angeletti)
- #1082: clarify that the use of quoted string for preprocessed
foreign quotations still requires the use of an extension node
[%foo ...] to mark non-standard interpretation.
(Gabriel Scherer, request by Matthew Wahab in #1066,
review by Florian Angeletti)
### Other libraries:
- #7158: Event.sync, Mutex.create, Condition.create cause too many GCs.
The fix is to no longer consider mutexes and condition variables
as rare kernel resources.
(Xavier Leroy)
- #7264: document the different behaviors of Unix.lockf under POSIX
and under Win32.
(Xavier Leroy, report by David Allsopp)
- #7339, #787: Support the '0 dimension' case for bigarrays
(see Bigarray documentation)
(Laurent Mazare,
review by Gabriel Scherer, Alain Frisch and Hezekiah M. Carty)
* #7342, #797: fix Unix.read on pipes with no data left on Windows
it previously raised an EPIPE error, it now returns 0 like other OSes
(Jonathan Protzenko, review by Andreas Hauptmann and Damien Doligez)
- #650: in the Unix library, add `?cloexec:bool` optional arguments to
functions that create file descriptors (`dup`, `dup2`, `pipe`, `socket`,
`socketpair`, `accept`). Implement these optional arguments in the
most atomic manner provided by the operating system to set (or clear)
the close-on-exec flag at the same time the file descriptor is created,
reducing the risk of race conditions with `exec` or `create_process`
calls running in other threads, and improving security. Also: add a
`O_KEEPEXEC` flag for `openfile` by symmetry with `O_CLOEXEC`.
(Xavier Leroy, review by Mark Shinwell, David Allsopp and Alain Frisch,
request by Romain Beauxis)
- #996: correctly update caml_top_of_stack in systhreads
(Fabrice Le Fessant)
- #997, #1077: Deprecate Bigarray.*.map_file and add Unix.map_file as a
first step towards moving Bigarray to the stdlib
(Jérémie Dimino and Xavier Leroy)
### Toplevel:
- #7060, #1035: Print exceptions in installed custom printers
(Tadeu Zagallo, review by David Allsopp)
### Tools:
- #5163: ocamlobjinfo, dump globals defined by bytecode executables
(Stéphane Glondu)
- #7333: ocamldoc, use the first sentence of text file as
a short description in overviews.
(Florian Angeletti)
- #848: ocamldoc, escape link targets in HTML output
(Etienne Millon, review by Gabriel Scherer, Florian Angeletti and
Daniel Bünzli)
- #986: ocamldoc, use relative paths in error message
to solve ocamlbuild+doc usability issue (ocaml/ocamlbuild#79)
(Gabriel Scherer, review by Florian Angeletti, discussion with Daniel Bünzli)
- #1017: ocamldoc, add an option to detect code fragments that could be
transformed into a cross-reference to a known element.
(Florian Angeletti, review and suggestion by David Allsopp)
- clarify ocamldoc text parsing error messages
(Gabriel Scherer)
### Compiler distribution build system:
- #7377: remove -std=gnu99 for newer gcc versions
(Damien Doligez, report by ygrek)
- #7452, #1228: tweak GCC options to try to avoid the
Skylake/Kaby lake bug
(Damien Doligez, review by David Allsopp, Xavier Leroy and Mark Shinwell)
- #693: fail on unexpected errors or warnings within caml_example
environment.
(Florian Angeletti)
- #803: new ocamllex-based tool to extract bytecode compiler
opcode information from C headers.
(Nicolás Ojeda Bär)
- #827: install missing mli and cmti files, new make target
install-compiler-sources for installation of compiler-libs ml files
(Hendrik Tews)
- #887: allow -with-frame-pointers if clang is used as compiler on Linux
(Bernhard Schommer)
- #898: fix locale-dependence of primitive list order,
detected through reproducible-builds.org.
(Hannes Mehnert, review by Gabriel Scherer and Ximin Luo)
- #907: Remove unused variable from the build system
(Sébastien Hinderer, review by whitequark, Gabriel Scherer, Adrien Nader)
- #911: Clarify the use of C compiler related variables in the build system.
(Sébastien Hinderer, review by Adrien Nader, Alain Frisch, David Allsopp)
- #919: use clang as preprocessor assembler if clang is used as compiler
(Bernhard Schommer)
- #927: improve the detection of hashbang support in the configure script
(Armaël Guéneau)
- #932: install ocaml{c,lex}->ocaml{c,lex}.byte symlink correctly
when the opt target is built but opt.opt target is not.
(whitequark, review by Gabriel Scherer)
- #935: allow build in Android's termux
(ygrek, review by Gabriel Scherer)
- #984: Fix compilation of compiler distribution when Spacetime
enabled
(Mark Shinwell)
- #991: On Windows, fix installation when native compiler is not
built
(Sébastien Hinderer, review by David Allsopp)
- #1033: merge Unix and Windows build systems in the root directory
(Sébastien Hinderer, review by Damien Doligez and Adrien Nader)
- #1047: Make .depend files generated for C sources more portable
(Sébastien Hinderer, review by Xavier Leroy and David Allsopp)
- #1076: Simplify ocamlyacc's build system
(Sébastien Hinderer, review by David Allsopp)
### Compiler distribution build system: Makefile factorization
The compiler distribution build system (the set of Makefiles used to
build the compiler distribution) traditionally had separate Makefiles
for Unix and Windows, which lead to some amount of duplication and
subtle differences and technical debt in general -- for people working
on the compiler distribution, but also cross-compilation or porting to
new systems. During the 4.05 development period, Sébastien Hinderer
worked on harmonizing the build rules and merging the two build
systems.
* Some changes were made to the config/Makefile file which
is exported as $(ocamlc -where)/Makefile.config, and on
which some advanced users might rely. The changes are
as follows:
- a BYTERUN variable was added that points to the installed ocamlrun
- the PARTIALLD variable was removed (PACKLD is more complete)
- the always-empty DLLCCCOMPOPTS was removed
- the SHARED variable was removed; its value is "shared" or "noshared",
which duplicates the existing and more convenient
SUPPORTS_SHARED_LIBRARIES variable whose value is "true" or "false".
Note that Makefile.config may change further in the future and relying
on it is a bit fragile. We plan to make `ocamlc -config` easier to use
for scripting purposes, and have a stable interface there. If you rely
on Makefile.config, you may want to get in touch with Sébastien Hinderer
or participate to #7116 (Allow easy retrieval of Makefile.config's values)
or #7172 (More information in ocamlc -config).
The complete list of changes is listed below.
- #705: update Makefile.nt so that ocamlnat compiles
for non-Cygwin Windows ports.
(Sébastien Hinderer, review by Alain Frisch)
- #729: Make sure ocamlnat is built with a $(EXE) extension, merge
rules between Unix and Windows Makefiles
(Sébastien Hinderer, review by Alain Frisch)
- #762: Merge build systems in the yacc/ directory.
(Sébastien Hinderer, review by David Allsopp, Alain Frisch)
- #764: Merge build systems in the debugger/ directory.
(Sébastien Hinderer, review by Alain Frisch)
- #785: Merge build systems in otherlibs/systhreads/
(Sébastien Hinderer, review by Alain Frisch, David Allsopp,
testing and regression fix by Jérémie Dimino)
- #788: Merge build systems in subdirectories of otherlibs/.
(Sébastien Hinderer, review by Alain Frisch)
- #808, #906: Merge Unix and Windows build systems
in the ocamldoc/ directory
(Sébastien Hinderer, review by Alain Frisch)
- #812: Merge build systems in the tools/ subdirectory
(Sébastien Hinderer, review by Alain Frisch)
- #866: Merge build systems in the stdlib/ directory
(Sébastien Hinderer, review by David Allsopp and Adrien Nader)
- #941: Merge Unix and Windows build systems in the asmrun/ directory
(Sébastien Hinderer, review by Mark Shinwell, Adrien Nader,
Xavier Leroy, David Allsopp, Damien Doligez)
- #981: Merge build systems in the byterun/ directory
(Sébastien Hinderer, review by Adrien Nader)
- #1033, #1048: Merge build systems in the root directory
(Sébastien Hinderer, review by Adrien Nader and Damien Doligez,
testing and regression fix by Andreas Hauptmann)
### Internal/compiler-libs changes:
- #673: distinguish initialization of block fields from mutation in lambda.
(Frédéric Bour, review by Xavier Leroy, Stephen Dolan and Mark Shinwell)
- #744, #781: fix duplicate self-reference in imported cmi_crcs
list in .cmti files + avoid rebuilding cmi_info record when creating
.cmti files
(Alain Frisch, report by Daniel Bünzli, review by Jérémie Dimino)
- #881: change `Outcometree.out_variant` to be more general.
`Ovar_name of out_ident * out_type list` becomes `Ovar_type of out_type`.
(Valentin Gatien-Baron, review by Leo White)
- #908: refactor PIC-handling in the s390x backend
(Gabriel Scherer, review by Xavier Leroy and Mark Shinwell)
### Bug fixes:
- #5115: protect all byterun/fail.c functions against
uninitialized caml_global_data (only changes the bytecode behavior)
(Gabriel Scherer, review by Xavier Leroy)
- #6136, #967: Fix Closure so that overapplication evaluation order
matches the bytecode compiler and Flambda.
(Mark Shinwell, report by Jeremy Yallop, review by Frédéric Bour)
- #6550, #1094: Allow creation of empty .cmxa files on macOS
(Mark Shinwell)
- #6594, #955: Remove "Istore_symbol" specific operation on x86-64.
This is more robust and in particular avoids assembly failures on Win64.
(Mark Shinwell, review by Xavier Leroy, testing by David Allsopp and
Olivier Andrieu)
- #6903: Unix.execvpe doesn't change environment on Cygwin
(Xavier Leroy, report by Adrien Nader)
- #6987: Strange error message probably caused by
universal variable escape (with polymorphic variants)
(Jacques Garrigue, report by Mikhail Mandrykin and Leo White)
- #7216, #949: don't require double parens in Functor((val x))
(Jacques Garrigue, review by Valentin Gatien-Baron)
- #7331: ocamldoc, avoid infinite loop in presence of self alias,
i.e. module rec M:sig end = M
(Florian Angeletti, review Gabriel Scherer)
- #7346, #966: Fix evaluation order problem whereby expressions could
be incorrectly re-ordered when compiling with Flambda. This also fixes one
example of evaluation order in the native code compiler not matching the
bytecode compiler (even when not using Flambda)
(Mark Shinwell, Leo White, code review by Pierre Chambart)
- #7348: Private row variables can escape their scope
(Jacques Garrigue, report by Leo White)
- #7407: Two not-quite-standard C idioms rejected by SUNWSPro compilers
(Xavier Leroy)
- #7421: Soundness bug with GADTs and lazy
(Jacques Garrigue, report by Leo White)
- #7424: Typechecker diverges on unboxed type declaration
(Jacques Garrigue, report by Stephen Dolan)
- #7426, #965: Fix fatal error during object compilation (also
introduces new [Pfield_computed] and [Psetfield_computed] primitives)
(Mark Shinwell, report by Ulrich Singer)
- #7427, #959: Don't delete let bodies in Cmmgen
(Mark Shinwell, report by Valentin Gatien-Baron)
- #7432: Linking modules compiled with -labels and -nolabels is not safe
(Jacques Garrigue, report by Jeremy Yallop)
- #7437: typing assert failure with nonrec priv
(Jacques Garrigue, report by Anil Madhavapeddy)
- #7438: warning +34 exposes #row with private types
(Alain Frisch, report by Anil Madhavapeddy)
- #7443, #990: spurious unused open warning with local open in patterns
(Florian Angeletti, report by Gabriel Scherer)
- #7456, #1092: fix slow compilation on source files containing a lot
of similar debugging information location entries
(Mark Shinwell)
- #7504: fix warning 8 with unconstrained records
(Florian Angeletti, report by John Whitington)
- #7511, #1133: Unboxed type with unboxed argument should not be accepted
(Damien Doligez, review by Jeremy Yallop and Leo White)
- #805, #815, #833: check for integer overflow in String.concat
(Jeremy Yallop,
review by Damien Doligez, Alain Frisch, Daniel Bünzli, Fabrice Le Fessant)
- #881: short-paths did not apply to some polymorphic variants
(Valentin Gatien-Baron, review by Leo White)
- #886: Fix Ctype.moregeneral's handling of row_name
(Leo White, review by Jacques Garrigue)
- #934: check for integer overflow in Bytes.extend
(Jeremy Yallop, review by Gabriel Scherer)
- #956: Keep possibly-effectful expressions when optimizing multiplication
by zero.
(Jeremy Yallop, review by Nicolás Ojeda Bär, Xavier Leroy and Mark Shinwell)
- #977: Catch Out_of_range in ocamldebug's "list" command
(Yunxing Dai)
- #983: Avoid removing effectful expressions in Closure, and
eliminate more non-effectful ones
(Alain Frisch, review by Mark Shinwell and Gabriel Scherer)
- #987: alloc_sockaddr: don't assume a null terminator. It is not inserted
on macOS by system calls that fill in a struct sockaddr (e.g. getsockname).
(Anton Bachin)
- #998: Do not delete unused closures in un_anf.ml.
(Leo White, review by Mark Shinwell and Pierre Chambart)
- #1019: Fix fatal error in Flambda mode "[functions] does not map set of
closures ID"
(Pierre Chambart, code review by Mark Shinwell and Leo White)
- #1075: Ensure that zero-sized float arrays have zero tags.
(Mark Shinwell, Leo White, review by Xavier Leroy)
* #1088: Gc.minor_words now returns accurate numbers.
(compatibility: the .mli declaration of `Gc.minor_words`
and `Gc.get_minor_free` changed, which may break libraries
re-exporting these values.)
(Stephen Dolan, review by Pierre Chambart and Xavier Leroy)
OCaml 4.04.2 (23 Jun 2017):
---------------------------
### Security fix:
- #7557: Local privilege escalation issue with ocaml binaries.
(Damien Doligez, report by Eric Milliken, review by Xavier Leroy)
OCaml 4.04.1 (14 Apr 2017):
---------------------------
### Standard library:
- #7403, #894: fix a bug in Set.map as introduced in 4.04.0
(Gabriel Scherer, report by Thomas Leonard)
### Tools:
- #7411: ocamldoc, avoid nested <pre> tags in module description.
(Florian Angeletti, report by user 'kosik')
- #7488: ocamldoc, wrong Latex output for variant types
with constructors without arguments.
(Florian Angeletti, report by Xavier Leroy)
### Build system:
- #7373, #1023: New flexlink target in Makefile.nt to bootstrap the
flexlink binary only, rather than the flexlink binary and the FlexDLL C
objects.
(David Allsopp)
### Bug fixes:
- #7369: Str.regexp raises "Invalid_argument: index out of bounds"
(Damien Doligez, report by John Whitington)
- #7373, #1023: Fix ocamlmklib with bootstrapped FlexDLL. Bootstrapped
FlexDLL objects are now installed to a subdirectory flexdll of the Standard
Library which allows the compilers to pick them up explicitly and also
ocamlmklib to include them without unnecessarily adding the entire Standard
Library.
(David Allsopp)
- #7385, #1057: fix incorrect timestamps returned by Unix.stat on Windows
when either TZ is set or system date is in DST.
(David Allsopp, report and initial fix by Nicolás Ojeda Bär, review and
superior implementation suggestion by Xavier Leroy)
- #7405, #903: s390x: Fix address of caml_raise_exn in native dynlink
modules.
(Richard Jones, review by Xavier Leroy)
- #7417, #930: ensure 16 byte stack alignment inside caml_allocN on x86-64
for ocaml build with WITH_FRAME_POINTERS defined
(Christoph Cullmann)
- #7456, #1092: fix slow compilation on source files containing a lot
of similar debugging information location entries
(Mark Shinwell)
- #7457: a case of double free in the systhreads library (POSIX
implementation).
(Xavier Leroy, report by Chet Murthy)
- #7460, #1011: catch uncaught exception when unknown files are passed
as argument (regression in 4.04.0)
(Bernhard Schommer, review by Florian Angeletti and Gabriel Scherer,
report by Stephen Dolan)
- #7505: Memory cannot be released after calling
Bigarray.Genarray.change_layout.
(Damien Doligez and Xavier Leroy, report by Liang Wang)
- #912: Fix segfault in Unix.create_process on Windows caused by wrong header
configuration.
(David Allsopp)
- #980: add dynlink options to ocamlbytecomp.cmxa to allow ocamlopt.opt
to load plugins. See http://github.com/OCamlPro/ocamlc-plugins for examples.
(Fabrice Le Fessant, review by David Allsopp)
- #992: caml-types.el: Fix missing format argument, so that it can show kind
of call at point correctly.
(Chunhui He)
- #1043: Allow Windows CRLF line-endings in ocamlyacc on Unix and Cygwin.
(David Allsopp, review by Damien Doligez and Xavier Leroy)
- #1072: Fix segfault in Sys.runtime_parameters when exception backtraces
are enabled.
(Olivier Andrieu)
OCaml 4.04.0 (4 Nov 2016):
--------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #7233: Support GADT equations on non-local abstract types
(Jacques Garrigue)
- #187, #578: Local opening of modules in a pattern.
Syntax: "M.(p)", "M.[p]","M.[| p |]", "M.{p}"
(Florian Angeletti, Jacques Garrigue, review by Alain Frisch)
- #301: local exception declarations "let exception ... in"
(Alain Frisch)
- #508: Allow shortcut for extension on semicolons: ;%foo
(Jérémie Dimino)
- #606: optimized representation for immutable records with a single
field, and concrete types with a single constructor with a single argument.
This is triggered with a [@@unboxed] attribute on the type definition.
Currently mutually recursive datatypes are not well supported, this
limitation should be lifted in the future (see #7364).
(Damien Doligez)
### Compiler user-interface and warnings:
* #6475, #464: interpret all command-line options before compiling any
files, changes (improves) the semantics of repeated -o options or -o
combined with -c see the super-detailed commit message at
https://github.com/ocaml/ocaml/commit/da56cf6dfdc13c09905c2e07f1d4849c8346eec8
(whitequark)
- #7139: clarify the wording of Warning 38
(Unused exception or extension constructor)
(Gabriel Scherer)
* #7147, #475: add colors when reporting errors generated by ppx rewriters.
Remove the `Location.errorf_prefixed` function which is no longer relevant
(Simon Cruanes, Jérémie Dimino)
- #7169, #501: clarify the wording of Warning 8
(Non-exhaustivity warning for pattern matching)
(Florian Angeletti, review and report by Gabriel Scherer)
* #591: Improve support for OCAMLPARAM: (i) do not use objects
files with -a, -pack, -shared; (ii) use "before" objects in the toplevel
(but not "after" objects); (iii) use -I dirs in the toplevel,
(iv) fix bug where -I dirs were ignored when using threads
(Marc Lasson, review by Damien Doligez and Alain Frisch)
- #648: New -plugin option for ocamlc and ocamlopt, to dynamically extend
the compilers at runtime.
(Fabrice Le Fessant)
- #684: Detect unused module declarations
(Alain Frisch)
- #706: Add a settable Env.Persistent_signature.load function so
that cmi files can be loaded from other sources. This can be used to
create self-contained toplevels.
(Jérémie Dimino)
### Standard library:
- #6279, #553: implement Set.map
(Gabriel Scherer)
- #6820, #560: Add Obj.reachable_words to compute the
"transitive" heap size of a value
(Alain Frisch, review by Mark Shinwell and Damien Doligez)
- #473: Provide `Sys.backend_type` so that user can write backend-specific
code in some cases (for example, code generator).
(Hongbo Zhang)
- #589: Add a non-allocating function to recover the number of
allocated minor words.
(Pierre Chambart, review by Damien Doligez and Gabriel Scherer)
- #626: String.split_on_char
(Alain Frisch)
- #669: Filename.extension and Filename.remove_extension
(Alain Frisch, request by Edgar Aroutiounian, review by Daniel Bünzli
and Damien Doligez)
- #674: support unknown Sys.os_type in Filename, defaulting to Unix
(Filename would previously fail at initialization time for
Sys.os_type values other than "Unix", "Win32" and "Cygwin";
mirage-os uses "xen")
(Anil Madhavapeddy)
- #772 %string_safe_set and %string_unsafe_set are deprecated aliases
for %bytes_safe_set and %bytes_unsafe_set.
(Hongbo Zhang and Damien Doligez)
### Other libraries
- #4834, #592: Add a Biggarray.Genarray.change_layout function
to switch bigarrays between C and fortran layouts.
(Guillaume Hennequin, review by Florian Angeletti)
### Code generation and optimizations:
- #4747, #328: Optimize Hashtbl by using in-place updates of its
internal bucket lists. All operations run in constant stack size
and are usually faster, except Hashtbl.copy which can be much
slower
(Alain Frisch)
- #6217, #538: Optimize performance of record update:
no more performance cliff when { foo with t1 = ..; t2 = ...; ... }
hits 6 updated fields
(Olivier Nicole, review by Thomas Braibant and Pierre Chambart)
- #7023, #336: Better unboxing strategy
(Alain Frisch, Pierre Chambart)
- #7244, #840: Ocamlopt + flambda requires a lot of memory
to compile large array literal expressions
(Pierre Chambart, review by Mark Shinwell)
- #7291, #780: Handle specialisation of recursive function that does
not always preserve the arguments
(Pierre Chambart, Mark Shinwell, report by Simon Cruanes)
- #7328, #702: Do not eliminate boxed int divisions by zero and
avoid checking twice if divisor is zero with flambda.
(Pierre Chambart, report by Jeremy Yallop)
- #427: Obj.is_block is now an inlined OCaml function instead of a
C external. This should be faster.
(Demi Marie Obenour)
- #580: Optimize immutable float records
(Pierre Chambart, review by Mark Shinwell)
- #602: Do not generate dummy code to force module linking
(Pierre Chambart, reviewed by Jacques Garrigue)
- #703: Optimize some constant string operations when the "-safe-string"
configure time option is enabled.
(Pierre Chambart)
- #707: Load cross module information during a meet
(Pierre Chambart, report by Leo White, review by Mark Shinwell)
- #709: Share a few more equal switch branches
(Pierre Chambart, review by Gabriel Scherer)
- #712: Small improvements to type-based optimizations for array
and lazy
(Alain Frisch, review by Pierre Chambart)
- #714: Prevent warning 59 from triggering on Lazy of constants
(Pierre Chambart, review by Leo White)
- #723 Sort emitted functions according to source location
(Pierre Chambart, review by Mark Shinwell)
- Lack of type normalization lead to missing simple compilation for "lazy x"
(Alain Frisch)
### Runtime system:
- #7203, #534: Add a new primitive caml_alloc_float_array to allocate an
array of floats
(Thomas Braibant)
- #7210, #562: Allows to register finalisation function that are
called only when a value will never be reachable anymore. The
drawbacks compared to the existing one is that the finalisation
function is not called with the value as argument. These finalisers
are registered with `GC.finalise_last`
(François Bobot reviewed by Damien Doligez and Leo White)
- #247: In previous OCaml versions, inlining caused stack frames to
disappear from stacktraces. This made debugging harder in presence of
optimizations, and flambda was going to make this worse. The debugging
information produced by the compiler now enables the reconstruction of the
original backtrace. Use `Printexc.get_raw_backtrace_next_slot` to traverse
the list of inlined stack frames.
(Frédéric Bour, review by Mark Shinwell and Xavier Leroy)
- #590: Do not perform compaction if the real overhead is less than expected
(Thomas Braibant)
### Tools:
- #7189: toplevel #show, follow chains of module aliases
(Gabriel Scherer, report by Daniel Bünzli, review by Thomas Refis)
- #7248: have ocamldep interpret -open arguments in left-to-right order
(Gabriel Scherer, report by Anton Bachin)
- #7272, #798: ocamldoc, missing line breaks in type_*.html files
(Florian Angeletti)
- #7290: ocamldoc, improved support for inline records
(Florian Angeletti)
- #7323, #750: ensure "ocamllex -ml" works with -safe-string
(Hongbo Zhang)
- #7350, #806: ocamldoc, add viewport metadata to generated html pages
(Florian Angeletti, request by Daniel Bünzli)
- #452: Make the output of ocamldep more stable
(Alain Frisch)
- #548: empty documentation comments
(Florian Angeletti)
- #575: Add the -no-version option to the toplevel
(Sébastien Hinderer)
- #598: Add a --strict option to ocamlyacc treat conflicts as errors
(this option is now used for the compiler's parser)
(Jeremy Yallop)
- #613: make ocamldoc use -open arguments
(Florian Angeletti)
- #718: ocamldoc, fix order of extensible variant constructors
(Florian Angeletti)
### Debugging and profiling:
- #585: Spacetime, a new memory profiler (Mark Shinwell, Leo White)
### Manual and documentation:
- #7007, #7311: document the existence of OCAMLPARAM and
ocaml_compiler_internal_params
(Damien Doligez, reports by Wim Lewis and Gabriel Scherer)
- #7243: warn users against using WinZip to unpack the source archive
(Damien Doligez, report by Shayne Fletcher)
- #7245, #565: clarification to the wording and documentation
of Warning 52 (fragile constant pattern)
(Gabriel Scherer, William, Adrien Nader, Jacques Garrigue)
- #PR7265, #769: Restore 4.02.3 behaviour of Unix.fstat, if the
file descriptor doesn't wrap a regular file (win32unix only)
(Andreas Hauptmann, review by David Allsopp)
- #7288: flatten : Avoid confusion
(Damien Doligez, report by user 'tormen')
- #7355: Gc.finalise and lazy values
(Jeremy Yallop)
- #842: Document that [Store_field] must not be used to populate
arrays of values declared using [CAMLlocalN] (Mark Shinwell)
### Compiler distribution build system:
- #324: Compiler developers: Adding new C primitives to the
standard runtime doesn't require anymore to run `make bootstrap`
(François Bobot)
- #384: Fix compilation using old Microsoft C Compilers not
supporting secure CRT functions (SDK Visual Studio 2005 compiler and
earlier) and standard 64-bit integer literals (Visual Studio .NET
2002 and earlier)
(David Allsopp)
- #507: More sharing between Unix and Windows makefiles
(whitequark, review by Alain Frisch)
* #512, #587: Installed `ocamlc`, `ocamlopt`, and `ocamllex` are
now the native-code versions of the tools, if those versions were
built.
(Demi Marie Obenour)
- #525: fix build on OpenIndiana
(Sergey Avseyev, review by Damien Doligez)
- #687: "./configure -safe-string" to get a system where
"-unsafe-string" is not allowed, thus giving stronger non-local
guarantees about immutability of strings
(Alain Frisch, review by Hezekiah M. Carty)
### Bug fixes:
* #6505: Missed Type-error leads to a segfault upon record access.
(Jacques Garrigue, extra report by Stephen Dolan)
Proper fix required a more restrictive approach to recursive types:
mutually recursive types are seen as abstract types (i.e. non-contractive)
when checking the well-foundedness of the recursion.
* #6752: Nominal types and scope escaping.
Revert to strict scope for non-generalizable type variables, cf. Mantis.
Note that this is actually stricter than the behavior before 4.03,
cf. #7313, meaning that you may sometimes need to add type annotations
to explicitly instantiate non-generalizable type variables.
(Jacques Garrigue, following discussion with Jeremy Yallop,
Nicolás Ojeda Bär and Alain Frisch)
- #7112: Aliased arguments ignored for equality of module types
(Jacques Garrigue, report by Leo White)
- #7134: compiler forcing aliases it shouldn't while reporting type errors
(Jacques Garrigue, report and suggestion by sliquister)
- #7153: document that Unix.SOCK_SEQPACKET is not really usable.
- #7165, #494: uncaught exception on invalid lexer directive
(Gabriel Scherer, report by KC Sivaramakrishnan using afl-fuzz)
- #7257, #583: revert a 4.03 change of behavior on (Unix.sleep 0.),
it now calls (nano)sleep for 0 seconds as in (< 4.03) versions.
(Hannes Mehnert, review by Damien Doligez)
- #7259 and #603: flambda does not collapse pattern matching
in some cases
(Pierre Chambart, report by Reed Wilson, review by Mark Shinwell)
- #7260: GADT + subtyping compile time crash
(Jacques Garrigue, report by Nicolás Ojeda Bär)
- #7269: Segfault from conjunctive constraints in GADT
(Jacques Garrigue, report by Stephen Dolan)
- #7276: Support more than FD_SETSIZE sockets in Windows' emulation
of select
(David Scott, review by Alain Frisch)
* #7278: Prevent private inline records from being mutated
(Alain Frisch, report by Pierre Chambart)
- #7284: Bug in mcomp_fields leads to segfault
(Jacques Garrigue, report by Leo White)
- #7285: Relaxed value restriction broken with principal
(Jacques Garrigue, report by Leo White)
- #7297: -strict-sequence turns off Warning 21
(Jacques Garrigue, report by Valentin Gatien-Baron)
- #7299: remove access to OCaml heap inside blocking section in win32unix
(David Allsopp, report by Andreas Hauptmann)
- #7300: remove access to OCaml heap inside blocking in Unix.sleep on Windows
(David Allsopp)
- #7305: -principal causes loop in type checker when compiling
(Jacques Garrigue, report by Anil Madhavapeddy, analysis by Leo White)
- #7330: Missing exhaustivity check for extensible variant
(Jacques Garrigue, report by Elarnon *)
- #7374: Contractiveness check unsound with constraints
(Jacques Garrigue, report by Leo White)
- #7378: GADT constructors can be re-exposed with an incompatible type
(Jacques Garrigue, report by Alain Frisch)
- #7389: Unsoundness in GADT exhaustiveness with existential variables
(Jacques Garrigue, report by Stephen Dolan)
* #533: Thread library: fixed [Thread.wait_signal] so that it
converts back the signal number returned by [sigwait] to an
OS-independent number
(Jérémie Dimino)
- #600: (similar to #555) ensure that register typing constraints are
respected at N-way join points in the control flow graph
(Mark Shinwell)
- #672: Fix float_of_hex parser to correctly reject some invalid forms
(Bogdan Tătăroiu, review by Thomas Braibant and Alain Frisch)
- #700: Fix maximum weak bucket size
(Nicolás Ojeda Bär, review by François Bobot)
- #708 Allow more module aliases in strengthening (Leo White)
- #713, #7301: Fix wrong code generation involving lazy values in Flambda
mode
(Mark Shinwell, review by Pierre Chambart and Alain Frisch)
- #721: Fix infinite loop in flambda due to [@@specialise] annotations
- #779: Building native runtime on Windows could fail when bootstrapping
FlexDLL if there was also a system-installed flexlink
(David Allsopp, report Michael Soegtrop)
- #805, #815, #833: check for integer overflow in String.concat
(Jeremy Yallop,
review by Damien Doligez, Alain Frisch, Daniel Bünzli, Fabrice Le Fessant)
- #810: check for integer overflow in Array.concat
(Jeremy Yallop)
- #814: fix the Buffer.add_substring bounds check to handle overflow
(Jeremy Yallop)
- #880: Fix [@@inline] with default parameters in flambda (Leo White)
* #1353: add labels to BytesLabels.sub_string (Jacques Garrigue)
### Internal/compiler-libs changes:
- #7200, #539: Improve, fix, and add test for parsing/pprintast.ml
(Runhang Li, David Sheets, Alain Frisch)
- #351: make driver/pparse.ml functions type-safe
(Gabriel Scherer, Dmitrii Kosarev, review by Jérémie Dimino)
- #516: Improve Texp_record constructor representation, and
propagate updated record type information
(Pierre Chambart, review by Alain Frisch)
- #678: Graphics.close_graph crashes 64-bit Windows ports (re-implementation
of #3963)
(David Allsopp)
- #679: delay registration of docstring after the mapper is applied
(Hugo Heuzard, review by Leo White)
- #872: don't attach (**/**) comments to any particular node
(Thomas Refis, review by Leo White)
OCaml 4.03.0 (25 Apr 2016):
---------------------------
(Changes that can break existing programs are marked with a "*")
### Language features:
- #5528: inline records for constructor arguments
(Alain Frisch)
- #6220, #6403, #6437, #6801:
Improved redundancy and exhaustiveness checks for GADTs.
Namely, the redundancy checker now checks whether the uncovered pattern
of the pattern is actually inhabited, exploding at most one wild card.
This is also done for exhaustiveness when there is only one case.
Additionally, one can now write unreachable cases, of the form
"pat -> .", which are treated by the redundancy check.
(Jacques Garrigue)
- #6374: allow "_ t" as a short-hand for "(_, _, ..) t" for n-ary type
constructors
(Alain Frisch)
- #6714: allow [@@ocaml.warning] on most structure and signature items:
values, modules, module types
(whitequark)
- #6806: Syntax shortcut for putting a type annotation on a record field:
{ f1 : typ = e } is sugar for { f1 = (e : typ) }
{ f1 : typ } is sugar for { f1 = (f1 : typ) }
(Valentin Gatien-Baron, review by Jérémie Dimino)
- #6806: Allow type annotations before the "->" in "fun <args> -> <expr>"
fun x y : (int * int) -> (x, y)
(Valentin Gatien-Baron, review by Jérémie Dimino)
- #26: support for "(type a b)" as syntactic sugar for "(type a) (type b)"
(Gabriel Scherer)
- #42: short functor type syntax: "S -> T" for "functor (_ : S) -> T"
(Leo White)
- #88: allow field punning in object copying expressions:
{< x; y; >} is sugar for {< x = x; y = y; >}
(Jeremy Yallop)
- #112: octal escape sequences for char and string literals
"Make it \o033[1mBOLD\o033[0m"
(Rafaël Bocquet, request by John Whitington)
- #167: allow to annotate externals' arguments and result types so
they can be unboxed or untagged: [@unboxed], [@untagged]. Supports
untagging int and unboxing int32, int64, nativeint and float.
(Jérémie Dimino, Mark Shinwell)
- #173: [@inline] and [@inlined] attributes (for function declarations
and call sites respectively) to control inlining
(Pierre Chambart, Mark Shinwell)
- #188: accept [@@immediate] attribute on type declarations to mark types
that are represented at runtime by an integer
(Will Crichton, reviewed by Leo White)
* #234: allow "[]" as a user-defined constructor. Demand parenthesis
around "::" when using "::" as user-defined constructor:
code using "| :: of ..." must change to "| (::) of ...".
(Runhang Li, review by Damien Doligez)
- #240: replace special annotations on externals by attributes:
* "float" is generalized to [@@unboxed]
* "noalloc" becomes [@@noalloc]
Deprecate "float" and "noalloc".
(Jérémie Dimino)
- #254: @ocaml.warn_on_literal_pattern attribute on constructors to
warn when the argument is matches against a constant pattern. This
attribute is applied on predefined exception constructors which
carry purely informational (with no stability guarantee) messages.
(Alain Frisch)
- #268: hexadecimal notation for floating-point literals: -0x1.ffffp+987
In OCaml source code, FP literals can be written using the hexadecimal
notation 0x<mantissa in hex>p<exponent> from ISO C99.
(Xavier Leroy)
- #273: allow to get the extension slot of an extension constructor
by writing [%extension_constructor <path>]
(Jérémie Dimino)
- #282: change short-paths penalty heuristic to assign the same cost to
idents containing double underscores as to idents starting with an underscore
(Thomas Refis, Leo White)
- #6681 #326: signature items are now accepted as payloads for
extension and attributes, using the syntax [%foo: SIG ] or [@foo: SIG ].
Examples: "[%%client: val foo : int]" or "val%client foo : int".
(Alain Frisch and Gabriel Radanne)
* #342: Allow shortcuts for extension and attributes on all keywords:
module%foo, class[@foo], etc.
The attribute in "let[@foo] .. in .." is now attached to the value binding,
not to the expression.
(Gabriel Radanne)
### Compilers:
* #4231, #5461: warning 31 is now fatal by default
(Warning 31: A module is linked twice in the same executable.)
This is an interim solution; double-linking of modules has dangerous
semantics, eg. exception constructors end up with two distinct declarations.
(Alain Frisch)
- #4800: better compilation of tuple assignment
(Gabriel Scherer and Alain Frisch)
- #5995: keep -for-pack into account to name exceptions;
-for-pack should now be used during bytecode compilation as well
(Alain Frisch, report by Christophe Troestler)
- #6400: better error message for '_' used as an expression
(Alain Frisch, report by whitequark)
- #6501: harden the native-code generator against certain uses of "%identity"
(Xavier Leroy, report by Antoine Miné)
- #6636: add --version option
(whitequark)
- #6679: fix pprintast printing of constraints in type declarations
(Alain Frisch, report by Jun Furuse)
- #6737: fix Typedtree attributes on (fun x -> body) expressions
(Alain Frisch, report by Oleg Kiselyov)
* #6865: remove special case for parsing "let _ = expr" in structures
(Jérémie Dimino, Alain Frisch)
* #6438, #7059, #315: Pattern guard disables exhaustiveness check
(function Some x when x = 0 -> ()) will now raise warning 8 (non-exhaustive)
instead of warning 25 (all clauses are guarded). 25 isn't raised anymore.
Projects that set warning 8 as an error may fail to compile (presumably
this is the semantics they wanted).
(Alain Frisch, request by Martin Jambon and John Whitington)
- #6920: fix debug information around uses of %apply or %revapply
(Jérémie Dimino, report by Daniel Bünzli)
- #6939: Segfault with improper use of let-rec
(Alain Frisch)
- #6943: native-code generator for POWER/PowerPC 64 bits, both in
big-endian (ppc64) and little-endian (ppc64le) configuration,
inspired from RedHat's unofficial ppc64 and ppc64le ports
(Xavier Leroy)
- #6979: better code generation in x86-32 backend for copying floats to
the stack
(Marc Lasson, review by Xavier Leroy)
- #7018: fix missing identifier renaming during inlining
(Alain Frisch, review by Xavier Leroy)
- #7022, #259: unbox float and boxed ints earlier, avoid second pass
(Alain Frisch)
- #7026, #288: remove write barrier for polymorphic variants without
arguments
(Simon Cruanes)
- #7031: new warning 57, ambiguous guarded or-patterns
(Luc Maranget, Gabriel Scherer, report by Martin Clochard and Claude Marché)
- #7064, #316: allowing to mark compilation units and sub-modules as
deprecated
(Alain Frisch)
- #7067: fix performance regression (wrt. 4.01) in the native compiler
for long nested structures
(Alain Frisch, report by Daniel Bünzli, review by Jacques Garrigue)
- #7097: fix strange syntax error message around illegal packaged module
signature constraints
(Alain Frisch, report by Jun Furuse)
- #7118, #7120, #408, #476: Bug fixed in stack unwinding
metadata generation. Was a cause of crashes in GUI programs on OS X.
(Bart Jacobs, review by Mark Shinwell)
- #7168: Exceeding stack limit in bytecode can lead to a crash.
(Jacques-Henri Jourdan)
- #7232: Strange Pprintast output with ppx_deriving
(Damien Doligez, report by Anton Bachin)
- #17: some cmm optimizations of integer operations with constants
(Stephen Dolan, review by Pierre Chambart)
- #89: improve type-specialization of unapplied primitives:
unapplied annotations (compare : int -> _),
type propagation (List.sort compare [1;2;3])
and propagation from module signatures now lead to specialization
(Frédéric Bour, review by Gabriel Scherer)
- #107: Prevent more unnecessary float boxing, especially in `if` and `match`
(Vladimir Brankov, review by Alain Frisch)
- #109: new (lazy) unboxing strategy for float and int references
(Vladimir Brankov, review by Alain Frisch)
- #115: More precise typing of values at the C-- and Mach level.
(Xavier Leroy, review by Pierre Chambart)
- #132: Flambda: new intermediate language and "middle-end" optimizers
(Pierre Chambart, Mark Shinwell, Leo White)
- #212, #7226, #542: emit column position in gas assembly `.loc`
(Frédéric Bour, Anton Bachin)
- #207: Colors in compiler messages (warnings, errors)
configure with -color {auto|always|never} or TERM=dumb
(Simon Cruanes, review by Gabriel Scherer)
- #258: more precise information on PowerPC instruction sizes
(Pierre Chambart, Xavier Leroy)
- #263: improve code generation for if-equivalents of (&&) and (||)
(Pierre Chambart)
- #270: Make [transl_exception_constructor] generate [Immutable] blocks
(Mark Shinwell)
- #271: Fix incorrect mutability flag when records are built using "with"
(Mark Shinwell)
- #275: native-code generator for IBM z System running Linux.
In memoriam Gene Amdahl, 1922-2015.
(Bill O'Farrell, Tristan Amini, Xavier Leroy)
- #282: relax short-paths safety check in presence of module aliases, take
penalty into account while building the printing map.
(Thomas Refis, Leo White)
- #306: Instrument the compiler to debug performance regressions
(Pierre Chambart)
- #319: add warning 58 for missing cmx files, and
extend -opaque option to mli files: a missing .cmx does not warn
if the corresponding .cmi is compiled -opaque.
(Leo White)
- #388: OCAML_FLEXLINK environment variable allows overriding flexlink
command (David Allsopp)
- #392: put all parsetree invariants in a new module Ast_invariants
(Jérémie Dimino)
- #407: don't display the name of compiled .c files when calling the
Microsoft C Compiler (same as the assembler).
(David Allsopp)
- #431: permit constant float arrays to be eligible for pattern match
branch merging
(Pierre Chambart)
- #455: provide more debugging information to Js_of_ocaml
(Jérôme Vouillon)
- #514, #554: Added several command-line flags to explicitly enable
settings that are currently the default:
`-alias-deps`, `-app-funct`, `-no-keep-docs`, `-no-keep-locs`,
`-no-principal`, `-no-rectypes`, `-no-strict-formats`
(Demi Marie Obenour)
- #545: use reraise to preserve backtrace on
`match .. with exception e -> raise e`
(Nicolás Ojeda Bär, review by Gabriel Scherer)
### Runtime system:
* #596: make string/bytes distinguishable in the underlying
compiler implementation; caml_fill_string and caml_create_string are
deprecated and will be removed in the future, please use
caml_fill_bytes and caml_create_bytes for migration
(Hongbo Zhang, review by Damien Doligez, Alain Frisch, and Hugo Heuzard)
- #3612, #2429: allow allocating custom block with finalizers
in the minor heap.
(Pierre Chambart)
* #6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown
types {,u}int{32,64}.
C stubs may have to be updated as {,u}int{32,64}_t are not defined anymore.
(Xavier Leroy)
- #6760: closures evaluated in the toplevel can now be marshalled
(whitequark, review by Jacques-Henri Jourdan)
- #6902, #210: emit a runtime warning on stderr
when finalizing an I/O channel which is still open:
"channel opened on file '...' dies without being closed"
this is controlled by OCAMLRUNPARAM=W=1 or with Sys.enable_runtime_warnings.
The behavior of affected program is not changed,
but they should still be fixed.
(Alain Frisch, review by Damien Doligez)
- Signal handling: for read-and-clear, use GCC/Clang atomic builtins
if available.
(Xavier Leroy)
- #6910, #224: marshaling (output_value, input_value, et al)
now support marshaled data bigger than 4 Gb.
(Xavier Leroy)
* #22: The undocumented layout of weak arrays has been changed. Finalisation
functions are now run before the erasure of the corresponding values.
* #226: select higher levels of optimization for GCC >= 3.4 and Clang
when compiling the run-time system and C stub code.
"-std=gnu99 -O2 -fno-strict-aliasing -fwrapv" is used by default.
This also affects default flags for user stubs compiled with "ocamlc -c foo.c"
and may uncover bugs in them.
(Xavier Leroy)
- #262: Multiple GC roots per compilation unit
(Pierre Chambart, Mark Shinwell, review by Damien Doligez)
* #297: Several changes to improve the worst-case GC pause time.
Changes Gc.control and Gc.major_slice and adds functions to the Gc module.
(Damien Doligez, with help from François Bobot, Thomas Braibant, Leo White)
- #325: Add v=0x400 flag to OCAMLRUNPARAM to display GC stats on exit
(Louis Gesbert, review by Alain Frisch)
### Standard library:
- #7848, #230: Array.map2, Array.iter2
(John Christopher McAlpine)
- #5197, #63: Arg: allow flags such as --flag=arg as well as --flag arg
(Richard Jones)
- #6017, #7034, #267: More efficient ifprintf implementation
(Jeremy Yallop, review by Gabriel Scherer)
- #6296: Some documentation on the floating-point representations
recognized by Pervasives.float_of_string
(Xavier Leroy)
- #6316: Scanf.scanf failure on %u formats when reading big integers
(Xavier Leroy, Benoît Vaugon)
- #6321: guarantee that "hypot infinity nan = infinity"
(for conformance with ISO C99)
(Xavier Leroy)
- #6390, #36: expose Sys.{int_size,max_wosize} for js_of_ocaml portability
(Hugo Heuzard)
- #6449: Add Map.union
(Alain Frisch)
* #6494: Add 'equal' functions in modules
Bytes, Char, Digest, Int32, Int64, Nativeint, and String
Users defining their own modules with signature 'module type of Int32'
have to extend their implementation.
(Romain Calascibetta)
* #6524, #79: Filename: Optional ?perms argument to open_temp_file
May break partial applications of the function (fix by passing ?perms:None)
(Daniel Bünzli, review by Kate Deplaix)
* #6525, #80: Add Uchar module to the standard library
May introduce module name conflicts with existing projects.
(Daniel Bünzli, review by Yoriyuki Yamagata and Damien Doligez)
- #6577: improve performance of %L, %l, %n, %S, %C format specifiers
(Alain Frisch)
- #6585: fix memory leak in win32unix/createprocess.c
(Alain Frisch, report by user 'aha')
- #6645, #174: Guarantee that Set.add, Set.remove, Set.filter
return the original set if no change is required
(Alain Frisch, Mohamed Iguernlala)
- #6649, #222: accept (int_of_string "+3")
(John Christopher McAlpine)
- #6694, #6695, #124: deprecate functions using ISO-8859-1 character set
in Char, Bytes, String and provide alternatives *_acii using US-ASCII.
Affected functions:
{Char,String,Bytes}.{uppercase,lowercase},
{String,Bytes}.{capitalize,uncaptialize}
(whitequark, review by Damien Doligez)
- #22: Add the Ephemeron module that implements ephemerons and weak
hash table
(François Bobot, review by Damien Doligez, Daniel Bünzli,
Alain Frisch, Pierre Chambart)
- #164: more efficient (branchless) implementation of Pervasives.compare
specialized at type 'float'.
(Vladimir Brankov)
- #175: Guarantee that Map.add, Map.remove, Map.filter
return the original map if no change is required.
(Mohamed Iguernlala)
- #201: generalize types of Printf.{ifprintf,ikfprintf}
(Maxence Guesdon)
- #216: add the missing POSIX.1-2001 signals in Sys
(Guillaume Bury)
- #239: remove type-unsafe code from Stream
(Pierre Chambart, review by Gabriel Scherer and Jeremy Yallop)
- #250: Check for negative start element in Array.sub
(Jeremy Yallop)
- #265: new implementation of Queue avoiding Obj.magic
(Jérémie Dimino)
- #268, #303: '%h' and '%H' modifiers for printf and scanf to
support floating-point numbers in hexadecimal notation
(Xavier Leroy, Benoît Vaugon)
- #272: Switch classify_float to [@@unboxed]
(Alain Frisch)
- Improve speed of classify_float by not going through fpclassify()
(Alain Frisch, Xavier Leroy)
- #277: Switch the following externals to [@@unboxed]:
* {Nativeint,Int32,Int64}.{of,to}_float
* Int{32,64}.float_of_bits
* Int{32,64}.bits_of_float
(Jérémie Dimino)
- #281: Switch the following externals to [@@unboxed]:
* Sys.time (and [@@noalloc])
* Pervasives.ldexp (and [@@noalloc])
* Pervasives.compare for float, nativeint, int32, int64.
(François Bobot)
- #3622, #195: add function Stack.fold
(Simon Cruanes)
- #329: Add exists, for_all, mem and memq functions in Array
(Bernhard Schommer)
- #337: Add [Hashtbl.filter_map_inplace]
(Alain Frisch)
- #356: Add [Format.kasprintf]
(Jérémie Dimino, Mark Shinwell)
### Type system:
- #5545: Type annotations on methods cannot control the choice of abbreviation
(Jacques Garrigue)
* #6465: allow incremental weakening of module aliases.
This is done by adding equations to submodules when expanding aliases.
In theory this may be incompatible is some corner cases defining a module
type through inference, but no breakage known on published code.
(Jacques Garrigue)
- #6593: Functor application in tests/basic-modules fails after commit 15405
(Jacques Garrigue)
### Toplevel and debugger:
- #6113: Add descriptions to directives, and display them via #help
(Nick Giannarakis, Berke Durak, Francis Southern and Gabriel Scherer)
- #6396: Warnings-as-errors not properly flushed in the toplevel
(Alain Frisch)
- #6401: use proper error reporting for toplevel environment initialization:
no more Env.Error(_) at start time
(Gabriel Scherer, Alain Frisch)
- #6468: toplevel now supports backtraces if invoked with OCAMLRUNPARAM=b
(whitequark and Jake Donham,
review by Gabriel Scherer and Jacques-Henri Jourdan)
- #6906: wrong error location for unmatched paren with #use in toplevel
(Damien Doligez, report by Kenichi Asai)
- #6935, #298: crash in debugger when load_printer is given a directory
(Junsong Li, review by Gabriel Scherer)
- #7081: report preprocessor warnings in the toplevel
(Valentin Gatien-Baron, review by Jérémie Dimino)
- #7098: Loss of ppx context in toplevel after an exception
(Alain Frisch, report by whitequark)
- #7101: The toplevel does not close in_channel for libraries specified on
its command line
(Alain Frisch)
- #7119: the toplevel does not respect [@@@warning]
(Alain Frisch, report by Gabriel Radanne)
### Other libraries:
* Unix library: channels created by Unix.in_channel_of_descr or
Unix.out_channel_of_descr no longer support text mode under Windows.
Calling [set_binary_mode_{in,out} chan false] on these channels
now causes an error.
(Xavier Leroy)
- #4023 and #68: add Unix.sleepf (sleep with sub-second resolution)
(Evgenii Lepikhin and Xavier Leroy)
* Protect Unix.sleep against interruptions by handled signals.
Before, a handled signal could cause Unix.sleep to return early.
Now, the sleep is restarted until the given time is elapsed.
(Xavier Leroy)
* #6120, #462: implement Unix.symlink and Unix.readlink on
Windows. Unix.symlink has a new optional argument to_dir (ignored on
non-native Windows platforms). stat functions reimplemented to avoid
buggy Microsoft CRT implementations (native Windows only)
(David Allsopp, review by Daniel Bünzli)
- #6263: add kind_size_in_bytes and size_in_bytes functions
to Bigarray module.
(Runhang Li, review by Mark Shinwell)
- #6289: Unix.utimes uses the current time only if both arguments
are exactly 0.0. Also, use sub-second resolution if available.
(Xavier Leroy, report by Christophe Troestler)
- #6896: serious reimplementation of Big_int.float_of_big_int and
Ratio.float_of_ratio, ensuring that the result is correctly rounded.
(Xavier Leroy)
- #6989: in Str library, make sure that all \(...\) groups are binding
and can be consulted with Str.matched_group. There used to be
a limitation to 32 binding groups.
(Xavier Leroy)
- #7013: spurious wake-up in the Event module
(Xavier Leroy)
- #7024: in documentation of Str regular expressions, clarify what
"end of line" means for "^" and "$" regexps.
(Xavier Leroy, question by Fredrik Lindgren)
- #7209: do not run at_exit handlers in [Unix.create_process] and
similar functions when the [exec] call fails in the child process
(Jérémie Dimino)
### OCamldep:
- #286: add support for module aliases
(Jacques Garrigue)
### Manual:
- #302: The OCaml reference manual is now included in the manual/
subdirectory of the main OCaml source repository. Contributions to
the manual are warmly welcome.
(François Bobot, review by Florian Angeletti)
- #6601: replace strcpy with caml_strdup in sample code
(Christopher Zimmermann)
- #6676: ongoing simplification of the "Language Extensions" section
(Alain Frisch, John Whitington)
- #6898: Update win32 support documentation of the Unix library
(Damien Doligez, report by Daniel Bünzli)
- #7092, #379: Add missing documentation for new 4.03 features
(Florian Angeletti)
- #7094, #468, #551: add new section 8.5 to document warnings
The general idea is to document warnings that may require explanations.
Currently documented warnings are:
- 52: Fragile constant pattern.
- 57: Ambiguous or-pattern variables under guard
(Florian Angeletti and Gabriel Scherer)
- #7109, #380: Fix bigarray documentation layout
(Florian Angeletti, Leo White)
### Bug fixes:
- #3612: memory leak in bigarray read from file
(Pierre Chambart, report by Gary Huber)
* #4166, #6956: force linking when calling external C primitives
(Jacques Garrigue, reports by Markus Mottl and Christophe Troestler)
* #4466, #5325: under Windows, concurrent read and write operations
on the same socket could block unexpectedly. Fixed by keeping sockets
in asynchronous mode rather than creating them in synchronous mode.
(Xavier Leroy)
* #4539: change exception string raised when comparing functional values
May break programs matching on the string argument of Invalid_argument.
Matching on the string argument of Invalid_argument or Failure is a
programming mistake: these strings may change in future versions.
(Nicolas Braud-Santoni, report by Eric Cooper)
- #4832: Filling bigarrays may block out runtime
(Markus Mottl)
- #5663: program rejected due to nongeneralizable type variable that
appears nowhere
(Jacques Garrigue, report by Stephen Weeks)
- #5780: report more informative type names in GADTs error messages
(Jacques Garrigue, report by Sebastien Furic)
- #5887: move the byterun/*.h headers to byterun/caml/*.h to avoid header
name clashes
(Jérôme Vouillon and Adrien Nader and whitequark)
* #6081: ocaml now adds script's directory to search path, not current
directory
(Thomas Leonard and Damien Doligez)
- #6108, #6802: fail cleanly if dynlink.cma or ocamltoplevel.cma
are loaded inside the toplevel loop.
(Xavier Leroy)
- #6171: Confusing error message when a type escapes its scope.
(Jacques Garrigue and Leo White, report by John Whitington)
- #6340: Incorrect handling of \r when processing "Windows" source files
(Damien Doligez, report by David Allsopp)
- #6342: Incorrect error message when type constraints differ
(Alain Frisch, report by Philippe Wang)
* #6521: {Bytes,Char,String}.escaped were locale-dependent
we now escape all non-ASCII-printable instead of a locale-dependent subset.
(Damien Doligez, report by Jun Furuse)
- #6526: ocamllex should not warn on unescaped newline inside comments
(Damien Doligez, report by user 'dhekir')
- #6341: ocamldoc -colorize-code adds spurious <br> tags to <pre> blocks
(Maxence Guesdon, report by Damien Doligez)
- #6560: Wrong failure message for {Int32,Int64,NativeInt}.of_string
It reported (Failure "int_of_string"), now "Int32.of_string" etc.
(Maxime Dénès and Gabriel Scherer)
- #6648: show_module should indicate its elision
(Jacques Garrigue, report by Leo White)
- #6650: Cty_constr not handled correctly by Subst
(Jacques Garrigue, report by Leo White)
- #6651: Failing component lookup
(Jacques Garrigue, report by Leo White)
* #6664: Crash when finalising lazy values of the wrong type.
(Damien Doligez)
- #6672: Unused variance specification allowed in with constraint
(Jacques Garrigue, report by Leo White)
- #6677: Allow to disable warning 39 (useless "rec") with [@ocaml.warning]
applied to the first value binding of the would-be "rec" declaration
(Alain Frisch, report by Jun Furuse)
- #6744: Univars can escape through polymorphic variants (partial fix)
(Jacques Garrigue, report by Leo White)
- #6752: Extensible variant types and scope escaping
A side-effect of the fix is that (ocamlc -i) sometimes reports
(type-sound) invalid signature, with a type used before its declaration.
(Jacques Garrigue, report by Maxence Guesdon)
- #6762: improve warning 45 in presence of re-exported type definitions
(Warning 45: open statement shadows the constructor)
(Alain Frisch, report by Olivier Andrieu)
- #6776: Failure to kill the "tick" thread, segfault when exiting the runtime
(Damien Doligez, report by Thomas Braibant)
- #6780: Poor error message for wrong -farch and -ffpu options (ocamlopt, ARM)
(Xavier Leroy, report by whitequark)
- #6805: Duplicated expression in case of hole in a non-failing switch.
(Luc Maranget)
* #6808: the parsing of OCAMLRUNPARAM is too lax
(Damien Doligez)
- #6874: Inefficient code generated for module function arguments
(Jacques Garrigue, report by Markus Mottl)
- #6888: The list command of ocamldebug uses the wrong file
(Damien Doligez, report by Pierre-Marie Pédrot)
- #6897: Bad error message for some pattern matching on extensible variants
(Alain Frisch, report by Gabriel Radanne)
- #6899: Optional parameters and non generalizable type variables
(Thomas Refis and Leo White)
- #6907: Stack overflow printing error in class declaration
(Jacques Garrigue, report by Ivan Gotovchits)
- #6931: Incorrect error message on type error inside record construction
(Damien Doligez, report by Leo White)
- #6938: fix regression on "%047.27{l,L,n}{d,i,x,X,o,u}"
(Benoît Vaugon, report by Arduino Cascella)
- #6944: let module X = Path in … is not typed as a module alias
(Jacques Garrigue, report by Frédéric Bour)
- #6945 and #227: protect Sys and Unix functions against string
arguments containing the null character '\000'
(Simon Cruanes and Xavier Leroy, report by Daniel Bünzli)
- #6946: Uncaught exception with wrong type for "%ignore"
(Jacques Garrigue, report by Leo White)
- #6954: Infinite loop in type checker with module aliases
(Jacques Garrigue, report by Markus Mottl)
- #6972, #276: 4.02.3 regression on documentation comments in .cmt files
(Leo White, report by Olivier Andrieu)
- #6977: String literals in comments interpret escape sequences
(Damien Doligez, report by Daniel Bünzli and David Sheets)
- #6980: Assert failure from polymorphic variants and existentials
(Jacques Garrigue, report by Leo White)
- #6981: Ctype.Unify(_) with associated functor arg referring to previous one
(Jacques Garrigue, report by Nicholas Labich)
- #6982: unexpected type error when packing a module alias
(Jacques Garrigue, report by Valentin Gatien-Baron)
- #6985: `module type of struct include Bar end exposes
%s#row when Bar contains private row types
(Jacques Garrigue, report by Nicholas Labich)
- #6992: Segfault from bug in GADT/module typing
(Jacques Garrigue, report by Stephen Dolan)
- #6993: Segfault from recursive modules violating exhaustiveness assumptions
(Jacques Garrigue, report by Stephen Dolan)
- #6998: Typer fails reading unnecessary cmis with -no-alias-deps and -w -49
(Leo White, report by Valentin Gatien-Baron)
- #7003: String.sub may cause segmentation fault on sizes above 2^31
(Damien Doligez, report by Radek Micek)
- #7008: Fatal error in ocamlc with empty compilation unit name
(Damien Doligez, report by Cesar Kunz)
- #7012: Variable name forgotten when it starts with a capital letter
(Jacques Garrigue, Gabriel Scherer,
report by Thomas Leonard and Florian Angeletti)
- #7016: fix Stack overflow in GADT typing
Note: Equi-recursive types are considered when checking GADT pattern
exhaustiveness, even when -rectypes is not used.
(Jacques Garrigue, report by Mikhail Mandrykin)
- #7030: libasmrun_shared.so fails to build on SPARC Solaris
(report and fix by Patrick Star)
- #7036: Module alias is not taken into account when checking module
type compatibility (in a class type)
(Jacques Garrigue)
- #7037: more reproducible builds, don't put temp file names into objects
(Xavier Leroy)
- #7038: out of memory condition in caml_io_mutex_lock
(Xavier Leroy, report by Marc Lasson)
- #7039: Unix.getsockname returns garbage for unnamed PF_UNIX sockets
(Xavier Leroy)
- #7042 and #295: CSE optimization confuses the FP literals +0.0 and -0.0
(Xavier Leroy)
- #7075: Fix repetitions in ocamldoc generated documentation
(Florian Angeletti)
- #7082: Object type in recursive module's `with` annotation
(Jacques Garrigue and Alain Frisch, report by Nicholas Labich)
- #7096: ocamldoc uses an incorrect subscript/superscript style
(Gabriel Scherer, report by user 'pierpa')
- #7108: ocamldoc, have -html preserve custom/extended html generators
(Armaël Guéneau)
- #7111: reject empty let bindings instead of printing incorrect syntax
(Jérémie Dimino)
* #7113: -safe-string can break GADT compatibility check
bytes and string are now considered compatible even with -safe-string,
which may break exhaustivity for code assuming they were disjoint
(Jacques Garrigue, report by Jeremy Yallop)
- #7115: shadowing in a branch of a GADT match breaks unused variable warning
(Alain Frisch, report by Valentin Gatien-Baron)
- #7133, #450: generate local jump labels on OS X
(Bart Jacobs)
- #7135: only warn about ground coercions in -principal mode
(Jacques Garrigue, report by Jeremy Yallop)
* #7152: Typing equality involving non-generalizable type variable
A side-effect of the fix is that, for deeply nested non generalizable
type variables, having an interface file may no longer be sufficient,
and you may have to add a local type annotation (cf #7313)
(Jacques Garrigue, report by François Bobot)
- #7160: Type synonym definitions can weaken gadt constructor types
(Jacques Garrigue, report by Mikhail Mandrykin)
- #7181: Misleading error message with GADTs and polymorphic variants
(Jacques Garrigue, report by Pierre Chambart)
- #7182: Assertion failure with recursive modules and externals
(Jacques Garrigue, report by Jeremy Yallop)
- #7196: "let open" is not correctly pretty-printed to the left of a ';'
(Gabriel Scherer, report by Christophe Raffalli)
- #7214: Assertion failure in Env.add_gadt_instances
(Jacques Garrigue, report by Stephen Dolan)
- #7220: fix a memory leak when using both threads and exception backtraces
(Gabriel Scherer, review by François Bobot, report by Rob Hoes)
- #7222: Escaped existential type
(Jacques Garrigue, report by Florian Angeletti)
- #7230: Scrutinee discarded in match with only refutation cases
(Jacques Garrigue, report by Jeremy Yallop)
- #7234: Compatibility check wrong for abstract type constructors
(Jacques Garrigue, report by Stephen Dolan)
- #7324: OCaml 4.03.0 type checker dies with an assert failure when
given some cyclic recursive module expression
(Jacques Garrigue, report by jmcarthur)
- #7368: Manual major GC fails to compact the heap
(Krzysztof Pszeniczny)
- #205: Clear caml_backtrace_last_exn before registering as root
(report and fix by Frédéric Bour)
- #220: minor -dsource error on recursive modules
(Hongbo Zhang)
- #228: fix a dangling internal pointer in (bytecode) debug_info
(Gabriel Scherer and Mark Shinwell and Xavier Leroy)
- #233: Make CamlinternalMod.init_mod robust to optimization
(Pierre Chambart, Mark Shinwell)
- #249: fix a few hardcoded ar commands
(Daniel Bünzli)
- #251: fix cross-compilation with ocamldoc enabled
(whitequark)
- #280: Fix stdlib dependencies for .p.cmx
(Pierre Chambart, Mark Shinwell)
- #283: Fix memory leaks in intern.c when OOM is raised
(Marc Lasson, review by Alain Frisch)
- #22: Fix the cleaning of weak pointers. In very rare cases
accessing a value during the cleaning of the weak pointers could
result in the value being removed from one weak arrays and kept in
another one. That breaks the property that a value is removed from a
weak pointer only when it is dead and garbage collected.
(François Bobot, review by Damien Doligez)
- #313: Prevent quadratic cases in CSE
(Pierre Chambart, review by Xavier Leroy)
- #6795, #6996: Make ocamldep report errors passed in
[%ocaml.error] extension points
(Jérémie Dimino)
- #355: make ocamlnat build again
(Jérémie Dimino, Thomas Refis)
- #405: fix compilation under Visual Studio 2015
(David Allsopp)
- #441: better type error location in presence of type constraints
(Thomas Refis, report by Arseniy Alekseyev)
- #477: reallow docstrings inside object types, and inside polymorphic
variant and arrow types
(Thomas Refis)
### Features wishes:
- #4518, #29: change location format for reporting errors in ocamldoc
(Sergei Lebedev)
- #4714: List.cons
- #5418 (comments) : generate dependencies with $(CC) instead of gcc
(Damien Doligez, report by Michael Grünewald)
- #6167: OCAMLPARAM support for disabling PIC generation ("pic=0")
(Gabor Pali)
- #6367, #25: introduce Asttypes.arg_label to encode labelled arguments
(Frédéric Bour and Jacques Garrigue)
- #6452, #140: add internal support for custom printing formats
(Jérémie Dimino)
- #6611: remove the option wrapper on optional arguments in the syntax tree
(Alain Frisch, review by Damien Doligez, request by whitequark)
- #6635: support M.[], M.(), M.{< >} and M.[| |]
(Jeremy Yallop, review by Gabriel Radanne)
- #6691: install .cmt[i] files for stdlib and compiler-libs
(David Sheets, request by Gabriel Radanne)
- #6722: compatibility with x32 architecture (x86-64 in ILP32 mode).
ocamlopt is not supported, but bytecode compiles cleanly.
(Adam Borowski and Xavier Leroy)
- #6742: remove duplicate virtual_flag information from Tstr_class
(Gabriel Radanne and Jacques Garrigue)
- #6719: improve Buffer.add_channel when not enough input is available
(Simon Cruanes)
* #6816: reject integer and float literals directly followed by an identifier.
This was previously read as two separate tokens.
[let abc = 1 in (+) 123abc] was accepted and is now rejected.
(Hugo Heuzard)
- #6876: improve warning 6 by listing the omitted labels.
(Warning 6: Label omitted in function application)
(Eyyüb Sari)
- #6924: tiny optim to avoid some spilling of floats in x87
(Alain Frisch)
- #111: `(f [@taillcall]) x y` warns if `f x y` is not a tail-call
(Simon Cruanes)
- #118: ocamldep -allow-approx: fallback to a lexer-based approximation
(Frédéric Bour)
- #137: add untypeast.ml (in open recursion style) to compiler-libs
(Gabriel Radanne)
- #142: add a CAMLdrop macro for undoing CAMLparam*/CAMLlocal*
(Thomas Braibant and Damien Doligez)
- #145: speeedup bigarray access by optimizing Cmmgen.bigarray_indexing
(Vladimir Brankov, review by Gabriel Scherer)
- #147: [type 'a result = Ok of 'a | Error of 'b] in Pervasives
(Yaron Minsky)
- #156, #279: optimize caml_frame_descriptors realloc (dynlink speedup)
(Pierre Chambart, Alain Frisch,
review by François Bobot, Xavier Leroy and Damien Doligez)
- #165, #221: fix windows compilation warnings
(Bernhard Schommer, Gabriel Scherer, report by Alain Frisch)
* #170: Parse arbitrary precision integers.
Accept a single [A-Za-z] as modifier for integers (generalizing 'l','L','n')
and floats.
May cause breakage (ie. ppx preprocessor) because of changes in the parsetree.
This changes #6816 a little bit by reading the literal [123a] as a single
token that can later be rewritten by a ppx preprocessor.
(Hugo Heuzard)
- #189: Added .dylib and .so as extensions for ocamlmklib
(Edgar Aroutiounian, whitequark)
- #191: Making gc.h and some part of memory.h public
(Thomas Refis)
- #196: Make [Thread.id] and [Thread.self] [noalloc]
(Clark Gaebel)
- #237: a CONTRIBUTING document
(François Bobot, Gabriel Scherer, review by Xavier Leroy)
- #245: remove a few remaining French comments
(Florian Angeletti)
- #252: improve build instructions in MSVC Windows README
(Philip Daian)
- #308: add experimental support for NetBSD/arm (verified on RaspberryPi)
(Rich Neswold)
- #335: Type error messages specifies if a type is abstract
because no corresponding cmi could be found.
(Hugo Heuzard)
- #365: prevent printing just a single type variable on one side
of a type error clash.
(Hugo Heuzard)
- #383: configure: define _ALL_SOURCE for build on AIX7.1
(tkob)
- #401: automatically retry failed test directories in the testsuite
(David Allsopp)
- #451: an optional 'parallel' target in testsuite/Makefile using the
GNU parallel tool to run tests in parallel.
(Gabriel Scherer)
- #555: ensure that register typing constraints are respected at
join points in the control flow graph
(Mark Shinwell, debugging & test case by Arseniy Alekseyev and Leo White,
code review by Xavier Leroy)
### Build system:
- #388: FlexDLL added as a Git submodule and bootstrappable with the compiler
(David Allsopp)
OCaml 4.02.3 (27 Jul 2015):
---------------------------
Bug fixes:
- #6908: Top-level custom printing for GADTs: interface change in 4.02.2
(Grégoire Henry, report by Jeremy Yallop)
- #6919: corrupted final_table
(ygrek)
- #6926: Regression: ocamldoc lost unattached comment
(Damien Doligez, report by François Bobot)
- #6930: Aliased result type of GADT constructor results in assertion failure
(Jacques Garrigue)
Feature wishes:
- #6691: install .cmt[i] files for stdlib and compiler-libs
(David Sheets, request by Gabriel Radanne)
- #37: New primitive: caml_alloc_dummy_function
(Hugo Heuzard)
OCaml 4.02.2 (17 Jun 2015):
---------------------------
(Changes that can break existing programs are marked with a "*")
Language features:
- #6583: add a new class of binary operators with the same syntactic
precedence as method calls; these operators start with # followed
by a non-empty sequence of operator symbols (for instance #+, #!?).
It is also possible to use '#' as part of these extra symbols
(for instance ##, or #+#); this is rejected by the type-checker,
but can be used e.g. by ppx rewriters.
(Alain Frisch, request by Gabriel Radanne)
* #6016: add a "nonrec" keyword for type declarations
(Jérémie Dimino)
* #6612, #152: change the precedence of attributes in type declarations
(Jérémie Dimino)
Compilers:
- #6600: make -short-paths faster by building the printing map
incrementally
(Jacques Garrigue)
- #6642: replace $CAMLORIGIN in -ccopt with the path to cma or cmxa
(whitequark, Gabriel Scherer, review by Damien Doligez)
- #6797: new option -output-complete-obj
to output an object file with included runtime and autolink libraries
(whitequark)
- #6845: -no-check-prims to tell ocamlc not to check primitives in runtime
(Alain Frisch)
- #149: Attach documentation comments to parse tree
(Leo White)
- #159: Better locations for structure/signature items
(Leo White)
Toplevel and debugger:
- #5958: generalized polymorphic #install_printer
(Pierre Chambart and Grégoire Henry)
OCamlbuild:
- #6237: explicit "infer" tag to control or disable menhir --infer
(Hugo Heuzard)
- #6625: pass -linkpkg to files built with -output-obj.
(whitequark)
- #6702: explicit "linkpkg" and "dontlink(foo)" flags
(whitequark, Gabriel Scherer)
- #6712: Ignore common VCS directories
(whitequark)
- #6720: pass -g to C compilers when tag 'debug' is set
(whitequark, Gabriel Scherer)
- #6733: add .byte.so and .native.so targets to pass
-output-obj -cclib -shared.
(whitequark)
- #6733: "runtime_variant(X)" to pass -runtime-variant X option.
(whitequark)
- #6774: new menhir-specific flags "only_tokens" and "external_tokens(Foo)"
(François Pottier)
Libraries:
- #6285: Add support for nanosecond precision in Unix.stat()
(Jérémie Dimino, report by user 'gfxmonk')
- #6781: Add higher baud rates to Unix termios
(Damien Doligez, report by Berke Durak)
- #6834: Add Obj.{first,last}_non_constant_constructor_tag
(Mark Shinwell, request by Gabriel Scherer)
Runtime:
- #6078: Release the runtime system when calling caml_dlopen
(Jérémie Dimino)
- #6675: GC hooks
(Damien Doligez and Roshan James)
Build system:
- #5418 (comments) : generate dependencies with $(CC) instead of gcc
(Damien Doligez and Michael Grünewald)
- #6266: Cross compilation for iOs, Android etc
(whitequark, review by Damien Doligez and Mark Shinwell)
Installation procedure:
- Update instructions for x86-64 PIC mode and POWER architecture builds
(Mark Shinwell)
Bug fixes:
- #5271: Location.prerr_warning is hard-coded to use Format.err_formatter
(Damien Doligez, report by Rolf Rolles)
- #5395: OCamlbuild mishandles relative symlinks and include paths
(Damien Doligez, report by Didier Le Botlan)
- #5822: wrong value of Options.ext_dll on windows
(Damien Doligez and Daniel Weil)
- #5836, #6684: printing lazy values in ocamldebug may segfault
(Gabriel Scherer, request by the Coq team)
- #5887: move the byterun/*.h headers to byterun/caml/*.h to avoid
header name clashes
(Jérôme Vouillon and Adrien Nader and whitequark)
- #6281: Graphics window does not acknowledge second click (double click)
(Kyle Headley)
- #6490: incorrect backtraces in gdb on AArch64. Also fixes incorrect
backtraces on 32-bit ARM.
(Mark Shinwell)
- #6573: extern "C" for systhreads/threads.h
(Mickaël Delahaye)
- #6575: Array.init evaluates callback although it should not do so
(Alain Frisch, report by Gerd Stolpmann)
- #6607: The manual doesn't mention 0x200 flag for OCAMLRUNPARAM=v
(Alain Frisch)
- #6616: allow meaningful use of -use-runtime without -custom.
(whitequark)
- #6617: allow android build with pthreads support (since SDK r10c)
(whitequark)
- #6626: ocamlbuild on cygwin cannot find ocamlfind
(Gergely Szilvasy)
- #6628: Configure script rejects legitimate arguments
(Michael Grünewald, Damien Doligez)
- #6630: Failure of tests/prim-bigstring/{big,}string.ml on big-endian
architectures
(Pierre Chambart, testing by Mark Shinwell)
- #6640: ocamlbuild: wrong "unused tag" warning on "precious"
(report by user 'william')
- #6652: ocamlbuild -clean does not print a newline after output
(Damien Doligez, report by Andi McClure)
- #6658: cross-compiler: version check not working on OS X
(Gerd Stolpmann)
- #6665: Failure of tests/asmcomp on sparc
(Stéphane Glondu)
- #6667: wrong implementation of %bswap16 on ARM64
(Xavier Leroy)
- #6669: fix 4.02 regression in toplevel printing of lazy values
(Leo White, review by Gabriel Scherer)
- #6671: Windows: environment variable 'TZ' affects Unix.gettimeofday
(Mickaël Delahaye and Damien Doligez)
- #6680: Missing parentheses in warning about polymorphic variant value
(Jacques Garrigue and Gabriel Scherer, report by Philippe Veber)
- #6686: Bug in [subst_boxed_number]
(Jérémie Dimino, Mark Shinwell)
- #6690: Uncaught exception (Not_found) with (wrong) wildcard or unification
type variable in place of a local abstract type
(Jacques Garrigue, report by Mikhail Mandrykin)
- #6693 (part two): Incorrect relocation types in x86-64 runtime system
(whitequark, review by Jacques-Henri Jourdan, Xavier Leroy and Mark Shinwell)
- #6717: Pprintast does not print let-pattern attributes
(Gabriel Scherer, report by whitequark)
- #6727: Printf.sprintf "%F" misbehavior
(Benoît Vaugon, report by Vassili Karpov)
- #6747: ocamlobjinfo: missing symbol caml_plugin_header due to underscore
(Damien Doligez, Maverick Woo)
- #6749: ocamlopt returns n for (n mod 1) instead of 0
(Mark Shinwell and Jérémie Dimino)
- #6753: Num.quo_num and Num.mod_num incorrect for some negative arguments
(Xavier Leroy)
- #6758: Ocamldoc "analyse_module: parsetree and typedtree don't match"
(Damien Doligez, report by user 'maro')
- #6759: big_int_of_string incorrectly parses some hexa literals
(Damien Doligez, report by Pierre-yves Strub)
- #6763: #show with -short-paths doesn't select shortest type paths
(Jacques Garrigue, report by David Sheets)
- #6768: Typechecker overflow the stack on cyclic type
(Jacques Garrigue, report by user 'darktenaibre')
- #6770: duplicate of #6686
- #6772: asmrun/signals_asm.c doesn't compile on NetBSD/i386
(Kenji Tokudome)
- #6775: Digest.file leaks file descriptor on error
(Valentin Gatien-Baron)
- #6779: Cross-compilers cannot link bytecode using custom primitives
(Damien Doligez, request by whitequark)
- #6787: Soundness bug with polymorphic variants
(Jacques Garrigue, with help from Leo White and Grégoire Henry,
report by Michael O'Connor)
- #6790: otherlibs should be built with -g
(Damien Doligez, report by whitequark)
- #6791: "%s@[", "%s@{" regression in Scanf
(Benoît Vaugon)
- #6793: ocamlbuild passes nonsensical "-ocamlc ..." commands to menhir
(Gabriel Scherer, report by Damien Doligez)
- #6799: include guards missing for unixsupport.h and other files
(Andreas Hauptmann)
- #6810: Improve documentation of Bigarray.Genarray.map_file
(Mark Shinwell and Daniel Bünzli)
- #6812: -short-paths and -no-alias-deps can create inconsistent assumptions
(Jacques Garrigue, report by Valentin Gatien-Baron)
- #6817: GADT exhaustiveness breakage with modules
(Leo White, report by Pierre Chambart)
- #6824: fix buffer sharing on partial application of Format.asprintf
(Gabriel Scherer, report by Alain Frisch)
- #6831: Build breaks for -aspp gcc on solaris-like OSs
(John Tibble)
- #6836: Assertion failure using -short-paths
(Jacques Garrigue, report by David Sheets)
- #6837: Build profiling libraries on FreeBSD and NetBSD x86-64
(Mark Shinwell, report by Michael Grünewald)
- #6841: Changing compilation unit name with -o breaks ocamldebug
(Jacques Garrigue, report by Jordan Walke)
- #6842: export Typemod.modtype_of_package
- #6843: record weak dependencies even when the .cmi is missing
(Leo White, Gabriel Scherer)
- #6849: Inverted pattern unification error
(Jacques Garrigue, report by Leo White)
- #6857: __MODULE__ doesn't give the current module with -o
(Jacques Garrigue, report by Valentin Gatien-Baron)
- #6862: Exhaustiveness check wrong for class constructor arguments
(Jacques Garrigue)
- #6869: Improve comment on [Hashtbl.hash_param]
(Mark Shinwell, report by Jun Furuse)
- #6870: Unsoundness when -rectypes fails to detect non-contractive type
(Jacques Garrigue, report by Stephen Dolan)
- #6872: Type-directed propagation fails to disambiguate variants
that are also exception constructors
(Jacques Garrigue, report by Romain Beauxis)
- #6878: AArch64 backend generates invalid asm: conditional branch
out of range (Mark Shinwell, report by Richard Jones, testing by Richard
Jones and Xavier Leroy, code review by Xavier Leroy and Thomas Refis)
- #6879: Wrong optimization of 1 mod n
(Mark Shinwell, report by Jean-Christophe Filliâtre)
- #6884: The __CYGWIN32__ #define should be replaced with __CYGWIN__
(Adrien Nader)
- #6886: -no-alias-deps allows to build self-referential compilation units
(Jacques Garrigue, report by Valentin Gatien-Baron)
- #6889: ast_mapper fails to rewrite class attributes
(Sébastien Briais)
- #6893: ocamlbuild: "tag not used" warning when using (p)dep
(Gabriel Scherer, report by Christiano Haesbaert)
- #143: fix getsockopt behaviour for boolean socket options
(Anil Madhavapeddy and Andrew Ray)
- #190: typo in pervasives
(Guillaume Bury)
- Misplaced assertion in major_gc.c for no-naked-pointers mode
(Stephen Dolan, Mark Shinwell)
Feature wishes:
- #6452, #140: add internal support for custom printing formats
(Jérémie Dimino)
- #6641: add -g, -ocamlcflags, -ocamloptflags options to ocamlmklib
(whitequark)
- #6693: also build libasmrun_shared.so and lib{asm,caml}run_pic.a
(whitequark, review by Mark Shinwell)
- #6842: export Typemod.modtype_of_package
(Jacques Garrigue, request by Jun Furuse)
- #139: more versatile specification of locations of .annot
(Christophe Troestler, review by Damien Doligez)
- #171: allow custom warning printers / catchers
(Benjamin Canou, review by Damien Doligez)
- #191: Making gc.h and some part of memory.h public
(Thomas Refis)
OCaml 4.02.1 (14 Oct 2014):
---------------------------
(Changes that can break existing programs are marked with a "*")
Standard library:
* Add optional argument ?limit to Arg.align.
Bug Fixes:
- #4099: Bug in Makefile.nt: won't stop on error
(George Necula)
- #6181: Improve MSVC build
(Chen Gang)
- #6207: Configure doesn't detect features correctly on Haiku
(Jessica Hamilton)
- #6466: Non-exhaustive matching warning message for open types is confusing
(whitequark)
- #6529: fix quadratic-time algorithm in Consistbl.extract.
(Xavier Leroy, Alain Frisch, relase-worthy report by Kate Deplaix)
- #6530: Add stack overflow handling for native code (OpenBSD i386 and amd64)
(Cristopher Zimmermann)
- #6533: broken semantics of %(%) when substituted by a box
(Benoît Vaugon, report by Boris Yakobowski)
- #6534: legacy support for %.10s
(Benoît Vaugon, Gabriel Scherer, report by Nick Chapman)
- #6536: better documentation of flag # in format strings
(Damien Doligez, report by Nick Chapman)
- #6544: Bytes and CamlinternalFormat missing from threads stdlib.cma
(Christopher Zimmermann)
- #6546: -dsource omits parens for `List ((`String "A")::[]) in patterns
(Gabriel Scherer, report by whitequark)
- #6547: __MODULE__ aborts the compiler if the module name cannot be inferred
(Jacques Garrigue, report by Kaustuv Chaudhuri)
- #6549: Debug section is sometimes not readable when using -pack
(Hugo Heuzard, review by Gabriel Scherer)
- #6553: Missing command line options for ocamldoc
(Maxence Guesdon)
- #6554: fix race condition when retrieving backtraces
(Jérémie Dimino, Mark Shinwell).
- #6557: String.sub throws Invalid_argument("Bytes.sub")
(Damien Doligez, report by Oliver Bandel)
- #6562: Fix ocamldebug module source lookup
(Leo White)
- #6563: Inclusion of packs failing to run module initializers
(Jacques Garrigue, report by Mark Shinwell)
- #6564: infinite loop in Mtype.remove_aliases
(Jacques Garrigue, report by Mark Shinwell)
- #6565: compilation fails with Env.Error(_)
(Jacques Garrigue and Mark Shinwell)
- #6566: -short-paths and signature inclusion errors
(Jacques Garrigue, report by Mark Shinwell)
- #6572: Fatal error with recursive modules
(Jacques Garrigue, report by Quentin Stievenart)
- #6575: Array.init evaluates callback although it should not do so
(Alain Frisch, report by Gerd Stolpmann)
- #6578: Recursive module containing alias causes Segmentation fault
(Jacques Garrigue)
- #6581: Some bugs in generative functors
(Jacques Garrigue, report by Mark Shinwell)
- #6584: ocamldep support for "-open M"
(Gabriel Scherer, review by Damien Doligez, report by Hezekiah M. Carty)
- #6588: Code generation errors for ARM
(Mark Shinwell, Xavier Leroy)
- #6590: Improve Windows (MSVC and mingw) build
(Chen Gang)
- #6599: ocamlbuild: add -bin-annot when using -pack
(Christopher Zimmermann)
- #6602: Fatal error when tracing a function with abstract type
(Jacques Garrigue, report by Hugo Herbelin)
- ocamlbuild: add an -ocamlmklib option to change the ocamlmklib command
(Jérôme Vouillon)
OCaml 4.02.0 (29 Aug 2014):
---------------------------
(Changes that can break existing programs are marked with a "*")
Language features:
- Attributes and extension nodes
(Alain Frisch)
- Generative functors (#5905)
(Jacques Garrigue)
* Module aliases
(Jacques Garrigue)
* Alternative syntax for string literals {id|...|id} (can break comments)
(Alain Frisch)
- Separation between read-only strings (type string) and read-write byte
sequences (type bytes). Activated by command-line option -safe-string.
(Damien Doligez)
- #6318: Exception cases in pattern matching
(Jeremy Yallop, backend by Alain Frisch)
- #5584: Extensible open datatypes
(Leo White)
Build system for the OCaml distribution:
- Use -bin-annot when building.
- Use GNU make instead of portable makefiles.
- Updated build instructions for 32-bit Mac OS X on Intel hardware.
Shedding weight:
* Removed Camlp4 from the distribution, now available as third-party software.
* Removed Labltk from the distribution, now available as a third-party library.
Type system:
* #6235: Keep typing of pattern cases independent in principal mode
(i.e. information from previous cases is no longer used when typing
patterns; cf. '#6235' in testsuite/test/typing-warnings/records.ml)
(Jacques Garrigue)
- Allow opening a first-class module or applying a generative functor
in the body of a generative functor. Allow it also in the body of
an applicative functor if no types are created
(Jacques Garrigue, suggestion by Leo White)
* Module aliases are now typed in a specific way, which remembers their
identity. Compiled interfaces become smaller, but may depend on the
original modules. This also changes the signature inferred by
"module type of".
(Jacques Garrigue, feedback from Leo White, Mark Shinwell and Nick Chapman)
- #6331: Slight change in the criterion to distinguish private
abbreviations and private row types: create a private abbreviation for
closed objects and fixed polymorphic variants.
(Jacques Garrigue)
* #6333: Compare first class module types structurally rather than
nominally. Value subtyping allows module subtyping as long as the internal
representation is unchanged.
(Jacques Garrigue)
Compilers:
- More aggressive constant propagation, including float and
int32/int64/nativeint arithmetic. Constant propagation for floats
can be turned off with option -no-float-const-prop, for codes that
change FP rounding modes at run-time.
(Xavier Leroy)
- New back-end optimization pass: common subexpression elimination (CSE).
(Reuses results of previous computations instead of recomputing them.)
(Xavier Leroy)
- New back-end optimization pass: dead code elimination.
(Removes arithmetic and load instructions whose results are unused.)
(Xavier Leroy)
- #6269: Optimization of sequences of string patterns
(Benoît Vaugon and Luc Maranget)
- Experimental native code generator for AArch64 (ARM 64 bits)
(Xavier Leroy)
- #6042: Optimization of integer division and modulus by constant divisors
(Xavier Leroy and Phil Denys)
- Add "-open" command line flag for opening a single module before typing
(Leo White, Mark Shinwell and Nick Chapman)
* "-o" now sets module name to the output file name up to the first "."
(it also applies when "-o" is not given, i.e. the module name is then
the input file name up to the first ".")
(Leo White, Mark Shinwell and Nick Chapman)
* #5779: better sharing of structured constants
(Alain Frisch)
- #5817: new flag to keep locations in cmi files
(Alain Frisch)
- #5854: issue warning 3 when referring to a value marked with
the [@@ocaml.deprecated] attribute
(Alain Frisch, suggestion by Pierre-Marie Pédrot)
- #6017: a new format implementation based on GADTs
(Benoît Vaugon and Gabriel Scherer)
* #6203: Constant exception constructors no longer allocate
(Alain Frisch)
- #6260: avoid unnecessary boxing in let
(Vladimir Brankov)
- #6345: Better compilation of optional arguments with default values
(Alain Frisch, review by Jacques Garrigue)
- #6389: ocamlopt -opaque option for incremental native compilation
(Pierre Chambart, Gabriel Scherer)
Toplevel interactive system:
- #5377: New "#show_*" directives
(ygrek, Jacques Garrigue and Alain Frisch)
Runtime system:
- New configure option "-no-naked-pointers" to improve performance by
avoiding page table tests during block darkening and the marking phase
of the major GC. In this mode, all out-of-heap pointers must point at
things that look like OCaml values: in particular they must have a valid
header. The colour of said headers should be black.
(Mark Shinwell, reviews by Damien Doligez and Xavier Leroy)
- Fixed bug in native code version of [caml_raise_with_string] that could
potentially lead to heap corruption.
(Mark Shinwell)
* Blocks initialized by [CAMLlocal*] and [caml_alloc] are now filled with
[Val_unit] rather than zero.
(Mark Shinwell)
- Fixed a major performance problem on large heaps (~1GB) by making heap
increments proportional to heap size by default
(Damien Doligez)
- #4765: Structural equality treats exception specifically
(Alain Frisch)
- #5009: efficient comparison/indexing of exceptions
(Alain Frisch, request by Markus Mottl)
- #6075: avoid using unsafe C library functions (strcpy, strcat, sprintf)
(Xavier Leroy, reports from user 'jfc' and Anil Madhavapeddy)
- An ISO C99-compliant C compiler and standard library is now assumed.
(Plus special exceptions for MSVC.) In particular, emulation code for
64-bit integer arithmetic was removed, the C compiler must support a
64-bit integer type.
(Xavier Leroy)
Standard library:
* Add new modules Bytes and BytesLabels for mutable byte sequences.
(Damien Doligez)
- #4986: add List.sort_uniq and Set.of_list
(Alain Frisch)
- #5935: a faster version of "raise" which does not maintain the backtrace
(Alain Frisch)
- #6146: support "Unix.kill pid Sys.sigkill" under Windows
(Romain Bardou and Alain Frisch)
- #6148: speed improvement for Buffer
(John Whitington)
- #6180: efficient creation of uninitialized float arrays
(Alain Frisch, request by Markus Mottl)
- #6355: Improve documentation regarding finalisers and multithreading
(Daniel Bünzli, Mark Shinwell)
- Trigger warning 3 for all values marked as deprecated in the documentation.
(Damien Doligez)
OCamldoc:
- #6257: handle full doc comments for variant constructors and
record fields
(Maxence Guesdon, request by ygrek)
- #6274: allow doc comments on object types
(Thomas Refis)
- #6310: fix ocamldoc's subscript/superscript CSS font size
(Anil Madhavapeddy)
- #6425: fix generation of man pages
(Maxence Guesdon, report by Anil Madhavapeddy)
Bug fixes:
- #2719: wrong scheduling of bound checks within a
try...with Invalid_argument -> _ ... (Xavier Leroy)
- #4719: Sys.executable_name wrong if executable name contains dots (Windows)
(Alain Frisch, report by Bart Jacobs)
- #5406 ocamlbuild: "tag 'package' does not expect a parameter"
(Gabriel Scherer)
- #5598, #6165: Alterations to handling of \013 in source files
breaking other tools
(David Allsopp and Damien Doligez)
- #5820: Fix camlp4 lexer roll back problem
(Hongbo Zhang)
- #5946: CAMLprim taking (void) as argument
(Benoît Vaugon)
- #6038: on x86-32, enforce 16-byte stack alignment for compatibility
with recent GCC and Clang. Win32/MSVC keeps 4-byte stack alignment.
(Xavier Leroy)
- #6062: Fix a 4.01 camlp4 DELETE_RULE regression caused by commit 13047
(Hongbo Zhang, report by Christophe Troestler)
- #6173: Typing error message is worse than before
(Jacques Garrigue and John Whitington)
- #6174: OCaml compiler loops on an example using GADTs (-rectypes case)
(Jacques Garrigue and Grégoire Henry, report by Chantal Keller)
- #6175: open! was not supported by camlp4
(Hongbo Zhang)
- #6184: ocamlbuild: `ocamlfind ocamldep` does not support -predicate
(Kate Deplaix)
- #6194: Incorrect unused warning with first-class modules in patterns
(Jacques Garrigue, report by Markus Mottl and Leo White)
- #6211: in toplevel interactive use, bad interaction between uncaught
exceptions and multiple bindings of the form "let x = a let y = b;;".
(Xavier Leroy)
- #6216: inlining of GADT matches generates invalid assembly
(Xavier Leroy and Alain Frisch, report by Mark Shinwell)
- #6232: Don't use [mktemp] on platforms where [mkstemp] is available
(Stéphane Glondu, Mark Shinwell)
- #6233: out-of-bounds exceptions lose their locations on ARM, PowerPC
(Jacques-Henri Jourdan and Xavier Leroy,
report and testing by Stéphane Glondu)
- #6235: Issue with type information flowing through a variant pattern
(Jacques Garrigue, report by Hongbo Zhang)
- #6239: sometimes wrong stack alignment when raising exceptions
in -g mode with backtraces active
(Xavier Leroy, report by Yaron Minsky)
- #6240: Fail to expand module type abbreviation during substyping
(Jacques Garrigue, report by Leo White)
- #6241: Assumed inequality between paths involving functor arguments
(Jacques Garrigue, report by Jeremy Yallop)
- #6243: Make "ocamlopt -g" more resistant to ill-formed locations
(Xavier Leroy, report by Pierre-Marie Pédrot)
- #6262: equality of first-class modules take module aliases into account
(Alain Frisch and Leo White)
- #6268: -DMODEL_$(MODEL) not passed when building asmrun/arm.p.o
(Peter Michael Green)
- #6273: fix Sys.file_exists on large files (Win32)
(Christoph Bauer)
- #6275: Soundness bug related to type constraints
(Jacques Garrigue, report by Leo White)
- #6293: Assert_failure with invalid package type
(Jacques Garrigue, report by Elnatan Reisner)
- #6300: ocamlbuild -use-ocamlfind conflicts with -ocamlc
(Gabriel Scherer)
- #6302: bytecode debug information re-read from filesystem every time
(Jacques-Henri Jourdan)
- #6307: Behavior of 'module type of' w.r.t. module aliases
(Jacques Garrigue, report by Alain Frisch)
- #6332: Unix.open_process fails to pass empty arguments under Windows
(Damien Doligez, report Virgile Prevosto)
- #6346: Build failure with latest version of xcode on OSX
(Jérémie Dimino)
- #6348: Unification failure for GADT when original definition is hidden
(Leo White and Jacques Garrigue, report by Jeremy Yallop)
- #6352: Automatic removal of optional arguments and sequencing
(Jacques Garrigue and Alain Frisch)
- #6361: Hashtbl.hash not terminating on some lazy values w/ recursive types
(Xavier Leroy, report by Leo White)
- #6383: Exception Not_found when using object type in absent module
(Jacques Garrigue, report by Sébastien Briais)
- #6384: Uncaught Not_found exception with a hidden .cmi file
(Leo White)
- #6385: wrong allocation of large closures by the bytecode interpreter
(Xavier Leroy, report by Stephen Dolan)
- #6394: Assertion failed in Typecore.expand_path
(Alain Frisch and Jacques Garrigue)
- #6405: unsound interaction of -rectypes and GADTs
(Jacques Garrigue, report by Gabriel Scherer and Benoît Vaugon)
- #6408: Optional arguments given as ~?arg instead of ?arg in message
(Michael O'Connor)
- #6411: missing libgcc_s_sjlj-1.dll in mingw (add -static-libgcc)
(Jun Furuse and Alain Frisch, Jonathan Protzenko and Adrien Nader)
- #6436: Typos in @deprecated text in stdlib/arrayLabels.mli
(John Whitington)
- #6439: Don't use the deprecated [getpagesize] function
(John Whitington, Mark Shinwell)
- #6441: undetected tail-call in some mutually-recursive functions
(many arguments, and mutual block mixes functions and non-functions)
(Stefan Holdermans, review by Xavier Leroy)
- #6443: ocaml segfault when List.fold_left is traced then executed
(Jacques Garrigue, report by user 'Reventlov')
- #6451: some bugs in untypeast.ml
(Jun Furuse, review by Alain Frisch)
- #6460: runtime assertion failure with large [| e1;...eN |]
float array expressions
(Leo White)
- #6463: -dtypedtree fails on class fields
(Leo White)
- #6469: invalid -dsource printing of "external _pipe = ...", "Pervasives.(!)"
(Gabriel Scherer and Damien Doligez, user 'ngunn')
- #6482: ocamlbuild fails when _tags file in unhygienic directory
(Gabriel Scherer)
- #6502: ocamlbuild spurious warning on "use_menhir" tag
(Xavier Leroy)
- #6505: Missed Type-error leads to a segfault upon record access
(Jacques Garrigue, Jeremy Yallop, report by Christoph Höger)
- #6507: crash on AArch64 resulting from incorrect setting of
[caml_bottom_of_stack]. (Richard Jones, Mark Shinwell)
- #6509: add -linkall flag to ocamlcommon.cma
(Frédéric Bour)
- #6513: Fatal error Ctype.Unify(_) in functor type
- #6523: failure upon character bigarray access, and unnecessary change
in comparison ordering (Jeremy Yallop, Mark Shinwell)
- bound-checking bug in caml_string_{get,set}{16,32,64}
(Pierre Chambart and Gabriel Scherer, report by Nicolas Trangez)
- sometimes wrong stack alignment at out-of-bounds array access
(Gabriel Scherer and Xavier Leroy, report by Pierre Chambart)
Features wishes:
- #4243: make the Makefiles parallelizable
(Grégoire Henry and Damien Doligez)
- #4323: have "of_string" in Num and Big_int work with binary and
hex representations
(Zoe Paraskevopoulou, review by Gabriel Scherer)
- #4771: Clarify documentation of Dynlink.allow_only
(Damien Doligez, report by David Allsopp)
- #4855: 'camlp4 -I +dir' accepted, dir is relative to 'camlp4 -where'
(Jun Furuse and Hongbo Zhang, report by Dmitry Grebeniuk)
- #5201: ocamlbuild: add --norc to the bash invocation to help performances
(Daniel Weil)
- #5650: Camlp4FoldGenerator doesn't handle well "abstract" types
(Hongbo Zhang)
- #5808: allow simple patterns, not just identifiers, in "let p : t = ..."
(Alain Frisch)
- #5851: warn when -r is disabled because no _tags file is present
(Gabriel Scherer)
- #5899: a programmer-friendly access to backtrace information
(Jacques-Henri Jourdan and Gabriel Scherer)
- #6000 comment 9644: add a warning for non-principal coercions to format
(Jacques Garrigue, report by Damien Doligez)
- #6054: add support for M.[ foo ], M.[| foo |] etc.
(Kaustuv Chaudhuri)
- #6064: GADT representation for Bigarray.kind + CAML_BA_CHAR runtime kind
(Jeremy Yallop, review by Gabriel Scherer)
- #6071: Add a -noinit option to the toplevel
(David Sheets)
- #6087: ocamlbuild, improve _tags parsing of escaped newlines
(Gabriel Scherer, request by Daniel Bünzli)
- #6109: Typos in ocamlbuild error messages
(Gabriel Kerneis)
- #6116: more efficient implementation of Digest.to_hex
(ygrek)
- #6142: add cmt file support to ocamlobjinfo
(Anil Madhavapeddy)
- #6166: document -ocamldoc option of ocamlbuild
(Xavier Clerc)
- #6182: better message for virtual objects and class types
(Leo White, Stephen Dolan)
- #6183: enhanced documentation for 'Unix.shutdown_connection'
(Anil Madhavapeddy, report by Jun Furuse)
- #6187: ocamlbuild: warn when using -plugin-tag(s) without myocamlbuild.ml
(Kate Deplaix)
- #6246: allow wildcard _ as for-loop index
(Alain Frisch, request by ygrek)
- #6267: more information printed by "bt" command of ocamldebug
(Josh Watzman)
- #6270: remove need for -I directives to ocamldebug in common case
(Josh Watzman, review by Xavier Clerc and Alain Frisch)
- #6311: Improve signature mismatch error messages
(Alain Frisch, suggestion by Daniel Bünzli)
- #6358: obey DESTDIR in install targets
(Gabriel Scherer, request by François Berenger)
- #6388, #6424: more parsetree correctness checks for -ppx users
(Alain Frisch, request by whitequark and Jun Furuse)
- #6406: Expose OCaml version in C headers
(whitequark and Romain Calascibetta)
- #6446: improve "unused declaration" warnings wrt. name shadowing
(Alain Frisch)
- #6495: ocamlbuild tags 'safe_string', 'unsafe_string'
(Anil Madhavapeddy)
- #6497: pass context information to -ppx preprocessors
(whitequark, Alain Frisch)
- ocamllex: user-definable refill action
(Frédéric Bour, review by Gabriel Scherer and Luc Maranget)
- shorten syntax for functor signatures: "functor (M1:S1) (M2:S2) .. -> .."
(Thomas Gazagnaire and Jeremy Yallop, review by Gabriel Scherer)
- make ocamldebug -I auto-detection work with ocamlbuild
(Josh Watzman)
OCaml 4.01.0 (12 Sep 2013):
---------------------------
(Changes that can break existing programs are marked with a "*")
Other libraries:
- Labltk: updated to Tcl/Tk 8.6.
Type system:
- #5759: use well-disciplined type information propagation to
disambiguate label and constructor names
(Jacques Garrigue, Alain Frisch and Leo White)
* Propagate type information towards pattern-matching, even in the presence of
polymorphic variants (discarding only information about possibly-present
constructors). As a result, matching against absent constructors is no longer
allowed for exact and fixed polymorphic variant types.
(Jacques Garrigue)
* #6035: Reject multiple declarations of the same method or instance variable
in an object
(Alain Frisch)
Compilers:
- #5861: raise an error when multiple private keywords are used in type
declarations
(Hongbo Zhang)
- #5634: parsetree rewriter (-ppx flag)
(Alain Frisch)
- ocamldep now supports -absname
(Alain Frisch)
- #5768: On "unbound identifier" errors, use spell-checking to suggest names
present in the environment
(Gabriel Scherer)
- ocamlc has a new option -dsource to visualize the parsetree
(Alain Frisch, Hongbo Zhang)
- tools/eqparsetree compares two parsetree ignoring location
(Hongbo Zhang)
- ocamlopt now uses clang as assembler on OS X if available, which enables
CFI support for OS X.
(Benedikt Meurer)
- Added a new -short-paths option, which attempts to use the shortest
representation for type constructors inside types, taking open modules
into account. This can make types much more readable if your code
uses lots of functors.
(Jacques Garrigue)
- #5986: added flag -compat-32 to ocamlc, ensuring that the generated
bytecode executable can be loaded on 32-bit hosts.
(Xavier Leroy)
- #5980: warning on open statements which shadow an existing
identifier (if it is actually used in the scope of the open); new
open! syntax to silence it locally
(Alain Frisch, thanks to a report of Daniel Bünzli)
* warning 3 is extended to warn about other deprecated features:
- ISO-latin1 characters in identifiers
- uses of the (&) and (or) operators instead of (&&) and (||)
(Damien Doligez)
- Experimental OCAMLPARAM for ocamlc and ocamlopt
(Fabrice Le Fessant)
- #5571: incorrect ordinal number in error message
(Alain Frisch, report by John Carr)
- #6073: add signature to Tstr_include
(patch by Leo White)
Standard library:
- #5899: expose a way to inspect the current call stack,
Printexc.get_callstack
(Gabriel Scherer, Jacques-Henri Jourdan, Alain Frisch)
- #5986: new flag Marshal.Compat_32 for the serialization functions
(Marshal.to_*), forcing the output to be readable on 32-bit hosts.
(Xavier Leroy)
- infix application operators |> and @@ in Pervasives
(Fabrice Le Fessant)
- #6176: new Format.asprintf function with a %a formatter
compatible with Format.fprintf (unlike Format.sprintf)
(Pierre Weis)
Other libraries:
- #5568: add O_CLOEXEC flag to Unix.openfile, so that the returned
file descriptor is created in close-on-exec mode
(Xavier Leroy)
Runtime system:
* #6019: more efficient implementation of caml_modify() and caml_initialize().
The new implementations are less lenient than the old ones: now,
the destination pointer of caml_modify() must point within the minor or
major heaps, and the destination pointer of caml_initialize() must
point within the major heap.
(Xavier Leroy, from an experiment by Brian Nigito, with feedback
from Yaron Minsky and Gerd Stolpmann)
Internals:
- Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary
as part of compilerlibs, to be used on bin-annot files.
(Fabrice Le Fessant)
- The test suite can now be run without installing OCaml first.
(Damien Doligez)
Bug fixes:
- #3236: Document the fact that queues are not thread-safe
(Damien Doligez)
- #3468: (part 1) Sys_error documentation
(Damien Doligez)
- #3679: Warning display problems
(Fabrice Le Fessant)
- #3963: Graphics.wait_next_event in Win32 hangs if window closed
(Damien Doligez)
- #4079: Queue.copy is now tail-recursive
(patch by Christophe Papazian)
- #4138: Documentation for Unix.mkdir
(Damien Doligez)
- #4469: emacs mode: caml-set-compile-command is annoying with ocamlbuild
(Daniel Bünzli)
- #4485: Graphics: Keyboard events incorrectly delivered in native code
(Damien Doligez, report by Sharvil Nanavati)
- #4502: ocamlbuild now reliably excludes the build-dir from hygiene check
(Gabriel Scherer, report by Romain Bardou)
- #4762: ?? is not used at all, but registered as a lexer token
(Alain Frisch)
- #4788: wrong error message when executable file is not found for backtrace
(Damien Doligez, report by Claudio Sacerdoti Coen)
- #4812: otherlibs/unix: add extern int code_of_unix_error (value error);
(Goswin von Brederlow)
- #4887: input_char after close_in crashes ocaml (msvc runtime)
(Alain Frisch and Christoph Bauer, report by ygrek)
- #4994: ocaml-mode doesn't work with xemacs21
(Damien Doligez, report by Stéphane Glondu)
- #5098: creating module values may lead to memory leaks
(Alain Frisch, report by Milan Stanojević)
- #5102: ocamlbuild fails when using an unbound variable in rule dependency
(Xavier Clerc, report by Daniel Bünzli)
* #5119: camlp4 now raises a specific exception when 'DELETE_RULE' fails,
rather than raising 'Not_found'
(ygrek)
- #5121: %( %) in Format module seems to be broken
(Pierre Weis, first patch by Valentin Gatien-Baron, report by Khoo Yit Phang)
- #5178: document in INSTALL how to build a 32-bit version under Linux x86-64
(Benjamin Monate)
- #5212: Improve ocamlbuild error messages of _tags parser
(ygrek)
- #5240: register exception printers for Unix.Unix_error and Dynlink.Error
(Jérémie Dimino)
- #5300: ocamlbuild: verbose parameter should implicitly set classic display
(Xavier Clerc, report by Robert Jakob)
- #5327: (Windows) Unix.select blocks if same socket listed in first and
third arguments
(David Allsopp, displaying impressive MSDN skills)
- #5343: ocaml -rectypes is unsound wrt module subtyping (was still unsound)
(Jacques Garrigue)
- #5350: missing return code checks in the runtime system
(Xavier Leroy)
- #5468: ocamlbuild should preserve order of parametric tags
(Wojciech Meyer, report by Dario Teixeira)
- #5551: Avoid repeated lookups for missing cmi files
(Alain Frisch)
- #5552: unrecognized gcc option -no-cpp-precomp
(Damien Doligez, report by Markus Mottl)
* #5580: missed opportunities for constant propagation
(Xavier Leroy and John Carr)
- #5611: avoid clashes between .cmo files and output files during linking
(Wojciech Meyer)
- #5662: typo in md5.c
(Olivier Andrieu)
- #5673: type equality in a polymorphic field
(Jacques Garrigue, report by Jean-Louis Giavitto)
- #5674: Methods call are 2 times slower with 4.00 than with 3.12
(Jacques Garrigue, Gabriel Scherer, report by Jean-Louis Giavitto)
- #5694: Exception raised by type checker
(Jacques Garrigue, report by Markus Mottl)
- #5695: remove warnings on sparc code emitter
(Fabrice Le Fessant)
- #5697: better location for warnings on statement expressions
(Dan Bensen)
- #5698: remove hardcoded limit of 200000 labels in emitaux.ml
(Fabrice Le Fessant, report by Marcin Sawicki)
- #5702: bytecomp/bytelibrarian lib_sharedobjs was defined but never used
(Hongbo Zhang, Fabrice Le Fessant)
- #5708: catch Failure"int_of_string" in ocamldebug
(Fabrice Le Fessant, report by user 'schommer')
- #5712: (9) new option -bin-annot is not documented
(Damien Doligez, report by Hendrik Tews)
- #5731: instruction scheduling forgot to account for destroyed registers
(Xavier Leroy, Benedikt Meurer, reported by Jeffrey Scofield)
- #5734: improved Win32 implementation of Unix.gettimeofday
(David Allsopp)
- #5735: %apply and %revapply not first class citizens
(Fabrice Le Fessant, reported by Jun Furuse)
- #5738: first class module patterns not handled by ocamldep
(Fabrice Le Fessant, Jacques Garrigue, reported by Hongbo Zhang)
- #5739: Printf.printf "%F" (-.nan) returns -nan
(Xavier Leroy, David Allsopp, reported by Samuel Mimram)
- #5741: make pprintast.ml in compiler_libs
(Alain Frisch, Hongbo Zhang)
- #5747: 'unused open' warning not given when compiling with -annot
(Alain Frisch, reported by Valentin Gatien-Baron)
- #5752: missing dependencies at byte-code link with mlpack
(Wojciech Meyer, Nicholas Lucaroni)
- #5763: ocamlbuild does not give correct flags when running menhir
(Gabriel Scherer, reported by Philippe Veber)
- #5765: ocamllex doesn't preserve line directives
(Damien Doligez, reported by Martin Jambon)
- #5770: Syntax error messages involving unclosed parens are sometimes
incorrect
(Michel Mauny)
- #5772: problem with marshaling of mutually-recursive functions
(Jacques-Henri Jourdan, reported by Cédric Pasteur)
- #5775: several bug fixes for tools/pprintast.ml
(Hongbo Zhang)
- #5784: -dclambda option is ignored
(Pierre Chambart)
- #5785: misbehaviour with abstracted structural type used as GADT index
(Jacques Garrigue, report by Jeremy Yallop)
- #5787: Bad behavior of 'Unused ...' warnings in the toplevel
(Alain Frisch)
- #5793: integer marshalling is inconsistent between architectures
(Xavier Clerc, report by Pierre-Marie Pédrot)
- #5798: add ARM VFPv2 support for Raspbian (ocamlopt)
(Jeffrey Scofield and Anil Madhavapeddy, patch review by Benedikt Meurer)
- #5802: Avoiding "let" as a value name
(Jacques Garrigue, report by Tiphaine Turpin)
- #5805: Assert failure with warning 34 on pre-processed file
(Alain Frisch, report by Tiphaine Turpin)
- #5806: ensure that backtrace tests are always run (testsuite)
(Xavier Clerc, report by user 'michi')
- #5809: Generating .cmt files takes a long time, in case of type error
(Alain Frisch)
- #5810: error in switch printing when using -dclambda
(Pierre Chambart)
- #5811: Untypeast produces singleton tuples for constructor patterns
with only one argument
(Tiphaine Turpin)
- #5813: GC not called when unmarshaling repeatedly in a tight loop (ocamlopt)
(Xavier Leroy, report by David Waern)
- #5814: read_cmt -annot does not report internal references
(Alain Frisch)
- #5815: Multiple exceptions in signatures gives an error
(Leo White)
- #5816: read_cmt -annot does not work for partial .cmt files
(Alain Frisch)
- #5819: segfault when using [with] on large recursive record (ocamlopt)
(Xavier Leroy, Damien Doligez)
- #5821: Wrong record field is reported as duplicate
(Alain Frisch, report by Martin Jambon)
- #5824: Generate more efficient code for immediate right shifts.
(Pierre Chambart, review by Xavier Leroy)
- #5825: Add a toplevel primitive to use source file wrapped with the
corresponding module
(Grégoire Henry, Wojciech Meyer, caml-list discussion)
- #5833: README.win32 can leave the wrong flexlink in the path
(Damien Doligez, report by William Smith)
- #5835: nonoptional labeled arguments can be passed with '?'
(Jacques Garrigue, report by Elnatan Reisner)
- #5840: improved documentation for 'Unix.lseek'
(Xavier Clerc, report by Matej Košík)
- #5848: Assertion failure in type checker
(Jacques Garrigue, Alain Frisch, report by David Waern)
- #5858: Assert failure during typing of class
(Jacques Garrigue, report by Julien Signoles)
- #5865: assert failure when reporting undefined field label
(Jacques Garrigue, report by Anil Madhavapeddy)
- #5872: Performance: Buffer.add_char is not inlined
(Gerd Stolpmann, Damien Doligez)
- #5876: Uncaught exception with a typing error
(Alain Frisch, Gabriel Scherer, report by Julien Moutinho)
- #5877: multiple "open" can become expensive in memory
(Fabrice Le Fessant and Alain Frisch)
- #5880: 'Genlex.make_lexer' documentation mentions the wrong exception
(Xavier Clerc, report by Virgile Prevosto)
- #5885: Incorrect rule for compiling C stubs when shared libraries are not
supported.
(Jérôme Vouillon)
- #5891: ocamlbuild: support rectypes tag for mlpack
(Khoo Yit Phang)
- #5892: GADT exhaustiveness check is broken
(Jacques Garrigue and Leo White)
- #5906: GADT exhaustiveness check is still broken
(Jacques Garrigue, report by Sébastien Briais)
- #5907: Undetected cycle during typecheck causes exceptions
(Jacques Garrigue, report by Pascal Zimmer)
- #5910: Fix code generation bug for "mod 1" on ARM.
(Benedikt Meurer, report by user 'jteg68')
- #5911: Signature substitutions fail in submodules
(Jacques Garrigue, report by Markus Mottl)
- #5912: add configure option -no-cfi (for OSX 10.6.x with XCode 4.0.2)
(Damien Doligez against XCode versions, report by Thomas Gazagnaire)
- #5914: Functor breaks with an equivalent argument signature
(Jacques Garrigue, report by Markus Mottl and Grégoire Henry)
- #5920, #5957: linking failure for big bytecodes on 32bit architectures
(Benoît Vaugon and Chet Murthy, report by Jun Furuse and Sebastien Mondet)
- #5928: Missing space between words in manual page for ocamlmktop
(Damien Doligez, report by Matej Košík)
- #5930: ocamldep leaks temporary preprocessing files
(Gabriel Scherer, report by Valentin Gatien-Baron)
- #5933: Linking is slow when there are functions with large arities
(Valentin Gatien-Baron, review by Gabriel Scherer)
- #5934: integer shift by negative amount (in otherlibs/num)
(Xavier Leroy, report by John Regehr)
- #5944: Bad typing performances of big variant type declaration
(Benoît Vaugon)
- #5945: Mix-up of Minor_heap_min and Minor_heap_max units
(Benoît Vaugon)
- #5948: GADT with polymorphic variants bug
(Jacques Garrigue, report by Leo White)
- #5953: Unix.system does not handle EINTR
(Jérémie Dimino)
- #5965: disallow auto-reference to a recursive module in its definition
(Alain Frisch, report by Arthur Windler via Gabriel Scherer)
- #5973: Format module incorrectly parses format string
(Pierre Weis, report by Frédéric Bour)
- #5974: better documentation for Str.regexp
(Damien Doligez, report by william)
- #5976: crash after recovering from two stack overflows (ocamlopt on MacOS X)
(Xavier Leroy, report by Pierre Boutillier)
- #5977: Build failure on raspberry pi: "input_value: integer too large"
(Alain Frisch, report by Sylvain Le Gall)
- #5981: Incompatibility check assumes abstracted types are injective
(Jacques Garrigue, report by Jeremy Yallop)
- #5982: caml_leave_blocking section and errno corruption
(Jérémie Dimino)
- #5985: Unexpected interaction between variance and GADTs
(Jacques Garrigue, Jeremy Yallop and Leo White and Gabriel Scherer)
- #5988: missing from the documentation: -impl is a valid flag for ocamlopt
(Damien Doligez, report by Vincent Bernardoff)
- #5989: Assumed inequalities involving private rows
(Jacques Garrigue, report by Jeremy Yallop)
- #5992: Crash when pattern-matching lazy values modifies the scrutinee
(Luc Maranget, Leo White)
- #5993: Variance of private type abbreviations not checked for modules
(Jacques Garrigue)
- #5997: Non-compatibility assumed for concrete types with same constructor
(Jacques Garrigue, report by Gabriel Scherer)
- #6004: Type information does not flow to "inherit" parameters
(Jacques Garrigue, report by Alain Frisch)
- #6005: Type unsoundness with recursive modules
(Jacques Garrigue, report by Jérémie Dimino and Josh Berdine)
- #6010: Big_int.extract_big_int gives wrong results on negative arguments
(Xavier Leroy, report by Drake Wilson via Stéphane Glondu)
- #6024: Format syntax for printing @ is incompatible with 3.12.1
(Damien Doligez, report by Boris Yakobowski)
- #6001: Reduce the memory used by compiling Camlp4
(Hongbo Zhang and Gabriel Scherer, report by Henri Gouraud)
- #6031: Camomile problem with -with-frame-pointers
(Fabrice Le Fessant, report by Anil Madhavapeddy)
- #6032: better Random.self_init under Windows
(Alain Frisch, Xavier Leroy)
- #6033: Matching.inline_lazy_force needs eta-expansion (command-line flags)
(Pierre Chambart, Xavier Leroy and Luc Maranget,
regression report by Gabriel Scherer)
- #6046: testsuite picks up the wrong ocamlrun dlls
(Anil Madhavapeddy)
- #6056: Using 'match' prevents generalization of values
(Jacques Garrigue, report by Elnatan Reisner)
- #6058: 'ocamlbuild -use-ocamlfind -tag thread -package threads t.cma' fails
(Gabriel Scherer, report by Hezekiah M. Carty)
- #6069: ocamldoc: lexing: empty token
(Maxence Guesdon, Grégoire Henry, report by ygrek)
- #6072: configure does not handle FreeBSD current (i.e. 10) correctly
(Damien Doligez, report by Prashanth Mundkur)
- #6074: Wrong error message for failing Condition.broadcast
(Markus Mottl)
- #6084: Define caml_modify and caml_initialize as weak symbols to help
with Netmulticore
(Xavier Leroy, Gerd Stolpmann)
- #6090: Module constraint + private type seems broken in ocaml 4.01.0
(Jacques Garrigue, report by Kate Deplaix)
- #6109: Typos in ocamlbuild error messages
(Gabriel Kerneis)
- #6123: Assert failure when self escapes its class
(Jacques Garrigue, report by whitequark)
- #6158: Fatal error using GADTs
(Jacques Garrigue, report by Jeremy Yallop)
- #6163: Assert_failure using polymorphic variants in GADTs
(Jacques Garrigue, report by Leo White)
- #6164: segmentation fault on Num.power_num of 0/1
(Fabrice Le Fessant, report by Johannes Kanig)
- #6210: Camlp4 location error
(Hongbo Zhang, report by Jun Furuse)
Feature wishes:
- #5181: Merge common floating point constants in ocamlopt
(Benedikt Meurer)
- #5243: improve the ocamlbuild API documentation in signatures.mli
(Christophe Troestler)
- #5546: moving a function into an internal module slows down its use
(Alain Frisch, report by Fabrice Le Fessant)
- #5597: add instruction trace option 't' to OCAMLRUNPARAM
(Anil Madhavapeddy, Wojciech Meyer)
- #5676: IPv6 support under Windows
(Jérôme Vouillon, review by Jonathan Protzenko)
- #5721: configure -with-frame-pointers for Linux perf profiling
(Fabrice Le Fessant, test by Jérémie Dimino)
- #5722: toplevel: print full module path only for first record field
(Jacques Garrigue, report by ygrek)
- #5762: Add primitives for fast access to bigarray dimensions
(Pierre Chambart)
- #5769: Allow propagation of Sys.big_endian in native code
(Pierre Chambart, stealth commit by Fabrice Le Fessant)
- #5771: Add primitives for reading 2, 4, 8 bytes in strings and bigarrays
(Pierre Chambart)
- #5774: Add bswap primitives for amd64 and arm
(Pierre Chambart, test by Alain Frisch)
- #5795: Generate sqrtsd opcode instead of external call to sqrt on amd64
(Pierre Chambart)
- #5827: provide a dynamic command line parsing mechanism
(Hongbo Zhang)
- #5832: patch to improve "wrong file naming" error messages
(William Smith)
- #5864: Add a find operation to Set
(François Berenger)
- #5886: Small changes to compile for Android
(Jérôme Vouillon, review by Benedikt Meurer)
- #5902: -ppx based pre-processor executables accept arguments
(Alain Frisch, report by Wojciech Meyer)
- #5986: Protect against marshaling 64-bit integers in bytecode
(Xavier Leroy, report by Alain Frisch)
- #6049: support for OpenBSD/macppc platform
(Anil Madhavapeddy, review by Benedikt Meurer)
- #6059: add -output-obj rules for ocamlbuild
(Anil Madhavapeddy)
- #6060: ocamlbuild tags 'principal', 'strict_sequence' and 'short_paths'
(Anil Madhavapeddy)
- ocamlbuild tag 'no_alias_deps'
(Daniel Bünzli)
Tools:
- OCamlbuild now features a bin_annot tag to generate .cmt files.
(Jonathan Protzenko)
- OCamlbuild now features a strict_sequence tag to trigger the
strict-sequence option.
(Jonathan Protzenko)
- OCamlbuild now picks the non-core tools like ocamlfind and menhir from PATH
(Wojciech Meyer)
- #5884: Misc minor fixes and cleanup for emacs mode
(Stefan Monnier)
- #6030: Improve performance of -annot
(Guillaume Melquiond, Alain Frisch)
OCaml 4.00.1 (5 Oct 2012):
--------------------------
Bug fixes:
- #4019: better documentation of Str.matched_string
- #5111: ocamldoc, heading tags inside spans tags is illegal in html
- #5278: better error message when typing "make"
- #5468: ocamlbuild should preserve order of parametric tags
- #5563: harden Unix.select against file descriptors above FD_SETSIZE
- #5690: "ocamldoc ... -text README" raises exception
- #5700: crash with native-code stack backtraces under MacOS 10.8 x86-64
- #5707: AMD64 code generator: do not use r10 and r11 for parameter passing,
as these registers can be destroyed by the dynamic loader
- #5712: some documentation problems
- #5715: configuring with -no-shared-libs breaks under cygwin
- #5718: false positive on 'unused constructor' warning
- #5719: ocamlyacc generates code that is not warning 33-compliant
- #5725: ocamldoc output of preformatted code
- #5727: emacs caml-mode indents shebang line in toplevel scripts
- #5729: tools/untypeast.ml creates unary Pexp_tuple
- #5731: instruction scheduling forgot to account for destroyed registers
- #5735: %apply and %revapply not first class citizens
- #5738: first class module patterns not handled by ocamldep
- #5742: missing bound checks in Array.sub
- #5744: ocamldoc error on "val virtual"
- #5757: GC compaction bug (crash)
- #5758: Compiler bug when matching on floats
- #5761: Incorrect bigarray custom block size
OCaml 4.00.0 (26 Jul 2012):
---------------------------
(Changes that can break existing programs are marked with a "*")
- The official name of the language is now OCaml.
Language features:
- Added Generalized Algebraic Data Types (GADTs) to the language.
See chapter "Language extensions" of the reference manual for documentation.
- It is now possible to omit type annotations when packing and unpacking
first-class modules. The type-checker attempts to infer it from the context.
Using the -principal option guarantees forward compatibility.
- New (module M) and (module M : S) syntax in patterns, for immediate
unpacking of a first-class module.
Compilers:
- Revised simplification of let-alias (#5205, #5288)
- Better reporting of compiler version mismatch in .cmi files
* Warning 28 is now enabled by default.
- New option -absname to use absolute paths in error messages
- Optimize away compile-time beta-redexes, e.g. (fun x y -> e) a b.
- Added option -bin-annot to dump the AST with type annotations.
- Added lots of new warnings about unused variables, opens, fields,
constructors, etc.
* New meaning for warning 7: it is now triggered when a method is overridden
with the "method" keyword. Use "method!" to avoid the warning.
Native-code compiler:
- Optimized handling of partially-applied functions (#5287)
- Small improvements in code generated for array bounds checks (#5345,
#5360).
* New ARM backend (#5433):
. Supports both Linux/EABI (armel) and Linux/EABI+VFPv3 (armhf).
. Added support for the Thumb-2 instruction set with average code size
savings of 28%.
. Added support for position-independent code, natdynlink, profiling and
exception backtraces.
- Generation of CFI information, and filename/line number debugging (with -g)
annotations, enabling in particular precise stack backtraces with
the gdb debugger. Currently supported for x86 32-bits and 64-bits only.
(#5487)
- New tool: ocamloptp, the equivalent of ocamlcp for the native-code compiler.
OCamldoc:
- #5645: ocamldoc doesn't handle module/type substitution in signatures
- #5544: improve HTML output (less formatting in html code)
- #5522: allow referring to record fields and variant constructors
- fix #5419 (error message in french)
- fix #5535 (no cross ref to class after dump+load)
* Use first class modules for custom generators, to be able to
load various plugins incrementally adding features to the current
generator
* #5507: Use Location.t structures for locations.
- fix: do not keep code when not told to keep code.
Standard library:
- Added float functions "hypot" and "copysign" (#3806, #4752, #5246)
* Arg: options with empty doc strings are no longer included in the usage string
(#5437)
- Array: faster implementations of "blit", "copy", "sub", "append" and "concat"
(#2395, #2787, #4591)
* Hashtbl:
. Statistically-better generic hash function based on Murmur 3 (#5225)
. Fixed behavior of generic hash function w.r.t. -0.0 and NaN (#5222)
. Added optional "random" parameter to Hashtbl.create to randomize
collision patterns and improve security (#5572, CVE-2012-0839)
. Added "randomize" function and "R" parameter to OCAMLRUNPARAM
to turn randomization on by default (#5572, CVE-2012-0839)
. Added new functorial interface "MakeSeeded" to support randomization
with user-provided seeded hash functions.
. Install new header <caml/hash.h> for C code.
- Filename: on-demand (lazy) initialization of the PRNG used by "temp_file".
- Marshal: marshalling of function values (flag Marshal.Closures) now
also works for functions that come from dynamically-loaded modules (#5215)
- Random:
. More random initialization (Random.self_init()), using /dev/urandom
when available (e.g. Linux, FreeBSD, MacOS X, Solaris)
* Faster implementation of Random.float (changes the generated sequences)
- Format strings for formatted input/output revised to correct #5380
. Consistently treat %@ as a plain @ character
. Consistently treat %% as a plain % character
- Scanf: width and precision for floating point numbers are now handled
- Scanf: new function "unescaped" (#3888)
- Set and Map: more efficient implementation of "filter" and "partition"
- String: new function "map" (#3888)
Installation procedure:
- Compiler internals are now installed in `ocamlc -where`/compiler-libs.
The files available there include the .cmi interfaces for all compiler
modules, plus the following libraries:
ocamlcommon.cma/.cmxa modules common to ocamlc, ocamlopt, ocaml
ocamlbytecomp.cma/.cmxa modules for ocamlc and ocaml
ocamloptcomp.cma/.cmxa modules specific to ocamlopt
ocamltoplevel.cma modules specific to ocaml
(#8255, #4653, frequently-asked feature).
* Some .cmi for toplevel internals that used to be installed in
`ocamlc -where` are now to be found in `ocamlc -where`/compiler-libs.
Add "-I +compiler-libs" where needed.
* toplevellib.cma is no longer installed because subsumed by
ocamlcommon.cma ocamlbytecomp.cma ocamltoplevel.cma
- Added a configuration option (-with-debug-runtime) to compile and install
a debug version of the runtime system, and a compiler option
(-runtime-variant) to select the debug runtime.
Bug Fixes:
- #8109: functions of the Lazy module whose named started with 'lazy_' have
been deprecated, and new ones without the prefix added
- #3571: in Bigarrays, call msync() before unmapping to commit changes
- #4292: various documentation problems
- #4511, #4838: local modules remove polymorphism
* #4549: Filename.dirname is not handling multiple / on Unix
- #4688: (Windows) special floating-point values aren't converted to strings
correctly
- #4697: Unix.putenv leaks memory on failure
- #4705: camlp4 does not allow to define types with `True or `False
- #4746: wrong detection of stack overflows in native code under Linux
- #4869: rare collisions between assembly labels for code and data
- #4880: "assert" constructs now show up in the exception stack backtrace
- #4892: Array.set could raise "out of bounds" before evaluating 3rd arg
- #4937: camlp4 incorrectly handles optional arguments if 'option' is
redefined
- #5024: camlp4r now handles underscores in irrefutable pattern matching of
records
- #5064, #5485: try to ensure that 4K words of stack are available
before calling into C functions, raising a Stack_overflow exception
otherwise. This reduces (but does not eliminate) the risk of
segmentation faults due to stack overflow in C code
- #5073: wrong location for 'Unbound record field label' error
- #5084: sub-sub-module building fails for native code compilation
- #5120: fix the output function of Camlp4.Debug.formatter
- #5131: compilation of custom runtime with g++ generates lots of warnings
- #5137: caml-types-explore does not work
- #5159: better documentation of type Lexing.position
- #5171: Map.join does more comparisons than needed
- #5176: emacs mode: stack overflow in regexp matcher
- #5179: port OCaml to mingw-w64
- #5211: updated Genlex documentation to state that camlp4 is mandatory for
'parser' keyword and associated notation
- #5214: ocamlfind plugin invokes 'cut' utility
- #5218: use $(MAKE) instead of "make" in Makefiles
- #5224: confusing error message in non-regular type definition
- #5231: camlp4: fix parsing of <:str_item< type t = $x$ >>
- #5233: finaliser on weak array gives dangling pointers (crash)
- #5238, #5277: Sys_error when getting error location
- #5261, #5497: Ocaml source-code examples are not "copy-paste-able"
* #5279: executable name is not initialized properly in caml_startup_code
- #5290: added hash functions for channels, nats, mutexes, conditions
- #5291: undetected loop in class initialization
- #5295: OS threads: problem with caml_c_thread_unregister()
- #5301: camlp4r and exception equal to another one with parameters
- #5305: prevent ocamlbuild from complaining about links to _build/
- #5306: comparing to Thread.self() raises exception at runtime
- #5309: Queue.add is not thread/signal safe
- #5310: Ratio.create_ratio/create_normalized_ratio have misleading names
- #5311: better message for warning 23
* #5312: command-line arguments @reponsefile auto-expansion feature
removed from the Windows OCaml runtime, to avoid conflicts with "-w @..."
- #5313: ocamlopt -g misses optimizations
- #5214: ocamlfind plugin invokes 'cut' utility
- #5316: objinfo now shows ccopts/ccobjs/force_link when applicable
- #5318: segfault on stack overflow when reading marshaled data
- #5319: %r11 clobbered by Lswitch in Windows AMD64 native-code compilation
- #5322: type abbreviations expanding to a universal type variable
- #5328: under Windows, Unix.select leaves sockets in non-blocking mode
- #5330: thread tag with '.top' and '.inferred.mli' targets
- #5331: ocamlmktop is not always a shell script
- #5335: Unix.environment segfaults after a call to clearenv
- #5338: sanitize.sh has windows style end-of-lines (mingw)
- #5344: some predefined exceptions need special printing
- #5349: Hashtbl.replace uses new key instead of reusing old key
- #5356: ocamlbuild handling of 'predicates' for ocamlfind
- #5364: wrong compilation of "((val m : SIG1) : SIG2)"
- #5370: ocamldep omits filename in syntax error message
- #5374: camlp4 creates wrong location for type definitions
- #5380: strange sscanf input segfault
- #5382: EOPNOTSUPP and ENOTSUPP different on exotic platforms
- #5383: build failure in Win32/MSVC
- #5387: camlp4: str_item and other syntactic elements with Nils are
not very usable
- #5389: compaction sometimes leaves a very large heap
- #5393: fails to build from source on GNU/kFreeBSD because of -R link option
- #5394: documentation for -dtypes is missing in manpage
- #5397: Filename.temp_dir_name should be mutable
- #5410: fix printing of class application with Camlp4
- #5416: (Windows) Unix.(set|clear)_close_on_exec now preserves blocking mode
- #5435: ocamlbuild does not find .opt executables on Windows
- #5436: update object ids on unmarshaling
- #5442: camlp4: quotation issue with strings
- #5453: configure doesn't find X11 under Ubuntu/MultiarchSpec
- #5461: Double linking of bytecode modules
- #5463: Bigarray.*.map_file fail if empty array is requested
- #5465: increase stack size of ocamlopt.opt for windows
- #5469: private record type generated by functor loses abbreviation
- #5475: Wrapper script for interpreted LablTk wrongly handles command line
parameters
- #5476: bug in native code compilation of let rec on float arrays
- #5477: use pkg-config to configure graphics on linux
- #5481: update camlp4 magic numbers
- #5482: remove bashism in test suite scripts
- #5495: camlp4o dies on infix definition (or)
- #5498: Unification with an empty object only checks the absence of
the first method
- #5503: error when ocamlbuild is passed an absolute path as build directory
- #5509: misclassification of statically-allocated empty array that
falls exactly at beginning of an otherwise unused data page.
- #5510: ocamldep has duplicate -ml{,i}-synonym options
- #5511: in Bigarray.reshape, unwarranted limitation on new array dimensions.
- #5513: Int64.div causes floating point exception (ocamlopt, x86)
- #5516: in Bigarray C stubs, use C99 flexible array types if possible
- #5518: segfault with lazy empty array
- #5531: Allow ocamlbuild to add ocamldoc flags through -docflag
and -docflags switches
- #5538: combining -i and -annot in ocamlc
- #5543: in Bigarray.map_file, try to avoid using lseek() when growing file
- #5648: (probably fixed) test failures in tests/lib-threads
- #5551: repeated calls to find_in_path degrade performance
- #5552: Mac OS X: unrecognized gcc option "-no-cpp-precomp"
- #5555: add Hashtbl.reset to resize the bucket table to its initial size
- #5560: incompatible type for tuple pattern with -principal
- #5575: Random states are not marshallable across architectures
- #5579: camlp4: when a plugin is loaded in the toplevel,
Token.Filter.define_filter has no effect before the first syntax error
- #5585: typo: "explicitely"
- #5587: documentation: "allows to" is not correct English
- #5593: remove C file when -output-obj fails
- #5597: register names for instrtrace primitives in embedded bytecode
- #5598: add backslash-space support in strings in ocamllex
- #5603: wrong .file debug info generated by ocamlopt -g
- #5604: fix permissions of files created by ocamlbuild itself
- #5610: new unmarshaler (from #5318) fails to freshen object identifiers
- #5614: add missing -linkall flag when compiling ocamldoc.opt
- #5616: move ocamlbuild documentation to the reference manual
- #5619: Uncaught CType.Unify exception in the compiler
- #5620: invalid printing of type manifest (camlp4 revised syntax)
- #5637: invalid printing of anonymous type parameters (camlp4 revised syntax)
- #5643: issues with .cfi and .loc directives generated by ocamlopt -g
- #5644: Stream.count broken when used with Sapp or Slazy nodes
- #5647: Cannot use install_printer in debugger
- #5651: printer for abstract data type (camlp4 revised syntax)
- #5654: self pattern variable location tweak
- #5655: ocamlbuild doesn't pass cflags when building C stubs
- #5657: wrong error location for abbreviated record fields
- #5659: ocamlmklib -L option breaks with MSVC
- #5661: fixes for the test suite
- #5668: Camlp4 produces invalid syntax for "let _ = ..."
- #5671: initialization of compare_ext field in caml_final_custom_operations()
- #5677: do not use "value" as identifier (genprintval.ml)
- #5687: dynlink broken when used from "output-obj" main program (bytecode)
- problem with printing of string literals in camlp4 (reported on caml-list)
- emacs mode: colorization of comments and strings now works correctly
- problem with forall and method (reported on caml-list on 2011-07-26)
- crash when using OCAMLRUNPARAM=a=X with invalid X (reported in private)
Feature wishes:
- #2757: new option "-stdin" to make ocaml read stdin as a script
- #3358: better error message when mixing -a and .cmxa
- #3492: documentation: remove restriction on mixed streams
- #7971: allow configuring LIBDIR, BINDIR, and MANDIR relative to $(PREFIX)
- #8285: add Digest.from_hex
- #8341: toplevel: add option to suppress continuation prompts
- #4278: configure: option to disable "graph" library
- #4444: new String.trim function, removing leading and trailing whistespace
- #4549: make Filename.dirname/basename POSIX compliant
- #4830: add option -v to expunge.ml
- #4898: new Sys.big_endian boolean for machine endianness
- #4963, #5467: no extern "C" into ocaml C-stub headers
- #5199: tests are run only for bytecode if either native support is missing,
or a non-empty value is set to "BYTECODE_ONLY" Makefile variable
- #5215: marshalling of dynlinked closure
- #5236: new '%revapply' primitive with the semantics 'revapply x f = f x',
and '%apply' with semantics 'apply f x = f x'.
- #5255: natdynlink detection on powerpc, hurd, sparc
- #5295: OS threads: problem with caml_c_thread_unregister()
- #5297: compiler now checks existence of builtin primitives
- #5329: (Windows) more efficient Unix.select if all fd's are sockets
- #5357: warning for useless open statements
- #5358: first class modules don't allow "with type" declarations for types
in sub-modules
- #5385: configure: emit a warning when MACOSX_DEPLOYMENT_TARGET is set
- #5396: ocamldep: add options -sort, -all, and -one-line
- #5397: Filename.temp_dir_name should be mutable
- #5403: give better error message when emacs is not found in PATH
- #5411: new directive for the toplevel: #load_rec
- #5420: Unix.openfile share mode (Windows)
- #5421: Unix: do not leak fds in various open_proc* functions
- #5434: implement Unix.times in win32unix (partially)
- #5438: new warnings for unused declarations
- #5439: upgrade config.guess and config.sub
- #5445 and others: better printing of types with user-provided names
- #5454: Digest.compare is missing and md5 doc update
- #5455: .emacs instructions, add lines to recognize ocaml scripts
- #5456: pa_macro: replace __LOCATION__ after macro expansion; add LOCATION_OF
- #5461: bytecode: emit warning when linking two modules with the same name
- #5478: ocamlopt assumes ar command exists
- #5479: Num.num_of_string may raise an exception, not reflected in the
documentation.
- #5501: increase IO_BUFFER_SIZE to 64KiB
- #5532: improve error message when bytecode file is wrong
- #5555: add function Hashtbl.reset to resize the bucket table to
its initial size.
- #5586: increase UNIX_BUFFER_SIZE to 64KiB
- #5597: register names for instrtrace primitives in embedded bytecode
- #5599: Add warn() tag in ocamlbuild to control -w compiler switch
- #5628: add #remove_directory and Topdirs.remove_directory to remove
a directory from the load path
- #5636: in system threads library, issue with linking of pthread_atfork
- #5666: C includes don't provide a revision number
- ocamldebug: ability to inspect values that contain code pointers
- ocamldebug: new 'environment' directive to set environment variables
for debuggee
- configure: add -no-camlp4 option
Shedding weight:
* Removed the obsolete native-code generators for Alpha, HPPA, IA64 and MIPS.
* The "DBM" library (interface with Unix DBM key-value stores) is no
longer part of this distribution. It now lives its own life at
https://forge.ocamlcore.org/projects/camldbm/
* The "OCamlWin" toplevel user interface for MS Windows is no longer
part of this distribution. It now lives its own life at
https://forge.ocamlcore.org/projects/ocamltopwin/
Other changes:
- Copy VERSION file to library directory when installing.
OCaml 3.12.1 (4 Jul 2011):
--------------------------
Bug fixes:
- #4345, #4767: problems with camlp4 printing of float values
- #4380: ocamlbuild should not use tput on windows
- #4487, #5164: multiple 'module type of' are incompatible
- #4552: ocamlbuild does not create symlinks when using '.itarget' file
- #4673, #5144: camlp4 fails on object copy syntax
- #4702: system threads: cleanup tick thread at exit
- #4732: camlp4 rejects polymorphic variants using keywords from macros
- #4778: Win32/MSVC port: rare syntax error in generated MASM assembly file
- #4794, #4959: call annotations not generated by ocamlopt
- #4820: revised syntax pretty printer crashes with 'Stack_overflow'
- #4928: wrong printing of classes and class types by camlp4
- #4939: camlp4 rejects patterns of the '?x:_' form
- #4967: ocamlbuild passes wrong switches to ocamldep through menhir
- #4972: mkcamlp4 does not include 'dynlink.cma'
- #5039: ocamlbuild should use '-linkpkg' only when linking programs
- #5066: ocamldoc: add -charset option used in html generator
- #5069: fcntl() in caml_sys_open may block, do it within blocking section
- #5071, #5129, #5134: inconsistencies between camlp4 and camlp4* binaries
- #5080, #5104: regression in type constructor handling by camlp4
- #5090: bad interaction between toplevel and camlp4
- #5095: ocamlbuild ignores some tags when building bytecode objects
- #5100: ocamlbuild always rebuilds a 'cmxs' file
- #5103: build and install objinfo when building with ocamlbuild
- #5109: crash when a parser calls a lexer that calls another parser
- #5110: invalid module name when using optional argument
- #5115: bytecode executables produced by msvc64 port crash on 32-bit versions
- #5117: bigarray: wrong function name without HAS_MMAP; missing include
- #5118: Camlp4o and integer literals
- #5122: camlp4 rejects lowercase identifiers for module types
- #5123: shift_right_big_int returns a wrong zero
- #5124: substitution inside a signature leads to odd printing
- #5128: typo in 'Camlp4ListComprehension' syntax extension
- #5136: obsolete function used in emacs mode
- #5145: ocamldoc: missing html escapes
- #5146: problem with spaces in multi-line string constants
- #5149: (partial) various documentation problems
- #5156: rare compiler crash with objects
- #5165: ocamlbuild does not pass '-thread' option to ocamlfind
- #5167: camlp4r loops when printing package type
- #5172: camlp4 support for 'module type of' construct
- #5175: in bigarray accesses, make sure bigarray expr is evaluated only once
- #5177: Gc.compact implies Gc.full_major
- #5182: use bytecode version of ocamldoc to generate man pages
- #5184: under Windows, alignment issue with bigarrays mapped from files
- #5188: double-free corruption in bytecode system threads
- #5192: mismatch between words and bytes in interpreting max_young_wosize
- #5202: error in documentation of atan2
- #5209: natdynlink incorrectly detected on BSD systems
- #5213: ocamlbuild should pass '-rectypes' to ocamldoc when needed
- #5217: ocamlfind plugin should add '-linkpkg' for toplevel
- #5228: document the exceptions raised by functions in 'Filename'
- #5229: typo in build script ('TAG_LINE' vs 'TAGLINE')
- #5230: error in documentation of Scanf.Scanning.open_in
- #5234: option -shared reverses order of -cclib options
- #5237: incorrect .size directives generated for x86-32 and x86-64
- #5244: String.compare uses polymorphic compare_val (regression of #4194)
- #5248: regression introduced while fixing #5118
- #5252: typo in docs
- #5258: win32unix: unix fd leak under windows
- #5269: (tentative fix) Wrong ext_ref entries in .annot files
- #5272: caml.el doesn't recognize downto as a keyword
- #5276: issue with ocamlc -pack and recursively-packed modules
- #5280: alignment constraints incorrectly autodetected on MIPS 32
- #5281: typo in error message
- #5308: unused variables not detected in "include (struct .. end)"
- camlp4 revised syntax printing bug in the toplevel (reported on caml-list)
- configure: do not define _WIN32 under cygwin
- Hardened generic comparison in the case where two custom blocks
are compared and have different sets of custom operations.
- Hardened comparison between bigarrays in the case where the two
bigarrays have different kinds.
- Fixed wrong autodetection of expm1() and log1p().
- don't add .exe suffix when installing the ocamlmktop shell script
- ocamldoc: minor fixes related to the display of ocamldoc options
- fixed bug with huge values in OCAMLRUNPARAM
- mismatch between declaration and definition of caml_major_collection_slice
Feature wishes:
- #4992: added '-ml-synonym' and '-mli-synonym' options to ocamldep
- #5065: added '-ocamldoc' option to ocamlbuild
- #5139: added possibility to add options to ocamlbuild
- #5158: added access to current camlp4 parsers and printers
- #5180: improved instruction selection for float operations on amd64
- stdlib: added a 'usage_string' function to Arg
- allow with constraints to add a type equation to a datatype definition
- ocamldoc: allow to merge '@before' tags like other ones
- ocamlbuild: allow dependency on file "_oasis"
Other changes:
- Changed default minor heap size from 32k to 256k words.
- Added new operation 'compare_ext' to custom blocks, called when
comparing a custom block value with an unboxed integer.
Objective Caml 3.12.0 (2 Aug 2010):
-----------------------------------
(Changes that can break existing programs are marked with a "*" )
Language features:
- Shorthand notation for records: in expressions and patterns,
{ lbl } stands for { lbl = lbl } and { M.lbl } for { M.lbl = lbl }
- Record patterns of the form { lbl = pat; _ } to mark that not all
labels are listed, purposefully. (See new warning below.)
- Explicit naming of a generic type; in an expression
"fun ... (type t) ... -> e", the type t is considered abstract in its
scope (the arguments that follow it and the body of the function),
and then replaced by a fresh type variable. In particular, the type
t can be used in contexts where a type variable is not allowed
(e.g. for defining an exception in a local module).
- Explicit polymorphic types and polymorphic recursion. In let
definitions, one can write an explicit polymorphic type just
immediately the function name; the polymorphism will be enforced,
and recursive calls may use the polymorphism.
The syntax is the same as for polymorphic methods:
"let [rec] <ident> : 'a1 ... 'an. <typexp> = ..."
- First-class packages modules.
New kind of type expression, for packaged modules: (module PT).
New kind of expression, to pack a module as a first-class value:
(module MODEXPR : PT).
New kind of module expression, to unpack a first-class value as a module:
(val EXPR : PT).
PT is a package type of the form "S" or
"S with type t1 = ... and ... and type tn = ..." (S refers to a module type).
- Local opening of modules in a subexpression.
Syntax: "let open M in e", or "M.(e)"
- In class definitions, method and instance variable override can now
be made explicit, by writing "method!", "val!" or "inherit!" in place of
"method", "val" and "inherit". It is an error to override an
undefined member (or to use overriding inheritance when nothing get
overridden). Additionally, these constructs disactivate respectively
warnings 7 (method override, code 'M') and 13 (instance variable
override, code 'V'). Note that, by default, warning 7 is inactive
and warning 13 is active.
- "Destructive" substitution in signatures.
By writing "<signature> with type t := <typeconstr>" and
"<signature> with module M := <module-path>" one replaces "t" and "M"
inside the signature, removing their respective fields. Among other
uses, this allows to merge two signatures containing identically
named fields.
* While fixing #4824, also corrected a gaping hole in the type checker,
which allowed instantiating separately object parameters and instance
variables in an interface. This hole was here since the beginning of
ocaml, and as a result many programs using object inheritance in a non
trivial way will need to be corrected. You can look at lablgtk2 for an
example.
Compilers and toplevel:
- Warnings are now numbered and can be switched on and off individually.
The old system with letters referring to sets of warnings is still
supported.
- New warnings:
+ 9 (code 'R') to signal record patterns without "; _" where
some labels of the record type are not listed in the pattern.
+ 28 when giving a wildcard argument to a constant constructor in
a pattern-matching.
+ 29 when an end-of-line appears unescaped in a string constant.
+ 30 when the same constructor or record field is defined twice in
mutually-recursive type definitions.
* The semantics of warning 7 (code 'M', method override) have changed
(it now detects all overrides, not just repeated definitions inside
the same class body), and it is now inactive by default.
- Better error report in case of unbound qualified identifier: if the module
is unbound this error is reported in the first place.
- Added option '-strict-sequence' to force left hand part of sequence to have
type unit.
- Added option '-no-app-funct' to turn applicative functors off.
This option can help working around mysterious type incompatibilities
caused by the incomplete comparison of applicative paths F(X).t.
Native-code compiler:
- AMD64: shorter and slightly more efficient code generated for
float comparisons.
Standard library:
- Format: new function ikfprintf analogous to ifprintf with a continuation
argument.
* #4210, #4245: stricter range checking in string->integer conversion
functions (int_of_string, Int32.of_string, Int64.of_string,
Nativeint.of_string). The decimal string corresponding to
max_int + 1 is no longer accepted.
- Scanf: to prevent confusion when mixing Scanf scanning functions and direct
low level input, value Scanf.stdin has been added.
* Random: changed the algorithm to produce better randomness. Now passes the
DieHard tests.
- Map: implement functions from Set that make sense for Map.
Other libraries:
* Str: letters that constitute a word now include digits 0-9 and
underscore _. This changes the interpretation of '\b' (word boundary)
in regexps, but is more consistent with other regexp libraries. (#4874).
Ocamlbuild:
- Add support for native dynlink.
New tool:
- ocamlobjinfo: displays various information, esp. dependencies, for
compiled OCaml files (.cmi, .cmo, .cma, .cmx, .cmxa, .cmxs, and bytecode
executables). Extends and makes more official the old objinfo tool
that was installed by some OCaml packages.
All tools:
- #4857: add a -vnum option to display the version number and nothing else
Bug Fixes:
- #4012: Map.map and Map.mapi do not conform to specification
- #4478: better error messages for type definition mismatches
- #4683: labltk script uses fixed path on windows
- #4742: finalisation function raising an exception blocks other finalisations
- #4775: compiler crash on crazy types (temporary fix)
- #4824: narrowing the type of class parameters with a module specification
- #4862: relaxed value restriction and records
- #4884: optional arguments do not work when Some is redefined
- #4964: parenthesized names for infix functions in annot files
- #4970: better error message for instance variables
- #4975: spelling mistakes
- #4988: contravariance lost with ocamlc -i
- #5004: problem in Buffer.add_channel with very large lengths.
- #5008: on AMD64/MSVC port, rare float corruption during GC.
- #5018: wrong exception raised by Dynlink.loadfile.
- #5057: fatal typing error with local module + functor + polymorphic variant
- Wrong type for Obj.add_offset.
- Small problem with representation of Int32, Int64, and Nativeint constants.
- Use RTLD_LOCAL for native dynlink in private mode.
Objective Caml 3.11.2 (20 Jan 2010):
------------------------------------
Bug fixes:
- #4151: better documentation for min and max w.r.t. NaN
- #4421: ocamlbuild uses wrong compiler for C files
- #4710, #4720: ocamlbuild does not use properly configuration information
- #4750: under some Windows installations, high start-up times for Unix lib
- #4777: problem with scanf and CRLF
- #4783: ocamlmklib problem under Windows
- #4810: BSD problem with socket addresses, e.g. in Unix.getnameinfo
- #4813: issue with parsing of float literals by the GNU assembler
- #4816: problem with modules and private types
- #4818: missed opportunity for type-based optimization of bigarray accesses
- #4821: check for duplicate method names in classes
- #4823: build problem on Mac OS X
- #4836: spurious errors raised by Unix.single_write under Windows
- #4841, #4860, #4930: problem with ocamlopt -output-obj under Mac OS X
- #4847: C compiler error with ocamlc -output-obj under Win64
- #4856: ocamlbuild uses ocamlrun to execute a native plugin
- #4867, #4760: ocamlopt -shared fails on Mac OS X 64bit
- #4873: ocamlbuild ignores "thread" tag when building a custom toplevel
- #4890: ocamlbuild tries to use native plugin on bytecode-only arch
- #4896: ocamlbuild should always pass -I to tools for external libraries
- #4900: small bug triggering automatic compaction even if max_overhead = 1M
- #4902: bug in %.0F printf format
- #4910: problem with format concatenation
- #4922: ocamlbuild recompiles too many files
- #4923: missing \xff for scanf %S
- #4933: functors not handling private types correctly
- #4940: problem with end-of-line in DOS text mode, tentative fix
- #4953: problem compiling bytecode interpreter on ARM in Thumb mode.
- #4955: compiler crash when typing recursive type expression with constraint
- Module Printf: the simple conversion %F (without width indication) was not
treated properly.
- Makefile: problem with cygwin, flexdll, and symbolic links
- Various build problems with ocamlbuild under Windows with msvc
Feature wishes:
- #2337: (tentative implementation) make ocamldebug use #linenum annotations
- #2464, #4477: custom exception printers
- #3456: Obj.double_field and Obj.set_double_field functions
- #4003: destination directory can be given to Filename.[open_]temp_file
- #4647: Buffer.blit function
- #4685: access to Filename.dir_sep
- #4703: support for debugging embedded applications
- #4723: "clear_rules" function to empty the set of ocamlbuild rules
- #4921: configure option to help cross-compilers
Objective Caml 3.11.1 (12 Jun 2009):
------------------------------------
Bug fixes:
- #4095: ocamldebug: strange behaviour of control-C
- #4403: ocamldebug: improved handling of packed modules
- #4650: Str.regexp_case_fold mis-handling complemented character sets [^a]
- #4660: Scanf.format_from_string: handling of double quote
- #4666: Unix.exec* failure in multithread programs under MacOS X and FreeBSD
- #4667: debugger out of sync with dynlink changes
- #4678: random "out of memory" error with systhreads
- #4690: issue with dynamic loading under MacOS 10.5
- #4692: wrong error message with options -i and -pack passed to ocamlc
- #4699: in otherlibs/dbm, fixed construction of dlldbm.so.
- #4704: error in caml_modify_generational_global_root()
- #4708: (ocamldoc) improved printing of infix identifiers such as "lor".
- #4722: typo in configure script
- #4729: documented the fact that PF_INET6 is not available on all platforms
- #4730: incorrect typing involving abbreviation "type 'a t = 'a"
- #4731: incorrect quoting of arguments passed to the assembler on x86-64
- #4735: Unix.LargeFile.fstat cannot report size over 32bits on Win32
- #4740: guard against possible processor error in
{Int32,Int64,Nativeint}.{div,rem}
- #4745: type inference wrongly produced non-generalizable type variables.
- #4749: better pipe size for win32unix
- #4756: printf: no error reported for wrong format '%_s'
- #4758: scanf: handling of \<newline> by format '%S'
- #4766: incorrect simplification of some type abbreviations.
- #4768: printf: %F does not respect width and precision specifications
- #4769: Format.bprintf fails to flush
- #4775: fatal error Ctype.Unify during module type-checking (temporary fix)
- #4776: bad interaction between exceptions and classes
- #4780: labltk build problem under Windows.
- #4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix error.
- #4792: bug in Big_int.big_int_of_int64 on 32-bit platforms.
- #4796: ocamlyacc: missing NUL termination of string
- #4804: bug in Big_int.int64_of_big_int on 32-bit platforms.
- #4805: improving compatibility with the clang C compiler
- #4809: issue with Unix.create_process under Win32
- #4814: ocamlbrowser: crash when editing comments
- #4816: module abbreviations remove 'private' type restrictions
- #4817: Object type gives error "Unbound type parameter .."
- Module Parsing: improved computation of locations when an ocamlyacc rule
starts with an empty nonterminal
- Type-checker: fixed wrong variance computation for private types
- x86-32 code generator, MSVC port: wrong "fld" instruction generated.
- ocamlbuild: incorrectly using the compile-time value of $OCAMLLIB
- Makefile problem when configured with -no-shared-libs
- ocamldoc: use dynamic loading in native code
Other changes:
- Improved wording of various error messages
(contributed by Jonathan Davies, Citrix).
- Support for 64-bit mode in Solaris/x86 (#4670).
Objective Caml 3.11.0 (03 Dec 2008):
------------------------------------
(Changes that can break existing programs are marked with a "*" )
Language features:
- Addition of lazy patterns: "lazy <pat>" matches suspensions whose values,
after forcing, match the pattern <pat>.
- Introduction of private abbreviation types "type t = private <type-expr>",
for abstracting the actual manifest type in type abbreviations.
- Subtyping is now allowed between a private abbreviation and its definition,
and between a polymorphic method and its monomorphic instance.
Compilers:
- The file name for a compilation unit should correspond to a valid
identifier (Otherwise dynamic linking and other things can fail, and
a warning is emitted.)
* Revised -output-obj: the output name must now be provided; its
extension must be one of .o/.obj, .so/.dll, or .c for the
bytecode compiler. The compilers can now produce a shared library
(with all the needed -ccopts/-ccobjs options) directly.
- -dtypes renamed to -annot, records (in .annot files) which function calls
are tail calls.
- All compiler error messages now include a file name and location, for
better interaction with Emacs' compilation mode.
- Optimized compilation of "lazy e" when the argument "e" is
already evaluated.
- Optimized compilation of equality tests with a variant constant constructor.
- The -dllib options recorded in libraries are no longer ignored when
-use_runtime or -use_prims is used (unless -no_auto_link is
explicitly used).
- Check that at most one of -pack, -a, -shared, -c, -output-obj is
given on the command line.
- Optimized compilation of private types as regular manifest types
(e.g. abbreviation to float, float array or record types with only
float fields).
Native-code compiler:
- New port: Mac OS X / Intel in 64-bit mode (configure with -cc "gcc -m64").
- A new option "-shared" to produce a plugin that can be dynamically
loaded with the native version of Dynlink.
- A new option "-nodynlink" to enable optimizations valid only for code
that is never dynlinked (no-op except for AMD64).
- More aggressive unboxing of floats and boxed integers.
- Can select which assembler and asm options to use at configuration time.
Run-time system:
- New implementation of the page table describing the heap (two-level
array in 32 bits, sparse hashtable in 64 bits), fixes issues with address
space randomization on 64-bit OS (#4448).
- New "generational" API for registering global memory roots with the GC,
enables faster scanning of global roots.
(The functions are caml_*_generational_global_root in <caml/memory.h>.)
- New function "caml_raise_with_args" to raise an exception with several
arguments from C.
- Changes in implementation of dynamic linking of C code:
under Win32, use Alain Frisch's flexdll implementation of the dlopen
API; under MacOSX, use dlopen API instead of MacOSX bundle API.
- Programs may now choose a first-fit allocation policy instead of
the default next-fit. First-fit reduces fragmentation but is
slightly slower in some cases.
Standard library:
- Parsing library: new function "set_trace" to programmatically turn
on or off the printing of a trace during parsing.
- Printexc library: new functions "print_backtrace" and "get_backtrace"
to obtain a stack backtrace of the most recently raised exception.
New function "record_backtrace" to turn the exception backtrace mechanism
on or off from within a program.
- Scanf library: fine-tuning of meta format implementation;
fscanf behaviour revisited: only one input buffer is allocated for any
given input channel;
the %n conversion does not count a lookahead character as read.
Other libraries:
- Dynlink: on some platforms, the Dynlink library is now available in
native code. The boolean Dynlink.is_native allows the program to
know whether it has been compiled in bytecode or in native code.
- Bigarrays: added "unsafe_get" and "unsafe_set"
(non-bound-checking versions of "get" and "set").
- Bigarrays: removed limitation "array dimension < 2^31".
- Labltk: added support for TK 8.5.
- Num: added conversions between big_int and int32, nativeint, int64.
More efficient implementation of Num.quo_num and Num.mod_num.
- Threads: improved efficiency of mutex and condition variable operations;
improved interaction with Unix.fork (#4577).
- Unix: added getsockopt_error returning type Unix.error.
Added support for TCP_NODELAY and IPV6_ONLY socket options.
- Win32 Unix: "select" now supports all kinds of file descriptors.
Improved emulation of "lockf" (#4609).
Tools:
- ocamldebug now supported under Windows (MSVC and Mingw ports),
but without the replay feature. (Contributed by Dmitry Bely
and Sylvain Le Gall at OCamlCore with support from Lexifi.)
- ocamldoc: new option -no-module-constraint-filter to include functions
hidden by signature constraint in documentation.
- ocamlmklib and ocamldep.opt now available under Windows ports.
- ocamlmklib no longer supports the -implib option.
- ocamlnat: an experimental native toplevel (not built by default).
Camlp4:
* programs linked with camlp4lib.cma now also need dynlink.cma.
Bug fixes:
- Major GC and heap compaction: fixed bug involving lazy values and
out-of-heap pointers.
- #3915: updated most man pages.
- #4261: type-checking of recursive modules
- #4308: better stack backtraces for "spontaneous" exceptions such as
Stack_overflow, Out_of_memory, etc.
- #4338: Str.global_substitute, Str.global_replace and the Str.*split*
functions are now tail-recursive.
- #4503: fixed bug in classify_float on ARM.
- #4512: type-checking of recursive modules
- #4517: crash in ocamllex-generated lexers.
- #4542: problem with return value of Unix.nice.
- #4557: type-checking of recursive modules.
- #4562: strange %n semantics in scanf.
- #4564: add note "stack is not executable" to object files generated by
ocamlopt (Linux/x86, Linux/AMD64).
- #4566: bug in Ratio.approx_ratio_fix and Num.approx_num_fix.
- #4582: clarified the documentation of functions in the String module.
- #4583: stack overflow in "ocamlopt -g" during closure conversion pass.
- #4585: ocamldoc and "val virtual" declarations.
- #4587: ocamldoc and escaped @ characters.
- #4605: Buffer.add_substitute was sometime wrong when target string had
backslashes.
- #4614: Inconsistent declaration of CamlCBCmd in LablTk library.
Objective Caml 3.10.2 (29 Feb 2008):
------------------------------------
Bug fixes:
- #3410 (partial) Typo in ocamldep man page
- #3952 (partial) ocamlopt: allocation problems on ARM
- #4339 (continued) ocamlopt: problems on HPPA
- #4455 str.mli not installed under Windows
- #4473 crash when accessing float array with polymorphic method
- #4480 runtime would not compile without gcc extensions
- #4481 wrong typing of exceptions with object arguments
- #4490 typo in error message
- Random crash on 32-bit when major_heap_increment >= 2^22
- Big performance bug in Weak hashtables
- Small bugs in the make-package-macosx script
- Bug in typing of polymorphic variants (reported on caml-list)
Objective Caml 3.10.1 (11 Jan 2008):
------------------------------------
Bug fixes:
- #3830 small bugs in docs
- #4053 compilers: improved compilation time for large variant types
- #4174 ocamlopt: fixed ocamlopt -nopervasives
- #4199 otherlibs: documented a small problem in Unix.utimes
- #4280 camlp4: parsing of identifier (^)
- #4281 camlp4: parsing of type constraint
- #4285 runtime: cannot compile under AIX
- #4286 ocamlbuild: cannot compile under AIX and SunOS
- #4288 compilers: including a functor application with side effects
- #4295 camlp4 toplevel: synchronization after an error
- #4300 ocamlopt: crash with backtrace and illegal array access
- #4302 camlp4: list comprehension parsing problem
- #4304 ocamlbuild: handle -I correctly
- #4305 stdlib: alignment of Arg.Symbol
- #4307 camlp4: assertion failure
- #4312 camlp4: accept "let _ : int = 1"
- #4313 ocamlbuild: -log and missing directories
- #4315 camlp4: constraints in classes
- #4316 compilers: crash with recursive modules and Lazy
- #4318 ocamldoc: installation problem with Cygwin (tentative fix)
- #4322 ocamlopt: stack overflow under Windows
- #4325 compilers: wrong error message for unused var
- #4326 otherlibs: marshal Big_int on win64
- #4327 ocamlbuild: make emacs look for .annot in _build directory
- #4328 camlp4: stack overflow with nil nodes
- #4331 camlp4: guards on fun expressions
- #4332 camlp4: parsing of negative 32/64 bit numbers
- #4336 compilers: unsafe recursive modules
- #4337 (note) camlp4: invalid character escapes
- #4339 ocamlopt: problems on HP-UX (tentative fix)
- #4340 camlp4: wrong pretty-printing of optional arguments
- #4348 ocamlopt: crash on Mac Intel
- #4349 camlp4: bug in private type definitions
- #4350 compilers: type errors with records and polymorphic variants
- #4352 compilers: terminal recursion under Windows (tentative fix)
- #4354 ocamlcp: mismatch with ocaml on polymorphic let
- #4358 ocamlopt: float constants wrong on ARM
- #4360 ocamldoc: string inside comment
- #4365 toplevel: wrong pretty-printing of polymorphic variants
- #4373 otherlibs: leaks in win32unix
- #4374 otherlibs: threads module not initialized
- #4375 configure: fails to build on bytecode-only architectures
- #4377 runtime: finalisation of infix pointers
- #4378 ocamlbuild: typo in plugin.ml
- #4379 ocamlbuild: problem with plugins under Windows
- #4382 compilers: typing of polymorphic record fields
- #4383 compilers: including module with private type
- #4385 stdlib: Int32/Int64.format are unsafe
- #4386 otherlibs: wrong signal numbers with Unix.sigprocmask etc.
- #4387 ocamlbuild: build directory not used properly
- #4392 ocamldep: optional argument of class
- #4394 otherlibs: infinite loops in Str
- #4397 otherlibs: wrong size for flag arrays in win32unix
- #4402 ocamldebug: doesn't work with -rectypes
- #4410 ocamlbuild: problem with plugin and -build
- #4411 otherlibs: crash with Unix.access under Windows
- #4412 stdlib: marshalling broken on 64 bit architectures
- #4413 ocamlopt: crash on AMD64 with out-of-bound access and reraise
- #4417 camlp4: pretty-printing of unary minus
- #4419 camlp4: problem with constraint in type class
- #4426 compilers: problem with optional labels
- #4427 camlp4: wrong pretty-printing of lists of functions
- #4433 ocamlopt: fails to build on MacOSX 10.5
- #4435 compilers: crash with objects
- #4439 fails to build on MacOSX 10.5
- #4441 crash when build on sparc64 linux
- #4442 stdlib: crash with weak pointers
- #4446 configure: fails to detect X11 on MacOSX 10.5
- #4448 runtime: huge page table on 64-bit architectures
- #4450 compilers: stack overflow with recursive modules
- #4470 compilers: type-checking of recursive modules too restrictive
- #4472 configure: autodetection of libX11.so on Fedora x86_64
- printf: removed (partially implemented) positional specifications
- polymorphic < and <= comparisons: some C compiler optimizations
were causing incorrect results when arguments are incomparable
New features:
- made configure script work on PlayStation 3
- ARM port: brought up-to-date for Debian 4.0 (Etch)
- many other small changes and bugfixes in camlp4, ocamlbuild, labltk,
emacs files
Objective Caml 3.10.0 (18 May 2007):
------------------------------------
(Changes that can break existing programs are marked with a "*" )
Language features:
- Added virtual instance variables in classes "val virtual v : t"
* Changed the behaviour of instance variable overriding; the new
definition replaces the old one, rather than creating a new
variable.
New tools:
- ocamlbuild: compilation manager for OCaml applications and libraries.
See draft documentation at http://gallium.inria.fr/~pouillar/
* Camlp4: heavily revised implementation, new API.
New ports:
- MacOS X PowerPC 64 bits.
- MS Windows 64 bits (x64) using the Microsoft PSDK toolchain.
- MS Windows 32 bits using the Visual Studio 2005 toolchain.
Compilers:
- Faster type-checking of functor applications.
- Referencing an interface compiled with -rectypes from a module
not compiled with -rectypes is now an error.
- Revised the "fragile matching" warning.
Native-code compiler:
- Print a stack backtrace on an uncaught exception.
(Compile and link with ocamlopt -g; execute with OCAMLRUNPARAM=b.)
Supported on Intel/AMD in 32 and 64 bits, PPC in 32 and 64 bits.
- Stack overflow detection on MS Windows 32 bits (courtesy O. Andrieu).
- Stack overflow detection on MacOS X PPC and Intel.
- Intel/AMD 64 bits: generate position-independent code by default.
- Fixed bug involving -for-pack and missing .cmx files (#4124).
- Fixed bug causing duplication of literals (#4152).
Run-time system:
- C/Caml interface functions take "char const *" arguments
instead of "char *" when appropriate.
- Faster string comparisons (fast case if strings are ==).
Standard library:
- Refined typing of format strings (type format6).
- Printf, Format: new function ifprintf that consumes its arguments
and prints nothing (useful to print conditionally).
- Scanf:
new function format_from_string to convert a string to a format string;
new %r conversion to accommodate user defined scanners.
- Filename: improved Win32 implementation of Filename.quote.
- List: List.nth now tail-recursive.
- Sys: added Sys.is_directory. Some functions (e.g. Sys.command) that
could incorrectly raise Sys_io_blocked now raise Sys_error as intended.
- String and Char: the function ``escaped'' now escapes all the characters
especially handled by the compiler's lexer (#4220).
Other libraries:
- Bigarray: mmap_file takes an optional argument specifying
the start position of the data in the mapped file.
- Dynlink: now defines only two modules, Dynlink and Dynlinkaux (internal),
reducing risks of name conflicts with user modules.
- Labltk under Win32: now uses Tcl/Tk 8.4 instead of 8.3 by default.
- VM threads: improved performance of I/O operations (less polling).
- Unix: new function Unix.isatty.
- Unix emulation under Win32:
fixed incorrect error reporting in several functions (#4097);
better handling of channels opened on sockets (#4098);
fixed GC bug in Unix.system (#4112).
Documentation generator (OCamldoc):
- correctly handle '?' in value names (#4215)
- new option -hide-warnings not to print ocamldoc warnings
Lexer generator (ocamllex): improved error reporting.
License: fixed a typo in the "special exception" to the LGPL.
Objective Caml 3.09.3 (15 Sep 2006):
------------------------------------
Bug fixes:
- ocamldoc: -using modtype constraint to filter module elements displayed
in doc #4016
- ocamldoc: error in merging of top dependencies of modules #4007
- ocamldoc: -dot-colors has no effect #3981
- ocamdloc: missing crossref in text from intro files #4066
- compilers: segfault with recursive modules #4008
- compilers: infinite loop when compiling objects #4018
- compilers: bad error message when signature mismatch #4001
- compilers: infinite loop with -rectypes #3999
- compilers: contravariance bug in private rows
- compilers: unsafe cast with polymorphic exception #4002
- native compiler: bad assembly code generated for AMD64 #4067
- native compiler: stack alignment problems on MacOSX/i386 #4036
- stdlib: crash in marshalling #4030
- stdlib: crash when closing a channel twice #4039
- stdlib: memory leak in Sys.readdir #4093
- C interface: better definition of CAMLreturn #4068
- otherlibs/unix: crash in gethostbyname #3043
- tools: subtle problem with unset in makefile #4048
- camlp4: install pa_o_fast.o #3812
- camlp4: install more modules #3689
New features:
- ocamldoc: name resolution in cross-referencing {!name}: if name is not
found, then it is searched in the parent module/class, and in the parent
of the parent, and so on until it is found.
- ocamldoc: new option -short-functors to use a short form to display
functors in html generator #4017
- ocamlprof: added "-version" option
Objective Caml 3.09.2 (14 Apr 2006):
------------------------------------
Bug fixes:
- Makefile: problem with "make world.opt" #3954
- compilers: problem compiling several modules with one command line #3979
- compilers,ocamldoc: error message that Emacs cannot parse
- compilers: crash when printing type error #3968
- compilers: -dtypes wrong for monomorphic type variables #3894
- compilers: wrong warning on optional arguments #3980
- compilers: crash when wrong use of type constructor in let rec #3976
- compilers: better wording of "statement never returns" warning #3889
- runtime: inefficiency of signal handling #3990
- runtime: crashes with I/O in multithread programs #3906
- camlp4: empty file name in error messages #3886
- camlp4: stack overflow #3948
- otherlibs/labltk: ocamlbrowser ignores its command line options #3961
- otherlibs/unix: Unix.times wrong under Mac OS X #3960
- otherlibs/unix: wrong doc for execvp and execvpe #3973
- otherlibs/win32unix: random crash in Unix.stat #3998
- stdlib: update_mod not found under Windows #3847
- stdlib: Filename.dirname/basename wrong on Win32 #3933
- stdlib: incomplete documentation of Pervasives.abs #3967
- stdlib: Printf bugs #3902, #3955
- tools/checkstack.c: missing include
- yacc: crash when given argument "-" #3956
New features:
- ported to MacOS X on Intel #3985
- configure: added support for GNU Hurd #3991
Objective Caml 3.09.1 (4 Jan 2006):
-----------------------------------
Bug fixes:
- compilers: raise not_found with -principal #3855
- compilers: assert failure in typeclass.cml #3856
- compilers: assert failure in typing/ctype.ml #3909
- compilers: fatal error exception Ctype.Unify #3918
- compilers: spurious warning Y in objects #3868
- compilers: spurious warning Z on loop index #3907
- compilers: error message that emacs cannot parse
- ocamlopt: problems with -for-pack/-pack #3825, #3826, #3919
- ocamlopt: can't produce shared libraries on x86_64 #3869, #3924
- ocamlopt: float alignment problem on SPARC #3944
- ocamlopt: can't compile on MIPS #3936
- runtime: missing dependence for ld.conf
- runtime: missing dependence for .depend.nt #3880
- runtime: memory leak in caml_register_named_value #3940
- runtime: crash in Marshal.to_buffer #3879
- stdlib: Sys.time giving wrong results on Mac OS X #3850
- stdlib: Weak.get_copy causing random crashes in rare cases
- stdlib, debugger, labltk: use TMPDIR if set #3895
- stdlib: scanf bug on int32 and nativeint #3932
- camlp4: mkcamlp4 option parsing problem #3941
- camlp4: bug in pretty-printing of lazy/assert/new
- camlp4: update the unmaintained makefile for _loc name
- ocamldoc: several fixes see ocamldoc/Changes.txt
- otherlibs/str: bug in long sequences of alternatives #3783
- otherlibs/systhreads: deadlock in Windows #3910
- tools: update dumpobj to handle new event format #3873
- toplevel: activate warning Y in toplevel #3832
New features:
- otherlibs/labltk: browser uses menu bars instead of menu buttons
Objective Caml 3.09.0 (27 Oct 2006):
------------------------------------
(Changes that can break existing programs are marked with a "*" )
Language features:
- Introduction of private row types, for abstracting the row in object
and variant types.
Type checking:
- Polymorphic variants with at most one constructor [< `A of t] are no
longer systematically promoted to the exact type [`A of t]. This was
more confusing than useful, and created problems with private row
types.
Both compilers:
- Added warnings 'Y' and 'Z' for local variables that are bound but
never used.
- Added warning for some uses non-returning functions (e.g. raise), when they
are passed extra arguments, or followed by extra statements.
- Pattern matching: more prudent compilation in case of guards; fixed #3780.
- Compilation of classes: reduction in size of generated code.
- Compilation of "module rec" definitions: fixed a bad interaction with
structure coercion (to a more restrictive signature).
Native-code compiler (ocamlopt):
* Revised implementation of the -pack option (packing of several compilation
units into one). The .cmx files that are to be packed with
"ocamlopt -pack -o P.cmx" must be compiled with "ocamlopt -for-pack P".
In exchange for this additional constraint, ocamlopt -pack is now
available on all platforms (no need for binutils).
* Fixed wrong evaluation order for arguments to certain inlined functions.
- Modified code generation for "let rec ... and ..." to reduce compilation
time (which was quadratic in the number of mutually-recursive functions).
- x86 port: support tail-calls for functions with up to 21 arguments.
- AMD64 port, Linux: recover from system stack overflow.
- Sparc port: more portable handling of out-of-bound conditions
on systems other than Solaris.
Standard library:
- Pervasives: faster implementation of close_in, close_out.
set_binary_mode_{out,in} now working correctly under Cygwin.
- Printf: better handling of partial applications of the printf functions.
- Scanf: new function sscanf_format to read a format from a
string. The type of the resulting format is dynamically checked and
should be the type of the template format which is the second argument.
- Scanf: no more spurious lookahead attempt when the end of file condition
is set and a correct token has already been read and could be returned.
Other libraries:
- System threads library: added Thread.sigmask; fixed race condition
in signal handling.
- Bigarray library: fixed bug in Array3.of_array.
- Unix library: use canonical signal numbers in results of Unix.wait*;
hardened Unix.establish_server against EINTR errors.
Run-time system:
- Support platforms where sizeof(void *) = 8 and sizeof(long) = 4.
- Improved and cleaned up implementation of signal handling.
Replay debugger:
- Improved handling of locations in source code.
OCamldoc:
- extensible {foo } syntax
- user can give .txt files on the command line, containing ocamldoc formatted
text, to be able to include bigger texts out of source files
- -o option is now used by the html generator to indicate the prefix
of generated index files (to avoid conflict when a Index module exists
on case-insensitive file systems).
Miscellaneous:
- Configuration information is installed in `ocamlc -where`/Makefile.config
and can be used by client Makefiles or shell scripts.
Objective Caml 3.08.4 (11 Aug 2005):
------------------------------------
New features:
- configure: find X11 config in some 64-bit Linux distribs
- ocamldoc: (**/**) can be canceled with another (**/**) #3665
- graphics: added resize_window
- graphics: check for invalid arguments to drawing primitives #3595
- ocamlbrowser: use windows subsystem on mingw
Bug fixes:
- ocamlopt: code generation problem on AMD64 #3640
- wrong code generated for some classes #3576
- fatal error when compiling some OO code #3745
- problem with comparison on constant constructors #3608
- camlp4: cryptic error message #3592
- camlp4: line numbers in multi-line antiquotations #3549
- camlp4: problem with make depend
- camlp4: parse error with :> #3561
- camlp4: ident conversion problem with val/contents/contents__
- camlp4: several small parsing problems #3688
- ocamldebug: handling of spaces in executable file name #3736
- emacs-mode: problem when caml-types-buffer is deleted by user #3704
- ocamldoc: extra backslash in ocamldoc man page #3687
- ocamldoc: improvements to HTML display #3698
- ocamldoc: escaping of @ in info files
- ocamldoc: escaping of . and \ in man pages #3686
- ocamldoc: better error reporting of misplaced comments
- graphics: fixed .depend file #3558
- graphics: segfault with threads and graphics #3651
- nums: several bugs: #3718, #3719, others
- nums: inline asm problems with gcc 4.0 #3604, #3637
- threads: problem with backtrace
- unix: problem with getaddrinfo #3565
- stdlib: documentation of Int32.rem and Int64.rem #3573
- stdlib: documentation of List.rev_map2 #3685
- stdlib: wrong order in Map.fold #3607
- stdlib: documentation of maximum float array length #3714
- better detection of cycles when using -rectypes
- missing case of module equality #3738
- better error messages for unbound type variables
- stack overflow while printing type error message #3705
- assert failure when typing some classes #3638
- bug in type_approx
- better error messages related to type variance checking
- yacc: avoid name capture for idents of the Parsing module
Objective Caml 3.08.3 (24 Mar 2005):
------------------------------------
New features:
- support for ocamlopt -pack under Mac OS X (#2634, #3320)
- ignore unknown warning options for forward and backward compatibility
- runtime: export caml_compare_unordered (#3479)
- camlp4: install argl.* files (#3439)
- ocamldoc: add -man-section option
- labltk: add the "solid" relief option (#3343)
Bug fixes:
- typing: fix unsoundness in type declaration variance inference.
Type parameters which are constrained must now have an explicit variant
annotation, otherwise they are invariant. This is not backward
compatible, so this might break code which either uses subtyping or
uses the relaxed value restriction (i.e. was not typable before 3.07)
- typing: erroneous partial match warning for polymorphic variants (#3424)
- runtime: handle the case of an empty command line (#3409, #3444)
- stdlib: make Sys.executable_name an absolute path in native code (#3303)
- runtime: fix memory leak in finalise.c
- runtime: auto-trigger compaction even if gc is called manually (#3392)
- stdlib: fix segfault in Obj.dup on zero-sized values (#3406)
- camlp4: correct parsing of the $ identifier (#3310, #3469)
- windows (MS tools): use link /lib instead of lib (#3333)
- windows (MS tools): change default install destination
- autoconf: better checking of SSE2 instructions (#3329, #3330)
- graphics: make close_graph close the X display as well as the window (#3312)
- num: fix big_int_of_string (empty string) (#3483)
- num: fix big bug on 64-bit architecture (#3299)
- str: better documentation of string_match and string_partial_match (#3395)
- unix: fix file descriptor leak in Unix.accept (#3423)
- unix: miscellaneous clean-ups
- unix: fix documentation of Unix.tm (#3341)
- graphics: fix problem when allocating lots of images under Windows (#3433)
- compiler: fix error message with -pack when .cmi is missing (#3028)
- cygwin: fix problem with compilation of camlheader (#3485)
- stdlib: Filename.basename doesn't return an empty string any more (#3451)
- stdlib: better documentation of Open_excl flag (#3450)
- ocamlcp: accept -thread option (#3511)
- ocamldep: handle spaces in file names (#3370)
- compiler: remove spurious warning in pattern-matching on variants (#3424)
- windows: better handling of InterpreterPath registry entry (#3334, #3432)
Objective Caml 3.08.2 (22 Nov 2004):
------------------------------------
Bug fixes:
- runtime: memory leak when unmarshalling big data structures (#3247)
- camlp4: incorrect line numbers in errors (#3188)
- emacs: xemacs-specific code, wrong call to "sit-for"
- ocamldoc: "Lexing: empty token" (#3173)
- unix: problem with close_process_* (#3191)
- unix: possible coredumps (#3252)
- stdlib: wrong order in Set.fold (#3161)
- ocamlcp: array out of bounds in profiled programs (#3267)
- yacc: problem with polymorphic variant types for grammar entries (#3033)
Misc:
- export <caml/printexc.h> for caml_format_exception (#3080)
- clean up caml_search_exe_in_path (maybe #3079)
- camlp4: new function "make_lexer" for new-style locations
- unix: added missing #includes (#3088)
Objective Caml 3.08.1 (19 Aug 2004):
------------------------------------
Licence:
- The emacs files are now under GPL
- Slightly relaxed some conditions of the QPL
Bug fixes:
- ld.conf now generated at compile-time instead of install-time
- fixed -pack on Windows XP (#2935)
- fixed Obj.tag (#2946)
- added support for multiple dlopen in Darwin
- run ranlib when installing camlp4 libraries (#2944)
- link camlp4opt with -linkall (#2949)
- camlp4 parsing of patterns now conforms to normal parsing (#3015)
- install camlp4 *.cmx files (#2955)
- fixed handling of linefeed in string constants in camlp4 (#3074)
- ocamldoc: fixed display of class parameters in HTML and LaTeX (#2994)
- ocamldoc: fixed display of link to class page in html (#2994)
- Windows toplevel GUI: assorted fixes (including #2932)
Misc:
- added -v option to ocamllex
- ocamldoc: new -intf and -impl options supported (#3036)
Objective Caml 3.08.0 (13 Jul 2004):
------------------------------------
(Changes that can break existing programs are marked with a "*" )
Language features:
- Support for immediate objects, i.e. objects defined without going
through a class. (Syntax is "object <fields and methods> end".)
Type-checking:
- When typing record construction and record patterns, can omit
the module qualification on all labels except one. I.e.
{ M.l1 = ...; l2 = ... } is interpreted as { M.l1 = ...; M.l2 = ... }
Both compilers:
- More compact compilation of classes.
- Much more efficient handling of class definitions inside functors
or local modules.
- Simpler representation for method tables. Objects can now be marshaled
between identical programs with the flag Marshal.Closures.
- Improved error messages for objects and variants.
- Improved printing of inferred module signatures (toplevel and ocamlc -i).
Recursion between type, class, class type and module definitions is now
correctly printed.
- The -pack option now accepts compiled interfaces (.cmi files) in addition
to compiled implementations (.cmo or .cmx).
* A compile-time error is signaled if an integer literal exceeds the
range of representable integers.
- Fixed code generation error for "module rec" definitions.
- The combination of options -c -o sets the name of the generated
.cmi / .cmo / .cmx files.
Bytecode compiler:
- Option -output-obj is now compatible with Dynlink and
with embedded toplevels.
Native-code compiler:
- Division and modulus by zero correctly raise exception Division_by_zero
(instead of causing a hardware trap).
- Improved compilation time for the register allocation phase.
- The float constant -0.0 was incorrectly treated as +0.0 on some processors.
- AMD64: fixed bugs in asm glue code for GC invocation and exception raising
from C.
- IA64: fixed incorrect code generated for "expr mod 1".
- PowerPC: minor performance tweaks for the G4 and G5 processors.
Standard library:
* Revised handling of NaN floats in polymorphic comparisons.
The polymorphic boolean-valued comparisons (=, <, >, etc) now treat
NaN as uncomparable, as specified by the IEEE standard.
The 3-valued comparison (compare) treats NaN as equal to itself
and smaller than all other floats. As a consequence, x == y
no longer implies x = y but still implies compare x y = 0.
* String-to-integer conversions now fail if the result overflows
the range of integers representable in the result type.
* All array and string access functions now raise
Invalid_argument("index out of bounds") when a bounds check fails.
In earlier releases, different exceptions were raised
in bytecode and native-code.
- Module Buffer: new functions Buffer.sub, Buffer.nth
- Module Int32: new functions Int32.bits_of_float, Int32.float_of_bits.
- Module Map: new functions is_empty, compare, equal.
- Module Set: new function split.
* Module Gc: in-order finalisation, new function finalise_release.
Other libraries:
- The Num library: complete reimplementation of the C/asm lowest
layer to work around potential licensing problems.
Improved speed on the PowerPC and AMD64 architectures.
- The Graphics library: improved event handling under MS Windows.
- The Str library: fixed bug in "split" functions with nullable regexps.
- The Unix library:
. Added Unix.single_write.
. Added support for IPv6.
. Bug fixes in Unix.closedir.
. Allow thread switching on Unix.lockf.
Runtime System:
* Name space depollution: all global C identifiers are now prefixed
with "caml" to avoid name clashes with other libraries. This
includes the "external" primitives of the standard runtime.
Ports:
- Windows ports: many improvements in the OCamlWin toplevel application
(history, save inputs to file, etc). Contributed by Christopher A. Watford.
- Native-code compilation supported for HPPA/Linux. Contributed by Guy Martin.
- Removed support for MacOS9. Mac OS 9 is obsolete and the port was not
updated since 3.05.
- Removed ocamlopt support for HPPA/Nextstep and Power/AIX.
Ocamllex:
- #line directives in the input file are now accepted.
- Added character set concatenation operator "cset1 # cset2".
Ocamlyacc:
- #line directives in the input file are now accepted.
Camlp4:
* Support for new-style locations (line numbers, not just character numbers).
- See camlp4/CHANGES and camlp4/ICHANGES for more info.
Objective Caml 3.07 (29 Sep 2003):
----------------------------------
Language features:
- Experimental support for recursive module definitions
module rec A : SIGA = StructA and B : SIGB = StructB and ...
- Support for "private types", or more exactly concrete data types
with private constructors or labels. These data types can be
de-structured normally in pattern matchings, but values of these
types cannot be constructed directly outside of their defining module.
- Added integer literals of types int32, nativeint, int64
(written with an 'l', 'n' or 'L' suffix respectively).
Type-checking:
- Allow polymorphic generalization of covariant parts of expansive
expressions. For instance, if f: unit -> 'a list, "let x = f ()"
gives "x" the generalized type forall 'a. 'a list, instead of '_a list
as before.
- The typing of polymorphic variants in pattern matching has changed.
It is intended to be more regular, sticking to the principle of "closing
only the variants which would be otherwise incomplete". Two potential
consequences: (1) some types may be left open which were closed before,
and the resulting type might not match the interface anymore (expected to
be rare); (2) in some cases an incomplete match may be generated.
- Lots of bug fixes in the handling of polymorphism and recursion inside
types.
- Added a new "-dtypes" option to ocamlc/ocamlopt, and an emacs extension
"emacs/caml-types.el". The compiler option saves inferred type information
to file *.annot, and the emacs extension allows the user to look at the
type of any subexpression in the source file. Works even in the case
of a type error (all the types computed up to the error are available).
This new feature is also supported by ocamlbrowser.
- Disable "method is overridden" warning when the method was explicitly
redefined as virtual beforehand (i.e. not through inheritance). Typing
and semantics are unchanged.
Both compilers:
- Added option "-dtypes" to dump detailed type information to a file.
- The "-i" option no longer generates compiled files, it only prints
the inferred types.
- The sources for the module named "Mod" can be placed either in Mod.ml or
in mod.ml.
- Compilation of "let rec" on non-functional values: tightened some checks,
relaxed some other checks.
- Fixed wrong code that was generated for "for i = a to max_int"
or "for i = a downto min_int".
- An explicit interface Mod.mli can now be provided for the module obtained
by ocamlc -pack -o Mod.cmo ... or ocamlopt -pack -o Mod.cmx ...
- Revised internal handling of source code locations, now handles
preprocessed code better.
- Pattern-matching bug on float literals fixed.
- Minor improvements on pattern-matching over variants.
- More efficient compilation of string comparisons and the "compare" function.
- More compact code generated for arrays of constants.
- Fixed GC bug with mutable record fields of type "exn".
- Added warning "E" for "fragile patterns": pattern matchings that would
not be flagged as partial if new constructors were added to the data type.
Bytecode compiler:
- Added option -vmthread to select the threads library with VM-level
scheduling. The -thread option now selects the system threads library.
Native-code compiler:
- New port: AMD64 (Opteron).
- Fixed instruction selection bug on expressions of the kind (raise Exn)(arg).
- Several bug fixes in ocamlopt -pack (tracking of imported modules,
command line too long).
- Signal handling bug fixed.
- x86 port:
Added -ffast-math option to use inline trigo and log functions.
Small performance tweaks for the Pentium 4.
Fixed illegal "imul" instruction generated by reloading phase.
- Sparc port:
Enhanced code generation for Sparc V8 (option -march=v8) and
Sparc V9 (option -march=v9).
Profiling support added for Solaris.
- PowerPC port:
Keep stack 16-aligned for compatibility with C calling conventions.
Toplevel interactive system:
- Tightened interface consistency checks between .cmi files, .cm[oa] files
loaded by #load, and the running toplevel.
- #trace on mutually-recursive functions was broken, works again.
- Look for .ocamlinit file in home directory in addition to the current dir.
Standard library:
- Match_failure and Assert_failure exceptions now report
(file, line, column), instead of (file, starting char, ending char).
- float_of_string, int_of_string: some ill-formed input strings were not
rejected.
- Added format concatenation, string_of_format, format_of_string.
- Module Arg: added new option handlers Set_string, Set_int, Set_float,
Symbol, Tuple.
- Module Format: tag handling is now turned off by default,
use [Format.set_tags true] to activate.
- Modules Lexing and Parsing: added better handling of positions
in source file. Added function Lexing.flush_input.
- Module Scanf: %n and %N formats to count characters / items read so far;
assorted bug fixes, %! to match end of input. New ``_'' special
flag to skip reresulting value.
- Module Format: tags are not activated by default.
- Modules Set and Map: fixed bugs causing trees to become unbalanced.
- Module Printf: less restrictive typing of kprintf.
- Module Random: better seeding; functions to generate random int32, int64,
nativeint; added support for explicit state management.
- Module Sys: added Sys.readdir for reading the contents of a directory.
Runtime system:
- output_value/input_value: fixed bug with large blocks (>= 4 Mwords)
produced on a 64-bit platform and incorrectly read back on a 32-bit
platform.
- Fixed memory compaction bug involving input_value.
- Added MacOS X support for dynamic linking of C libraries.
- Improved stack backtraces on uncaught exceptions.
- Fixed float alignment problem on Sparc V9 with gcc 3.2.
Other libraries:
- Dynlink:
By default, dynamically-loaded code now has access to all
modules defined by the program; new functions Dynlink.allow_only
and Dynlink.prohibit implement access control.
Fixed Dynlink problem with files generated with ocamlc -pack.
Protect against references to modules not yet fully initialized.
- LablTK/CamlTK: added support for TCL/TK 8.4.
- Str: reimplemented regexp matching engine, now less buggy, faster,
and LGPL instead of GPL.
- Graphics: fixed draw_rect and fill_rect bug under X11.
- System threads and bytecode threads libraries can be both installed.
- System threads: better implementation of Thread.exit.
- Bytecode threads: fixed two library initialization bugs.
- Unix: make Unix.openfile blocking to account for named pipes;
GC bug in Unix.*stat fixed; fixed problem with Unix.dup2 on Windows.
Ocamllex:
- Can name parts of the matched input text, e.g.
"0" (['0'-'7']+ as s) { ... s ... }
Ocamldebug:
- Handle programs that run for more than 2^30 steps.
Emacs mode:
- Added file caml-types.el to interactively display the type information
saved by option -dtypes.
Win32 ports:
- Cygwin port: recognize \ as directory separator in addition to /
- MSVC port: ocamlopt -pack works provided GNU binutils are installed.
- Graphics library: fixed bug in Graphics.blit_image; improved event handling.
OCamldoc:
- new ty_code field for types, to keep code of a type (with option -keep-code)
- new ex_code field for types, to keep code of an exception
(with option -keep-code)
- some fixes in html generation
- don't overwrite existing style.css file when generating HTML
- create the ocamldoc.sty file when generating LaTeX (if nonexistent)
- man pages are now installed in man/man3 rather than man/mano
- fix: empty [] in generated HTML indexes
Objective Caml 3.06 (20 Aug 2002):
----------------------------------
Type-checking:
- Apply value restriction to polymorphic record fields.
Run-time system:
- Fixed GC bug affecting lazy values.
Both compilers:
- Added option "-version" to print just the version number.
- Fixed wrong dependencies in .cmi generated with the -pack option.
Native-code compiler:
- Fixed wrong return value for inline bigarray assignments.
Libraries:
- Unix.getsockopt: make sure result is a valid boolean.
Tools:
- ocamlbrowser: improved error reporting; small Win32 fixes.
Windows ports:
- Fixed two problems with the Mingw port under Cygwin 1.3.
Objective Caml 3.05 (29 Jul 2002):
----------------------------------
Language features:
- Support for polymorphic methods and record fields.
- Allows _ separators in integer and float literals, e.g. 1_000_000.
Type-checker:
- New flag -principal to enforce principality of type inference.
- Fixed subtle typing bug with higher-order functors.
- Fixed several complexity problems; changed (again) the behaviour of
simple coercions.
- Fixed various bugs with objects and polymorphic variants.
- Improved some error messages.
Both compilers:
- Added option "-pack" to assemble several compilation units as one unit
having the given units as sub-modules.
- More precise detection of unused sub-patterns in "or" patterns.
- Warnings for ill-formed \ escapes in string and character literals.
- Protect against spaces and other special characters in directory names.
- Added interface consistency check when building a .cma or .cmxa library.
- Minor reduction in code size for class initialization code.
- Added option "-nostdlib" to ignore standard library entirely.
Bytecode compiler:
- Fixed issue with ocamlc.opt and dynamic linking.
Native-code compiler:
- Added link-time check for multiply-defined module names.
- Fixed GC bug related to constant constructors of polymorphic variant types.
- Fixed compilation bug for top-level "include" statements.
- PowerPC port: work around limited range for relative branches,
thus removing assembler failures on large functions.
- IA64 port: fixed code generation bug for 3-way constructor matching.
Toplevel interactive system:
- Can load object files given on command line before starting up.
- ocamlmktop: minimized possibility of name clashes with user-provided modules.
Run-time system:
- Minor garbage collector no longer recursive.
- Better support for lazy data in the garbage collector.
- Fixed issues with the heap compactor.
- Fixed issues with finalized Caml values.
- The type "int64" is now supported on all platforms: we use software
emulation if the C compiler doesn't support 64-bit integers.
- Support for float formats that are neither big-endian nor little-endian
(one known example: the ARM).
- Fixed bug in callback*_exn functions in the exception-catching case.
- Work around gcc 2.96 bug on RedHat 7.2 and Mandrake 8.0, 8.1 among others.
- Stub DLLs now installed in subdir stublibs/ of standard library dir.
Standard library:
- Protect against integer overflow in sub-string and sub-array bound checks.
- New module Complex implementing arithmetic over complex numbers.
- New module Scanf implementing format-based scanning a la scanf() in C.
- Module Arg: added alternate entry point Arg.parse_argv.
- Modules Char, Int32, Int64, Nativeint, String: added type "t" and function
"compare" so that these modules can be used directly with e.g. Set.Make.
- Module Digest: fixed issue with Digest.file on large files (>= 1Gb);
added Digest.to_hex.
- Module Filename: added Filename.open_temp_file to atomically create and
open the temp file; improved security of Filename.temp_file.
- Module Genlex: allow _ as first character of an identifier.
- Module Lazy: more efficient implementation.
- Module Lexing: improved performances for very large tokens.
- Module List: faster implementation of sorting functions.
- Module Printf:
added %S and %C formats (quoted, escaped strings and characters);
added kprintf (calls user-specified continuation on formatted string).
- Module Queue: faster implementation (courtesy of François Pottier).
- Module Random: added Random.bool.
- Module Stack: added Stack.is_empty.
- Module Pervasives:
added sub-module LargeFile to support files larger than 1Gb
(file offsets are int64 rather than int);
opening in "append" mode automatically sets "write" mode;
files are now opened in close-on-exec mode;
string_of_float distinguishes its output from a plain integer;
faster implementation of input_line for long lines.
- Module Sys:
added Sys.ocaml_version containing the OCaml version number;
added Sys.executable_name containing the (exact) path of the
file being executable;
Sys.argv.(0) is now unchanged w.r.t. what was provided as 0-th argument
by the shell.
- Module Weak: added weak hash tables.
Other libraries:
- Bigarray:
support for bigarrays of complex numbers;
added functions Genarray.dims,
{Genarray,Array1,Array2,Array3}.{kind,layout}.
- Dynlink: fixed bug with loading of mixed-mode Caml/C libraries.
- LablTK:
now supports also the CamlTK API (no labels);
support for Activate and Deactivate events;
support for virtual events;
added UTF conversion;
export the tcl interpreter as caml value, to avoid DLL dependencies.
- Unix:
added sub-module LargeFile to support files larger than 1Gb
(file offsets are int64 rather than int);
added POSIX opening flags (O_NOCTTY, O_*SYNC);
use reentrant functions for gethostbyname and gethostbyaddr when available;
fixed bug in Unix.close_process and Unix.close_process_full;
removed some overhead in Unix.select.
Tools:
- ocamldoc (the documentation generator) is now part of the distribution.
- Debugger: now supports the option -I +dir.
- ocamllex: supports the same identifiers as ocamlc; warns for
bad \ escapes in strings and characters.
- ocamlbrowser:
recenter the module boxes when showing a cross-reference;
include the current directory in the ocaml path.
Windows port:
- Can now compile with Mingw (the GNU compilers without the Cygwin
runtime library) in addition to MSVC.
- Toplevel GUI: wrong filenames were given to #use and #load commands;
read_line() was buggy for short lines (2 characters or less).
- OCamlBrowser: now fully functional.
- Graphics library: fixed several bugs in event handling.
- Threads library: fixed preemption bug.
- Unix library: better handling of the underlying differences between
sockets and regular file descriptors;
added Unix.lockf and a better Unix.rename (thanks to Tracy Camp).
- LablTk library: fixed a bug in Fileinput
Objective Caml 3.04 (13 Dec 2001):
----------------------------------
Type-checker:
- Allowed coercing self to the type of the current class, avoiding
an obscure error message about "Self type cannot be unified..."
Both compilers:
- Use OCAMLLIB environment variable to find standard library, falls
back on CAMLLIB if not defined.
- Report out-of-range ASCII escapes in character or string literals
such as "\256".
Byte-code compiler:
- The -use-runtime and -make-runtime flags are back by popular demand
(same behavior as in 3.02).
- Dynamic loading (of the C part of mixed Caml/C libraries): arrange that
linking in -custom mode uses the static libraries for the C parts,
not the shared libraries, for maximal robustness and compatibility with
3.02.
Native-code compiler:
- Fixed bug in link-time consistency checking.
Tools:
- ocamlyacc: added parser debugging support (set OCAMLRUNPARAM=p to get
a trace of the pushdown automaton actions).
- ocamlcp: was broken in 3.03 (Sys_error), fixed.
Run-time system:
- More work on dynamic loading of the C part of mixed Caml/C libraries.
- On uncaught exception, flush output channels before printing exception
message and backtrace.
- Corrected several errors in exception backtraces.
Standard library:
- Pervasives: integer division and modulus are now fully specified
on negative arguments (with round-towards-zero semantics).
- Pervasives.float_of_string: now raises Failure on ill-formed input.
- Pervasives: added useful float constants max_float, min_float, epsilon_float.
- printf functions in Printf and Format: added % formats for int32, nativeint,
int64; "*" in width and precision specifications now supported
(contributed by Thorsten Ohl).
- Added Hashtbl.copy, Stack.copy.
- Hashtbl: revised resizing strategy to avoid quadratic behavior
on Hashtbl.add.
- New module MoreLabels providing labelized versions of modules
Hashtbl, Map and Set.
- Pervasives.output_value and Marshal.to_* : improved hashing strategy
for internal data structures, avoid excessive slowness on
quasi-linearly-allocated inputs.
Other libraries:
- Num: fixed bug in big integer exponentiation (Big_int.power_*).
Windows port:
- New GUI for interactive toplevel (Jacob Navia).
- The Graphics library is now available for stand-alone executables
(Jacob Navia).
- Unix library: improved reporting of system error codes.
- Fixed error in "globbing" of * and ? patterns on command line.
Emacs mode: small fixes; special color highlighting for ocamldoc comments.
License: added special exception to the LGPL'ed code (libraries and
runtime system) allowing unrestricted linking, whether static or dynamic.
Objective Caml 3.03 ALPHA (12 Oct 2001):
----------------------------------------
Language:
- Removed built-in syntactic sugar for streams and stream patterns
[< ... >], now supported via CamlP4, which is now included in the
distribution.
- Switched the default behaviour to labels mode (labels are compulsory),
but allows omitting labels when a function application is complete.
-nolabels mode is available but deprecated for programming.
(See also scrapelabels and addlabels tools below.)
- Removed all labels in the standard libraries, except labltk.
Labelized versions are kept for ArrayLabels, ListLabels, StringLabels
and UnixLabels. "open StdLabels" gives access to the first three.
- Extended polymorphic variant type syntax, allowing union types and
row abbreviations for both sub- and super-types. #t deprecated in types.
- See the Upgrading file for how to adapt to all the changes above.
Type-checker:
- Fixed obscure bug in module typing causing the type-checker to loop
on signatures of the form
module type M
module A: sig module type T = sig module T: M end end
module B: A.T
- Improved efficiency of module type-checking via lazy computation of
certain signature summary information.
- An empty polymorphic variant type is now an error.
Both compilers:
- Fixed wrong code generated for "struct include M ... end" when M
contains one or several "external" declarations.
Byte-code compiler:
- Protect against VM stack overflow caused by module initialization code
with many local variables.
- Support for dynamic loading of the C part of mixed Caml/C libraries.
- Removed the -use-runtime and -make-runtime flags, obsoleted by dynamic
loading of C libraries.
Native-code compiler:
- Attempt to recover gracefully from system stack overflow. Currently
works on x86 under Linux and BSD.
- Alpha: work around "as" bug in Tru64 5.1.
Toplevel environment:
- Revised printing of inferred types and evaluation results
so that an external printer (e.g. Camlp4's) can be hooked in.
Tools:
- The CamlP4 pre-processor-pretty-printer is now included in the standard
distribution.
- New tool ocamlmklib to help build mixed Caml/C libraries.
- New tool scrapelabels and addlabels, to either remove (non-optional)
labels in interfaces, or automatically add them in the definitions.
They provide easy transition from classic mode ocaml 3.02 sources,
depending on whether you want to keep labels or not.
- ocamldep: added -pp option to handle preprocessed source files.
Run-time system:
- Support for dynamic loading of the C part of mixed Caml/C libraries.
Currently works under Linux, FreeBSD, Windows, Tru64, Solaris and Irix.
- Implemented registration of global C roots with a skip list,
runs much faster when there are many global C roots.
- Autoconfiguration script: fixed wrong detection of Mac OS X; problem
with the Sparc, gcc 3.0, and float alignment fixed.
Standard library:
- Added Pervasives.flush_all to flush all opened output channels.
Other libraries:
- All libraries revised to allow dynamic loading of the C part.
- Graphics under X Windows: revised event handling, should no longer lose
mouse events between two calls to wait_next_event(); wait_next_event()
now interruptible by signals.
- Bigarrays: fixed bug in marshaling of big arrays.
Windows port:
- Fixed broken Unix.{get,set}sockopt*
Objective Caml 3.02 (30 Jul 2001):
----------------------------------
Both compilers:
- Fixed embarrassing bug in pattern-matching compilation
(affected or-patterns containing variable bindings).
- More optimizations in pattern-matching compilation.
Byte-code compiler:
- Protect against VM stack overflow caused by functions with many local
variables.
Native-code compiler:
- Removed re-sharing of string literals, causes too many surprises with
in-place string modifications.
- Corrected wrong compilation of toplevel "include" statements.
- Fixed bug in runtime function "callbackN_exn".
- Signal handlers receive the conventional signal number as argument
instead of the system signal number (same behavior as with the
bytecode compiler).
- ARM port: fixed issue with immediate operand overflow in large functions.
Toplevel environment:
- User-definer printers (for #install_printer) now receive as first argument
the pretty-printer formatter where to print their second argument.
Old printers (with only one argument) still supported for backward
compatibility.
Standard library:
- Module Hashtbl: added Hashtbl.fold.
Other libraries:
- Dynlink: better error reporting in add_interfaces for missing .cmi files.
- Graphics: added more drawing functions (multiple points, polygons,
multiple lines, splines).
- Bytecode threads: the module Unix is now thread-safe, ThreadUnix is
deprecated. Unix.exec* now resets standard descriptors to blocking mode.
- Native threads: fixed a context-switch-during-GC problem causing
certain C runtime functions to fail, most notably input_value.
- Unix.inet_addr_of_string: call inet_aton() when available so as to
handle correctly the address 255.255.255.255.
- Unix: added more getsockopt and setsockopt functions to get/set
options that have values other than booleans.
- Num: added documentation for the Big_int module.
Tools:
- ocamldep: fixed wrong dependency issue with nested modules.
Run-time system:
- Removed floating-point error at start-up on some non-IEEE platforms
(e.g. FreeBSD prior to 4.0R).
- Stack backtrace mechanism now works for threads that terminate on
an uncaught exception.
Auto-configuration:
- Updated config.guess and config.sub scripts, should recognize a greater
number of recent platform.
Windows port:
- Fixed broken Unix.waitpid. Unix.file_descr can now be compared or hashed.
- Toplevel application: issue with spaces in name of stdlib directory fixed.
MacOS 9 port:
- Removed the last traces of support for 68k
Objective Caml 3.01 (09 Mar 2001):
----------------------------------
New language features:
- Variables are allowed in "or" patterns, e.g.
match l with [t] | [_;t] -> ... t ...
- "include <structure expression>" to re-export all components of a
structure inside another structure.
- Variance annotation on parameters of type declarations, e.g.
type (+'a,-'b,'c) t (covariant in 'a, contravariant in 'b, invariant in 'c)
New ports:
- Intel IA64/Itanium under Linux (including the native-code compiler).
- Cygwin under MS Windows. This port is an alternative to the earlier
Windows port of OCaml, which relied on MS compilers; the Cygwin
Windows port does not need MS Visual C++ nor MASM, runs faster
in bytecode, and has a better implementation of the Unix library,
but currently lacks threads and COM component support.
Type-checking:
- Relaxed "monomorphic restriction" on type constructors in a
mutually-recursive type definition, e.g. the following is again allowed
type u = C of int t | D of string t and 'a t = ...
- Fixed name-capture bug in "include SIG" and "SIG with ..." constructs.
- Improved implicit subtypes built by (... :> ty), closer to intuition.
- Several bug fixes in type-checking of variants.
- Typing of polymorphic variants is more restrictive:
do not allow conjunctive types inside the same pattern matching.
a type has either an upper bound, or all its tags are in the lower bound.
This may break some programs (this breaks lablgl-0.94).
Both compilers:
- Revised compilation of pattern matching.
- Option -I +<subdir> to search a subdirectory <subdir> of the standard
library directory (i.e. write "ocamlc -I +labltk" instead of
"ocamlc -I /usr/local/lib/ocaml/labltk").
- Option -warn-error to turn warnings into errors.
- Option -where to print the location of the standard library directory.
- Assertions are now type-checked even if the -noassert option is given,
thus -noassert can no longer change the types of modules.
Bytecode compiler and bytecode interpreter:
- Print stack backtrace when a program aborts due to an uncaught exception
(requires compilation with -g and running with ocamlrun -b or
OCAMLRUNPARAM="b=1").
Native-code compiler:
- Better unboxing optimizations on the int32, int64, and nativeint types.
- Tail recursion preserved for functions having more parameters than
available registers (but tail calls to other functions are still
turned off if parameters do not fit entirely in registers).
- Fixed name-capture bug in function inlining.
- Improved spilling/reloading strategy for conditionals.
- IA32, Alpha: better alignment of branch targets.
- Removed spurious dependency on the -lcurses library.
Toplevel environment:
- Revised handling of top-level value definitions, allows reclamation
of definitions that are shadowed by later definitions with the same names.
(E.g. "let x = <big list>;; let x = 1;;" allows <big list> to be reclaimed.)
- Revised the tracing facility so that for standard library functions,
only calls from user code are traced, not calls from the system.
- Added a "*" prompt when within a comment.
Runtime system:
- Fixed portability issue on bcopy() vs memmove(), affecting Linux RedHat 7.0
in particular.
- Structural comparisons (=, <>, <, <=, >, >=, compare) reimplemented
so as to avoid overflowing the C stack.
- Input/output functions: arrange so that reads and writes on closed
in_channel or out_channel raise Sys_error immediately.
Standard library:
- Module Gc: changed some counters to float in order to avoid overflow;
added alarms
- Module Hashtbl: added Hashtbl.replace.
- Module Int64: added bits_of_float, float_of_bits (access to IEEE 754
representation of floats).
- Module List: List.partition now tail-rec;
improved memory behavior of List.stable_sort.
- Module Nativeint: added Nativeint.size (number of bits in a nativeint).
- Module Obj: fixed incorrect resizing of float arrays in Obj.resize.
- Module Pervasives: added float constants "infinity", "neg_infinity", "nan";
added a "classify_float" function to test a float for NaN, infinity, etc.
- Pervasives.input_value: fixed bug affecting shared custom objects.
- Pervasives.output_value: fixed size bug affecting "int64" values.
- Pervasives.int_of_string, {Int32,Int64,Nativeint}.of_string:
fixed bug causing bad digits to be accepted without error.
- Module Random: added get_state and set_state to checkpoint the generator.
- Module Sys: signal handling functions are passed the system-independent
signal number rather than the raw system signal number whenever possible.
- Module Weak: added Weak.get_copy.
Other libraries:
- Bigarray: added Bigarray.reshape to take a view of the elements of a
bigarray with different dimensions or number of dimensions;
fixed bug causing "get" operations to be unavailable in custom
toplevels including Bigarray.
- Dynlink: raise an error instead of crashing when the loaded module
refers to the not-yet-initialized module performing a dynlink operation.
- Bytecode threads: added a thread-safe version of the Marshal module;
fixed a rare GC bug in the thread scheduler.
- POSIX threads: fixed compilation problem with threads.cmxa.
- Both thread libraries: better tail-recursion in Event.sync.
- Num library: fixed bug in square roots (Nat.sqrt_nat, Big_int.sqrt_big_int).
Tools:
- ocamldep: fixed missing dependencies on labels of record patterns and
record construction operations
Win32 port:
- Unix.waitpid now implements the WNOHANG option.
Mac OS ports:
- Mac OS X public beta is supported.
- Int64.format works on Mac OS 8/9.
Objective Caml 3.00 (25 Apr 2000):
----------------------------------
Language:
- OCaml/OLabl merger:
* Support for labeled and optional arguments for functions and classes.
* Support for variant types (sum types compared by structure).
See tutorial (chapter 2 of the OCaml manual) for more information.
- Syntactic change: "?" in stream error handlers changed to "??".
- Added exception renaming in structures (exception E = F).
- (OCaml 2.99/OLabl users only) Label syntax changed to preserve
backward compatibility with 2.0x (labeled function application
is f ~lbl:arg instead of f lbl:arg). A tool is provided to help
convert labelized programs to OCaml 3.00.
Both compilers:
- Option -labels to select commuting label mode (labels are mandatory,
but labeled arguments can be passed in a different order than in
the definition of the function; in default mode, labels may be omitted,
but argument reordering is only allowed for optional arguments).
- Libraries (.cma and .cmxa files) now "remember" C libraries given
at library construction time, and add them back at link time.
Allows linking with e.g. just unix.cma instead of
unix.cma -custom -cclib -lunix
- Revised printing of error messages, now use Format.fprintf; no visible
difference for users, but could facilitate internationalization later.
- Fixed bug in unboxing of records containing only floats.
- Fixed typing bug involving applicative functors as components of modules.
- Better error message for inconsistencies between compiled interfaces.
Bytecode compiler:
- New "modular" format for bytecode executables; no visible differences
for users, but will facilitate further extensions later.
- Fixed problems in signal handling.
Native-code compiler:
- Profiling support on x86 under FreeBSD
- Open-coding and unboxing optimizations for the new integer types
int32, int64, nativeint, and for bigarrays.
- Fixed instruction selection bug with "raise" appearing in arguments
of strict operators, e.g. "1 + raise E".
- Better error message when linking incomplete/incorrectly ordered set
of .cmx files.
- Optimized scanning of global roots during GC, can reduce total running
time by up to 8% on GC-intensive programs.
Interactive toplevel:
- Better printing of exceptions, including arguments, when possible.
- Fixed rare GC bug occurring during interpretation of scripts.
- Added consistency checks between interfaces and implementations
during #load.
Run-time system:
- Added support for "custom" heap blocks (heap blocks carrying
C functions for finalization, comparison, hashing, serialization
and deserialization).
- Support for finalisation functions written in Caml.
Standard library:
- New modules Int32, Int64, Nativeint for 32-bit, 64-bit and
platform-native integers
- Module Array: added Array.sort, Array.stable_sort.
- Module Gc: added Gc.finalise to attach Caml finalisation functions to
arbitrary heap-allocated data.
- Module Hashtbl: do not bomb when resizing very large table.
- Module Lazy: raise Lazy.Undefined when a lazy evaluation needs itself.
- Module List: added List.sort, List.stable_sort; fixed bug in List.rev_map2.
- Module Map: added mapi (iteration with key and data).
- Module Set: added iterators for_all, exists, filter, partition.
- Module Sort: still here but deprecated in favor of new sorting functions
in Array and List.
- Module Stack: added Stack.top
- Module String: fixed boundary condition on String.rindex_from
- Added labels on function arguments where appropriate.
New libraries and tools:
- ocamlbrowser: graphical browser for OCaml sources and compiled interfaces,
supports cross-referencing, editing, running the toplevel.
- LablTK: GUI toolkit based on TK, using labeled and optional arguments,
easier to use than CamlTK.
- Bigarray: large, multi-dimensional numerical arrays, facilitate
interfacing with C/Fortran numerical code, efficient support for
advanced array operations such as slicing and memory-mapping of files.
Other libraries:
- Bytecode threads: timer-based preemption was broken, works back again;
fixed bug in Pervasives.input_line; exported Thread.yield.
- System threads: several GC / reentrancy bugs fixed in buffered I/O
and Unix I/O; revised Thread.join implementation for strict POSIX
conformance; exported Thread.yield.
- Graphics: added support for double buffering; added, current_x, current_y,
rmoveto, rlineto, and draw_rect.
- Num: fixed bug in Num.float_of_num.
- Str: worked around potential symbol conflicts with C standard library.
- Dbm: fixed bug with Dbm.iter on empty database.
New or updated ports:
- Alpha/Digital Unix: lifted 256M limitation on total memory space
induced by -taso
- Port to AIX 4.3 on PowerPC
- Port to HPUX 10 on HPPA
- Deprecated 680x0 / SunOS port
Macintosh port:
- Implemented the Unix and Thread libraries.
- The toplevel application does not work on 68k Macintoshes; maybe
later if there's a demand.
- Added a new tool, ocamlmkappli, to build an application from a
program written in O'Caml.
Objective Caml 2.04 (26 Nov 1999):
----------------------------------
- C interface: corrected inconsistent change in the CAMLparam* macros.
- Fixed internal error in ocamlc -g.
- Fixed type-checking of "S with ...", where S is a module type name
abbreviating another module type name.
- ocamldep: fixed stdout/stderr mismatch after failing on one file.
- Random.self_init more random.
- Windows port:
- Toplevel application: fixed spurious crash on exit.
- Native-code compiler: fixed bug in assembling certain
floating-point constants (masm doesn't grok 2e5, wants 2.0e5).
Objective Caml 2.03 (19 Nov 1999):
----------------------------------
New ports:
- Ported to BeOS / Intel x86 (bytecode and native-code).
- BSD / Intel x86 port now supports both a.out and ELF binary formats.
- Added support for {Net,Open}BSD / Alpha.
- Revamped Rhapsody port, now works on MacOS X server.
Syntax:
- Warning for "(*)" and "*)" outside comment.
- Removed "#line LINENO", too ambiguous with a method invocation;
the equivalent "# LINENO" is still supported.
Typing:
- When an incomplete pattern-matching is detected, report also a
value or value template that is not covered by the cases of
the pattern-matching.
- Several bugs in class type matching and in type error reporting fixed.
- Added an option -rectypes to support general recursive types,
not just those involving object types.
Bytecode compiler:
- Minor cleanups in the bytecode emitter.
- Do not remove "let x = y" bindings in -g mode; makes it easier to
debug the code.
Native-code compiler:
- Fixed bug in grouping of allocations performed in the same basic block.
- Fixed bug in constant propagation involving expressions containing
side-effects.
- Fixed incorrect code generation for "for" loops whose upper bound is
a reference assigned inside the loop.
- MIPS code generator: work around a bug in the IRIX 6 assembler.
Toplevel:
- Fixed incorrect redirection of standard formatter to stderr
while executing toplevel scripts.
Standard library:
- Added List.rev_map, List.rev_map2.
- Documentation of List functions now says which functions are
tail-rec, and how much stack space is needed for non-tailrec functions.
- Wrong type for Printf.bprintf fixed.
- Fixed weird behavior of Printf.sprintf and Printf.bprintf in case of
partial applications.
- Added Random.self_init, which initializes the PRNG from the system date.
- Sort.array: serious bugs fixed.
- Stream.count: fixed incorrect behavior with ocamlopt.
Run-time system and external interface:
- Fixed weird behavior of signal handlers w.r.t. signal masks and exceptions
raised from the signal handler.
- Fixed bug in the callback*_exn() functions.
Debugger:
- Fixed wrong printing of float record fields and elements of float arrays.
- Supports identifiers starting with '_'.
Profiler:
- Handles .mli files, so ocamlcp can be used to replace ocamlc (e.g. in a
makefile).
- Now works on programs that use stream expressions and stream parsers.
Other libraries:
- Graphics: under X11, treat all mouse buttons equally; fixed problem
with current font reverting to the default font when the graphics
window is resized.
- Str: fixed reentrancy bugs in Str.replace and Str.full_split.
- Bytecode threads: set standard I/O descriptors to non-blocking mode.
- OS threads: revised implementation of Thread.wait_signal.
- All threads: added Event.wrap_abort, Event.choose [].
- Unix.localtime, Unix.gmtime: check for errors.
- Unix.create_process: now supports arbitrary redirections of std descriptors.
- Added Unix.open_process_full.
- Implemented Unix.chmod under Windows.
- Big_int.square_big_int now gives the proper sign to its result.
Others:
- ocamldep: don't stop at first error, skip to next file.
- Emacs mode: updated with Garrigue and Zimmerman's snapshot of 1999/10/18.
- configure script: added -prefix option.
- Windows toplevel application: fixed problem with graphics library
not loading properly.
Objective Caml 2.02 (04 Mar 1999):
----------------------------------
* Type system:
- Check that all components of a signature have unique names.
- Fixed bug in signature matching involving a type component and
a module component, both sharing an abstract type.
- Bug involving recursive classes constrained by a class type fixed.
- Fixed bugs in printing class types and in printing unification errors.
* Compilation:
- Changed compilation scheme for "{r with lbl = e}" when r has many fields
so as to avoid code size explosion.
* Native-code compiler:
- Better constant propagation in boolean expressions and in conditionals.
- Removal of unused arguments during function inlining.
- Eliminated redundant tagging/untagging in bit shifts.
- Static allocation of closures for functions without free variables,
reduces the size of initialization code.
- Revised compilation scheme for definitions at top level of compilation
units, so that top level functions have no free variables.
- Coalesced multiple allocations of heap blocks inside one expression
(e.g. x :: y :: z allocates the two conses in one step).
- Ix86: better handling of large integer constants in instruction selection.
- MIPS: fixed wrong asm generated for String.length "literal".
* Standard library:
- Added the "ignore" primitive function, which just throws away its
argument and returns "()". It allows to write
"ignore(f x); y" if "f x" doesn't have type unit and you don't
want the warning caused by "f x; y".
- Added the "Buffer" module (extensible string buffers).
- Module Format: added formatting to buffers and to strings.
- Added "mem" functions (membership test) to Hashtbl and Map.
- Module List: added find, filter, partition.
Renamed remove and removeq to remove_assoc and remove_assq.
- Module Marshal: fixed bug in marshaling functions when passed functional
values defined by mutual recursion with other functions.
- Module Printf: added Printf.bprintf (print to extensible buffer);
added %i format as synonymous for %d (as per the docs).
- Module Sort: added Sort.array (Quicksort).
* Runtime system:
- New callback functions for callbacks with arbitrary many arguments
and for catching Caml exceptions escaping from a callback.
* The ocamldep dependency generator: now performs full parsing of the
sources, taking into account the scope of module bindings.
* The ocamlyacc parser generator: fixed sentinel error causing wrong
tables to be generated in some cases.
* The str library:
- Added split_delim, full_split as variants of split that control
more precisely what happens to delimiters.
- Added replace_matched for separate matching and replacement operations.
* The graphics library:
- Bypass color lookup for 16 bpp and 32 bpp direct-color displays.
- Larger color cache.
* The thread library:
- Bytecode threads: more clever use of non-blocking I/O, makes I/O
operations faster.
- POSIX threads: gcc-ism removed, should now compile on any ANSI C compiler.
- Both: avoid memory leak in the Event module when a communication
offer is never selected.
* The Unix library:
- Fixed inversion of ctime and mtime in Unix.stat, Unix.fstat, Unix.lstat.
- Unix.establish_connection: properly reclaim socket if connect fails.
* The DBM library: no longer crashes when calling Dbm.close twice.
* Emacs mode:
- Updated with Garrigue and Zimmerman's latest version.
- Now include an "ocamltags" script for using etags on OCaml sources.
* Win32 port:
- Fixed end-of-line bug in ocamlcp causing problems with generated sources.
Objective Caml 2.01 (09 Dec 1998):
----------------------------------
* Typing:
- Added warning for expressions of the form "a; b" where a does not have
type "unit"; catches silly mistake such as
"record.lbl = newval; ..." instead of "record.lbl <- newval; ...".
- Typing bug in "let module" fixed.
* Compilation:
- Fixed bug in compilation of recursive and mutually recursive classes.
- Option -w to turn specific warnings on/off.
- Option -cc to choose the C compiler used with ocamlc -custom and ocamlopt.
* Bytecode compiler and bytecode interpreter:
- Intel x86: removed asm declaration causing "fixed or forbidden register
spilled" error with egcs and gcc 2.8 (but not with gcc 2.7, go figure).
- Revised handling of debugging information, allows faster linking with -g.
* Native-code compiler:
- Fixed bugs in integer constant propagation.
- Out-of-bound accesses in array and strings now raise an Invalid_argument
exception (like the bytecode system) instead of stopping the program.
- Corrected scheduling of bound checks.
- Port to the StrongARM under Linux (e.g. Corel Netwinder).
- I386: fixed bug in profiled code (ocamlopt -p).
- Mips: switched to -n32 model under IRIX; dropped the Ultrix port.
- Sparc: simplified the addressing modes, allows for better scheduling.
- Fixed calling convention bug for Pervasives.modf.
* Toplevel:
- #trace works again.
- ocamlmktop: use matching ocamlc, not any ocamlc from the search path.
* Memory management:
- Fixed bug in heap expansion that could cause the GC to loop.
* C interface:
- New macros CAMLparam... and CAMLlocal... to simplify the handling
of local roots in C code.
- Simplified procedure for allocating and filling Caml blocks from C.
- Declaration of string_length in <caml/mlvalues.h>.
* Standard library:
- Module Format: added {get,set}_all_formatter_output_functions,
formatter_of_out_channel, and the control sequence @<n> in printf.
- Module List: added mem_assoc, mem_assq, remove, removeq.
- Module Pervasives: added float_of_int (synonymous for float),
int_of_float (truncate), int_of_char (Char.code), char_of_int (Char.chr),
bool_of_string.
- Module String: added contains, contains_from, rcontains_from.
* Unix library:
- Unix.lockf: added F_RLOCK, F_TRLOCK; use POSIX locks whenever available.
- Unix.tc{get,set}attr: added non-standard speeds 57600, 115200, 230400.
- Unix.chroot: added.
* Threads:
- Bytecode threads: improved speed of I/O scheduling.
- Native threads: fixed a bug involving signals and exceptions
generated from C.
* The "str" library:
- Added Str.string_partial_match.
- Bumped size of internal stack.
* ocamlyacc: emit correct '# lineno' directive for prelude part of .mly file.
* Emacs editing mode: updated with Jacques Garrigue's newest code.
* Windows port:
- Added support for the "-cclib -lfoo" option (instead of
-cclib /full/path/libfoo.lib as before).
- Threads: fixed a bug at initialization time.
* Macintosh port: source code for Macintosh application merged in.
Objective Caml 2.00 (19 Aug 1998):
----------------------------------
* Language:
- New class language. See http://caml.inria.fr/ocaml/refman/
for a tutorial (chapter 2) and for the reference manual (section 4.9).
- Local module definitions "let module X = <module-expr> in <expr>".
- Record copying with update "{r with lbl1 = expr1; ...}".
- Array patterns "[|pat1; ...;patN|]" in pattern-matchings.
- New reserved keywords: "object", "initializer".
- No longer reserved: "closed", "protected".
* Bytecode compiler:
- Use the same compact memory representations for float arrays, float
records and recursive closures as the native-code compiler.
- More type-dependent optimizations.
- Added the -use_runtime and -make_runtime flags to build separately
and reuse afterwards custom runtime systems
(inspired by Fabrice Le Fessant's patch).
* Native-code compiler:
- Cross-module constant propagation of integer constants.
- More type-dependent optimizations.
- More compact code generated for "let rec" over data structures.
- Better code generated for "for" loops (test at bottom of code).
- More aggressive scheduling of stores.
- Added -p option for time profiling with gprof
(fully supported on Intel x86/Linux and Alpha/Digital Unix only)
(inspired by Aleksey Nogin's patch).
- A case of bad spilling with high register pressure fixed.
- Fixed GC bug when GC called from C without active Caml code.
- Alpha: $gp handling revised to follow Alpha's standard conventions,
allow running "atom" and "pixie" on ocamlopt-generated binaries.
- Intel x86: use movzbl and movsbl systematically to load 8-bit and 16-bit
quantities, no more hacks with partial registers (better for the
Pentium Pro, worse for the Pentium).
- PowerPC: more aggressive scheduling of return address reloading.
- Sparc: scheduling bug related to register pairs fixed.
* Runtime system:
- Better printing of uncaught exceptions (print a fully qualified
name whenever possible).
* New ports:
- Cray T3E (bytecode only) (in collaboration with CEA).
- PowerMac under Rhapsody.
- SparcStations under Linux.
* Standard library:
- Added set_binary_mode_in and set_binary_mode_out in Pervasives
to toggle open channels between text and binary modes.
- output_value and input_value check that the given channel is in
binary mode.
- input_value no longer fails on very large marshalled data (> 16 Mbytes).
- Module Arg: added option Rest.
- Module Filename: temp_file no longer loops if temp dir doesn't exist.
- Module List: added rev_append (tail-rec alternative to @).
- Module Set: tell the truth about "elements" returning a sorted list;
added min_elt, max_elt, singleton.
- Module Sys: added Sys.time for simple measuring of CPU time.
* ocamllex:
- Check for overflow when generating the tables for the automaton.
- Error messages in generated .ml file now point to .mll source.
- Added "let <id> = <regexp>" to name regular expressions
(inspired by Christian Lindig).
* ocamlyacc:
- Better error recovery in presence of EOF tokens.
- Error messages in generated .ml file now point to .mly source.
- Generated .ml file now type-safe even without the generated .mli file.
* The Unix library:
- Use float instead of int to represent Unix times (number of seconds
from the epoch). This fixes a year 2005 problem on 32-bit platforms.
Functions affected: stat, lstat, fstat, time, gmtime, localtime,
mktime, utimes.
- Added putenv.
- Better handling of "unknown" error codes (EUNKNOWNERR).
- Fixed endianness bug in getservbyport.
- win32unix (the Win32 implementation of the Unix library) now has
the same interface as the unix implementation, this allows exchange
of compiled .cmo and .cmi files between Unix and Win32.
* The thread libraries:
- Bytecode threads: bug with escaping exceptions fixed.
- System threads (POSIX, Win32): malloc/free bug fixed; signal bug fixed.
- Both: added Thread.wait_signal to wait synchronously for signals.
* The graph library: bigger color cache.
* The str library: added Str.quote, Str.regexp_string,
Str.regexp_string_case_fold.
* Emacs mode:
- Fixed bug with paragraph fill.
- Fixed bug with next-error under Emacs 20.
Objective Caml 1.07 (11 Dec 1997):
----------------------------------
* Native-code compiler:
- Revised interface between generated code and GC, fixes serious GC
problems with signals and native threads.
- Added "-thread" option for compatibility with ocamlc.
* Debugger: correctly print instance variables of objects.
* Run-time system: ported to OpenBSD.
* Standard library: fixed wrong interface for Marshal.to_buffer and
Obj.unmarshal.
* Num library: added Intel x86 optimized asm code (courtesy of
Bernard Serpette).
* Thread libraries:
- Native threads: fixed GC bugs and installation procedure.
- Bytecode threads: fixed problem with "Marshal" module.
- Both: added Event.always.
* MS Windows port: better handling of long command lines in Sys.command
Objective Caml 1.06 (18 Nov 1997):
----------------------------------
* Language:
- Added two new keywords: "assert" (check assertion) and "lazy"
(delay evaluation).
- Allow identifiers to start with "_" (such identifiers are treated
as lowercase idents).
* Objects:
- Added "protected" methods (visible only from subclasses, can be hidden
in class type declared in module signature).
- Objects can be compared using generic comparison functions.
- Fixed compilation of partial application of object constructors.
* Type system:
- Occur-check now more strict (all recursions must traverse an object).
- A few bugs fixed.
* Run-time system:
- A heap compactor was implemented, so long-running programs can now
fight fragmentation.
- The meaning of the "space_overhead" parameter has changed.
- The macros Push_roots and Pop_roots are superseded by Begin_roots* and
End_roots.
- Bytecode executable includes list of primitives used, avoids crashes
on version mismatch.
- Reduced startup overhead for marshalling, much faster marshalling of
small objects.
- New exception Stack_overflow distinct from Out_of_memory.
- Maximum stack size configurable.
- I/O revised for compatibility with compactor and with native threads.
- All C code ANSIfied (new-style function declarations, etc).
- Threaded code work on all 64-bit processors, not just Alpha/Digital Unix.
- Better printing of uncaught exceptions.
* Both compilers:
- Parsing: more detailed reporting of syntax errors (e.g. shows
unmatched opening parenthesis on missing closing parenthesis).
- Check consistency between interfaces (.cmi).
- Revised rules for determining dependencies between modules.
- Options "-verbose" for printing calls to C compiler, "-noassert"
for turning assertion checks off.
* Native-code compiler:
- Machine-dependent parts rewritten using inheritance instead of
parameterized modules.
- GC bug in value let rec fixed.
- Port to Linux/Alpha.
- Sparc: cleaned up use of %g registers, now compatible with Solaris threads.
* Top-level interactive system:
- Can execute Caml script files given on command line.
- Reads commands from ./.ocamlinit on startup.
- Now thread-compatible.
* Standard library:
- New library module: Lazy (delayed computations).
- New library module: Marshal. Allows marshalling to strings and
transmission of closures between identical programs (SPMD parallelism).
- Filename: "is_absolute" is superseded by "is_implicit" and "is_relative".
To adapt old programs, change "is_absolute x" to "not (is_implicit x)"
(but the new "is_relative" is NOT the opposite of the old "is_absolute").
- Array, Hashtbl, List, Map, Queue, Set, Stack, Stream:
the "iter" functions now take as argument a unit-returning function.
- Format: added "printf" interface to the formatter (see the documentation).
Revised behaviour of simple boxes: no more than one new line is output
when consecutive break hints should lead to multiple line breaks.
- Stream: revised implementation, renamed Parse_failure to Failure and
Parse_error to Error (don't you love gratuitous changes?).
- String: added index, rindex, index_from, rindex_from.
- Array: added mapi, iteri, fold_left, fold_right, init.
- Added Map.map, Set.subset, Printexc.to_string.
* ocamllex: lexers generated by ocamllex can now handle all characters,
including '\000'.
* ocamlyacc: fixed bug with function closures returned by parser rules.
* Debugger:
- Revised generation of events.
- Break on function entrance.
- New commands start/previous.
- The command loadprinter now try to recursively load required
modules.
- Numerous small fixes.
* External libraries:
- systhreads: can now use POSIX threads; POSIX and Win32 threads are
now supported by the native-code compiler.
- dbm and graph: work in native code.
- num: fixed bug in Nat.nat_of_string.
- str: fixed deallocation bug with case folding.
- win32unix: use Win32 handles instead of (buggy) VC++ emulation of Unix
file handles; added gettimeofday.
* Emacs editing mode and debugger interface updated to July '97 version.
Objective Caml 1.05 (21 Mar 1997):
----------------------------------
* Typing: fixed several bugs causing spurious type errors.
* Native-code compiler: fixed instruction selection bug causing GC to
see ill-formed pointers; fixed callbacks to support invocation from a
main program in C.
* Standard library: fixed String.lowercase; Weak now resists integers.
* Toplevel: multiple phrases without intermediate ";;" now really supported;
fixed value printing problems where the wrong printer was selected.
* Debugger: fixed printing problem with local references; revised
handling of checkpoints; various other small fixes.
* Macintosh port: fixed signed division problem in bytecomp/emitcode.ml
Objective Caml 1.04 (11 Mar 1997):
----------------------------------
* Replay debugger ported from Caml Light; added debugger support in
compiler (option -g) and runtime system. Debugger is alpha-quality
and needs testing.
* Parsing:
- Support for "# linenum" directives.
- At toplevel, allow several phrases without intermediate ";;".
* Typing:
- Allow constraints on datatype parameters, e.g.
type 'a foo = ... constraint 'a = 'b * 'c.
- Fixed bug in signature matching in presence of free type variables '_a.
- Extensive cleanup of internals of type inference.
* Native-code compilation:
- Inlining of small functions at point of call (fairly conservative).
- MIPS code generator ported to SGI IRIX 6.
- Better code generated for large integer constants.
- Check for urgent GC when allocating large objects in major heap.
- PowerPC port: better scheduling, reduced TOC consumption.
- HPPA port: handle long conditional branches gracefully,
several span-dependent bugs fixed.
* Standard library:
- More floating-point functions (all ANSI C float functions now available).
- Hashtbl: added functorial interface (allow providing own equality
and hash functions); rehash when resizing, avoid memory leak on
Hashtbl.remove.
- Added Char.uppercase, Char.lowercase, String.uppercase, String.lowercase,
String.capitalize, String.uncapitalize.
- New module Weak for manipulating weak pointers.
- New module Callback for registering closures and exceptions to be
used from C.
* Foreign interface:
- Better support for callbacks (C calling Caml), exception raising
from C, and main() in C. Added function to remove a global root.
- Option -output-obj to package Caml code as a C library.
* Thread library: fixed bug in timed_read and timed_write operations;
Lexing.from_function and Lexing.from_channel now reentrant.
* Unix interface: renamed EACCESS to EACCES (the POSIX name); added setsid;
fixed bug in inet_addr_of_string for 64-bit platforms.
* Ocamlyacc: default error function no longer prevents error recovery.
* Ocamllex: fixed reentrancy problem w.r.t. exceptions during refill;
fixed output problem (\r\r\n) under Win32.
* Macintosh port:
- The makefiles are provided for compiling and installing O'Caml on
a Macintosh with MPW 3.4.1.
- An application with the toplevel in a window is forthcoming.
* Windows NT/95 port: updated toplevel GUI to that of Caml Light 0.73.
* Emacs editing mode and debugger interface included in distribution.
Objective Caml 1.03 (29 Oct 1996):
----------------------------------
* Typing:
- bug with type names escaping their scope via unification with
non-generalized type variables '_a completely fixed;
- fixed bug in occur check : it was too restrictive;
- fixed bug of coercion operators;
- check that no two types of the same name are generated in a module
(there was no check for classes);
- "#install_printer" works again;
- fixed bug in printing of subtyping errors;
- in class interfaces, construct "method m" (without type) change
the status of method m from abstract to concrete;
- in a recursive definition of class interfaces, a class can now
inherit from a previous class;
- typing of a method make use of an eventual previously given type
of this method, yielding clearer type errors.
* Compilation (ocamlc and ocamlopt):
- fixed bug in compilation of classes.
* Native-code compilation:
- optimization of functions taking tuples of arguments;
- code emitter for the Motorola 680x0 processors (retrocomputing week);
- Alpha/OSF1: generate frame descriptors, avoids crashes when e.g.
exp() or log() cause a domain error; fixed bug with
String.length "literal";
- Sparc, Mips, HPPA: removed marking of scanned stack frames
(benefits do not outweigh cost).
* Standard library:
- Arg.parse now prints documentation for command-line options;
- I/O buffers (types in_channel and out_channel) now heap-allocated,
avoids crashing when closing a channel several times;
- Overflow bug in compare() fixed;
- GC bug in raising Sys_error from I/O functions fixed;
- Parsing.symbol_start works even for epsilon productions.
* Foreign interface: main() in C now working, fixed bug in library
order at link time.
* Thread library: guard against calling thread functions before Thread.create.
* Unix library: fixed getsockopt, setsockopt, open_process_{in,out}.
* Perl-free, cpp-free, cholesterol-free installation procedure.
Objective Caml 1.02 (27 Sep 1996):
----------------------------------
* Typing:
- fixed bug with type names escaping their scope via unification
with non-generalized type variables '_a;
- keep #class abbreviations longer;
- faster checking of well-formed abbreviation definitions;
- stricter checking of "with" constraints over signatures (arity
mismatch, overriding of an already manifest type).
* Compilation (ocamlc and ocamlopt):
- fixed bug in compilation of recursive classes;
- [|...|] and let...rec... allowed inside definitions of recursive
data structures;
* Bytecode compilation: fixed overflow in linker for programs with
more than 65535 globals and constants.
* Native-code compilation:
- ocamlopt ported to HPPA under HP/UX, Intel x86 under Solaris 2,
PowerMacintosh under MkLinux;
- fixed two bugs related to floating-point arrays (one with "t array"
where t is an abstract type implemented as float, one with
comparison between two float arrays on 32 bit platforms);
- fixed reloading/spilling problem causing non-termination of
register allocation;
- fixed bugs in handling of () causing loss of tail recursion;
- fixed reloading bug in indirect calls.
* Windows NT/95 port:
- complete port of the threads library (Pascal Cuoq);
- partial port of the Unix library (Pascal Cuoq);
- expansion of *, ? and @ on the command line.
* Standard library:
- bug in in List.exists2 fixed;
- bug in "Random.int n" for very large n on 64-bit machines fixed;
- module Format: added a "general purpose" type of box (open_box);
can output on several formatters at the same time.
* The "threads" library:
- implementation on top of native threads available for Win32 and
POSIX 1003.1c;
- added -thread option to select a thread-safe version of the
standard library, the ThreadIO module is no longer needed.
* The "graph" library: avoid invalid pixmaps when doing
open_graph/close_graph several times.
* The "dynlink" library: support for "private" (no re-export) dynamic loading.
* ocamlyacc: skip '...' character literals correctly.
* C interface: C code linked with O'Caml code can provide its own main()
and call caml_main() later.
Objective Caml 1.01 (12 Jun 1996):
----------------------------------
* Typing: better report of type incompatibilities;
non-generalizable type variables in a struct...end no longer flagged
immediately as an error;
name clashes during "open" avoided.
* Fixed bug in output_value where identical data structures
could have different external representations; this bug caused wrong
"inconsistent assumptions" errors when checking compatibility of
interfaces at link-time.
* Standard library: fixed bug in Array.blit on overlapping array sections
* Unmarshaling from strings now working.
* ocamlc, ocamlopt: new flags -intf and -impl to force compilation as
an implementation/an interface, regardless of file extension;
overflow bug on wide-range integer pattern-matchings fixed.
* ocamlc: fixed bytecode generation bug causing problems with compilation
units defining more than 256 values
* ocamlopt, all platforms:
fixed GC bug in "let rec" over data structures;
link startup file first, fixes "undefined symbol" errors with some
libraries.
* ocamlopt, Intel x86:
more efficient calling sequence for calling C functions;
floating-point wars, chapter 5: don't use float stack for holding
float pseudo-registers, stack-allocating them is just as efficient.
* ocamlopt, Alpha and Intel x86: more compact calling sequence for garbage
collection.
* ocamllex: generated automata no longer use callbacks for refilling
the input buffer (works better with threads); character literals
correctly skipped inside actions.
* ocamldep: "-I" directories now searched in the right order
* Thread library: incompatibilities with callbacks, signals, and
dynamic linking removed; scheduling bug with Thread.wait fixed.
* New "dbm" library, interfaces with NDBM.
* Object-oriented extensions:
instance variables can now be omitted in class types;
some error messages have been made clearer;
several bugs fixes.
Objective Caml 1.00 (9 May 1996):
---------------------------------
* Merge of Jérôme Vouillon and Didier Rémy's object-oriented
extensions.
* All libraries: all "new" functions renamed to "create" because "new"
is now a reserved keyword.
* Compilation of "or" patterns (pat1 | pat2) completely revised to
avoid code size explosion.
* Compiler support for preprocessing source files (-pp flag).
* Library construction: flag -linkall to force linking of all units in
a library.
* Native-code compiler: port to the Sparc under NetBSD.
* Toplevel: fixed bug when tracing several times the same function
under different names.
* New format for marshaling arbitrary data structures, allows
marshaling to/from strings.
* Standard library: new module Genlex (configurable lexer for streams)
* Thread library: much better support for I/O and blocking system calls.
* Graphics library: faster reclamation of unused pixmaps.
* Unix library: new functions {set,clear}_nonblock, {set,clear}_close_on_exec,
{set,get}itimer, inet_addr_any, {get,set}sockopt.
* Dynlink library: added support for linking libraries (.cma files).
Caml Special Light 1.15 (15 Mar 1996):
--------------------------------------
* Caml Special Light now runs under Windows NT and 95. Many thanks to
Kevin Gallo (Microsoft Research) who contributed his initial port.
* csllex now generates tables for a table-driven automaton.
The resulting lexers are smaller and run faster.
* Completely automatic configuration script.
* Typing: more stringent checking of module type definitions against
manifest module type specifications.
* Toplevel: recursive definitions of values now working.
* Native-code compiler, all platforms:
toplevel "let"s with refutable patterns now working;
fixed bug in assignment to float record fields;
direct support for floating-point negation and absolute value.
* Native-code compiler, x86: fixed bug with tail calls (with more than
4 arguments) from a function with a one-word stack frame.
* Native-code compiler, Sparc: problem with -compact fixed.
* Thread library: support for non-blocking writes; scheduler revised.
* Unix library: bug in gethostbyaddr fixed; bounds checking for read,
write, etc.
Caml Special Light 1.14 (8 Feb 1996):
-------------------------------------
* cslopt ported to the PowerPC/RS6000 architecture. Better support for
AIX in the bytecode system as well.
* cslopt, all platforms: fixed bug in live range splitting around catch/exit.
* cslopt for the Intel (floating-point wars, chapter 4):
implemented Ershov's algorithm to minimize floating-point stack usage;
out-of-order pops fixed.
* Several bug fixes in callbacks and signals.
Caml Special Light 1.13 (4 Jan 1996):
-------------------------------------
* Pattern-matching compilation revised to factor out accesses inside
matched structures.
* Callbacks and signals now supported in cslopt.
Signals are only detected at allocation points, though.
Added callback functions with 2 and 3 arguments.
* More explicit error messages when a native-code program aborts due
to array or string bound violations.
* In patterns, "C _" allowed even if the constructor C has several arguments.
* && and || allowed as alternate syntax for & and or.
* cslopt for the Intel: code generation for floating-point
operations entirely redone for the third time (a pox on whomever at
Intel decided to organize the floating-point registers as a stack).
* cslopt for the Sparc: don't use Sparc V8 smul and sdiv instructions,
emulation on V7 processors is abysmal.
Caml Special Light 1.12 (30 Nov 1995):
--------------------------------------
* Fixed an embarrassing bug with references to floats.
Caml Special Light 1.11 (29 Nov 1995):
--------------------------------------
* Streams and stream parsers a la Caml Light are back (thanks to
Daniel de Rauglaudre).
* User-level concurrent threads, with low-level shared memory primitives
(locks and conditions) as well as channel-based communication primitives
with first-class synchronous events, in the style of Reppy's CML.
* The native-code compiler has been ported to the HP PA-RISC processor
running under NextStep (sorry, no HPUX, its linker keeps dumping
core on me).
* References not captured in a function are optimized into variables.
* Fixed several bugs related to exceptions.
* Floats behave a little more as specified in the IEEE standard
(believe it or not, but x < y is not the negation of x >= y).
* Lower memory consumption for the native-code compiler.
Caml Special Light 1.10 (07 Nov 1995):
--------------------------------------
* Many bug fixes (too many to list here).
* Module language: introduction of a "with module" notation over
signatures for concise sharing of all type components of a signature;
better support for concrete types in signatures.
* Native-code compiler: the Intel 386 version has been ported to
NextStep and FreeBSD, and generates better code (especially for
floats)
* Tools and libraries: the Caml Light profiler and library for
arbitrary-precision arithmetic have been ported (thanks to John
Malecki and Victor Manuel Gulias Fernandez); better docs for the Unix
and regexp libraries.
Caml Special Light 1.07 (20 Sep 1995):
--------------------------------------
* Syntax: optional ;; allowed in compilation units and structures
(back by popular demand)
* cslopt:
generic handling of float arrays fixed
direct function application when the function expr is not a path fixed
compilation of "let rec" over values fixed
multiple definitions of a value name in a module correctly handled
no calls to ranlib in Solaris
* csltop: #trace now working
* Standard library: added List.memq; documentation of Array fixed.
Caml Special Light 1.06 (12 Sep 1995):
--------------------------------------
* First public release.
|