| 1 |
OCaml 5.2.0 (13 May 2024) |
| 2 |
------------------------ |
| 3 |
|
| 4 |
OCaml 5.2.0 is still a somewhat experimental release compared to the OCaml 4.14 |
| 5 |
branch. Some of the highlights in OCaml 5.2.0 are: |
| 6 |
|
| 7 |
- Re-introduced GC compaction |
| 8 |
- Restored native backend for POWER 64 bits |
| 9 |
- Thread sanitizer support |
| 10 |
- New Dynarray module |
| 11 |
- New -H flag for hidden include directories |
| 12 |
- Project-wide occurence metadata support for developer tools |
| 13 |
- Raw identifiers |
| 14 |
- Local open in type expressions |
| 15 |
|
| 16 |
And a lot of incremental changes: |
| 17 |
|
| 18 |
- Around 20 new functions in the standard library |
| 19 |
- Many fixes and improvements in the runtime |
| 20 |
- Many bug fixes |
| 21 |
|
| 22 |
OCaml 5.1.0 (14 September 2023) |
| 23 |
------------------------------- |
| 24 |
|
| 25 |
OCaml 5.1.0 is still a relatively experimental release compared to the OCaml |
| 26 |
4.14 branch. Some of the highlights in OCaml 5.1.0 are: |
| 27 |
|
| 28 |
- Many runtime performance regression and memory-leaks fixes |
| 29 |
(dynlinking, weak arrays, weak hash sets, GC with idle domains, |
| 30 |
and GC prefetching). |
| 31 |
- Restored support for native code generation on RISC-V and s390x architectures. |
| 32 |
- Restored Cygwin port. |
| 33 |
- Reduced installation size (50% reduction) |
| 34 |
- Compressed compilation artefacts (.cmi, .cmt, .cmti, .cmo, .cma files) |
| 35 |
- 19 error message improvements |
| 36 |
- 14 standard library functions made tail-recursive |
| 37 |
with Tail-Recursion-Modulo-Cons (TRMC), such as List.append and List.map. |
| 38 |
- 57 new standard library functions |
| 39 |
- More examples in the standard library documentation |
| 40 |
- 42 bug fixes |
| 41 |
|
| 42 |
|
| 43 |
OCaml 5.0.0 (15 December 2022) |
| 44 |
------------------------------ |
| 45 |
|
| 46 |
OCaml 5.0.0 introduces a completely new runtime environment with support for |
| 47 |
shared memory parallelism and effect handlers. |
| 48 |
|
| 49 |
As a language, OCaml 5 is fully compatible with OCaml 4 down to the performance |
| 50 |
characteristics of your programs. In other words, any code that works with OCaml |
| 51 |
4 should work the same with OCaml 5. |
| 52 |
|
| 53 |
The currently known exceptions to this rule are: |
| 54 |
|
| 55 |
- the removal of many long-deprecated functions and modules |
| 56 |
- changes to the internal runtime API |
| 57 |
- the performance of ephemerons is currently (and temporarily) strongly |
| 58 |
degraded. |
| 59 |
|
| 60 |
|
| 61 |
OCaml 4.14.0 (28 March 2022) |
| 62 |
---------------------------- |
| 63 |
|
| 64 |
- Integrated support for "go to definitions" in Merlin. |
| 65 |
- Standard library: new modules In_channel and Out_channel, |
| 66 |
many new functions in Seq module, UTF decoding and validation support |
| 67 |
for strings and bytes. |
| 68 |
- Runtime optimisation: GC prefetching. Benchmarks show a speedup of around 20% |
| 69 |
in GC-heavy programs. |
| 70 |
- Improved error messages in particular for module-level error. |
| 71 |
- Deprecated functions and modules in preparation for OCaml 5. |
| 72 |
In particular, the Stream and Genlex modules are now deprecated. |
| 73 |
- Type variables can be explicitly introduced in value and variant constructor |
| 74 |
declarations. For instance, |
| 75 |
```ocaml |
| 76 |
val fold: ('acc -> 'elt -> 'acc) -> 'acc -> 'elt list -> 'acc |
| 77 |
type showable = Show: 'a * ('a -> string) -> showable |
| 78 |
``` |
| 79 |
can now be written as |
| 80 |
```ocaml |
| 81 |
val fold: 'acc 'elt. ('acc -> 'elt -> 'acc) -> 'acc -> 'elt list -> 'acc |
| 82 |
type showable = Show: 'a. 'a * ('a -> string) -> showable |
| 83 |
``` |
| 84 |
- Tail-call with up to 64 arguments are now guaranteed to be optimized |
| 85 |
for all architectures. |
| 86 |
- Experimental tail modulo cons (TMC) transformation |
| 87 |
|
| 88 |
OCaml 4.13.0 (24 September 2021) |
| 89 |
------------------------------- |
| 90 |
|
| 91 |
- Safe points: a multicore prerequisite that ensures that ocamlopt-generated |
| 92 |
code can always be interrupted. |
| 93 |
- The best-fit GC allocation policy is now default policy |
| 94 |
(and many other GCs improvements.) |
| 95 |
- Named existential type variables in pattern matching: |
| 96 |
Showable (type a) (x, show : a * (a -> string)). |
| 97 |
- Improved error messages for functor application and functor types. |
| 98 |
- Let-punning for monadic let: let* x = x in can be shortened to let* x in. |
| 99 |
- Module type substitutions SIG with module type T = F(X).S. |
| 100 |
- Many other quality of life improvements |
| 101 |
- Many bug fixes |
| 102 |
|
| 103 |
OCaml 4.12.0 (24 February 2021) |
| 104 |
------------------------------- |
| 105 |
|
| 106 |
- Major progress in reducing the difference between the mainline and multicore |
| 107 |
runtime |
| 108 |
- A new configuration option ocaml-option-nnpchecker which emits an alarm when |
| 109 |
the garbage collector finds out-of-heap pointers that could cause a crash in |
| 110 |
the multicore runtime |
| 111 |
- Support for macOS/arm64 |
| 112 |
- Mnemonic names for warnings |
| 113 |
- Many quality of life improvements |
| 114 |
- Many bug fixes |
| 115 |
|
| 116 |
|
| 117 |
OCaml 4.11.0 (19 August 2020) |
| 118 |
------------------------------ |
| 119 |
|
| 120 |
- Statmemprof: a new statistical memory profiler |
| 121 |
- A new instrumented runtime that logs runtime statistics in a standard format |
| 122 |
- A native backend for the RISC-V architecture |
| 123 |
- Improved backtraces that refer to function names |
| 124 |
- Support for recursive and yet unboxed types |
| 125 |
- A quoted extension syntax for ppxs. |
| 126 |
- Many quality of life improvements |
| 127 |
- Many bug fixes. |
| 128 |
|
| 129 |
|
| 130 |
OCaml 4.10.0 (21 February 2020) |
| 131 |
------------------------------- |
| 132 |
|
| 133 |
- New best-fit allocator for the major heap |
| 134 |
- Preliminary runtime work for OCaml multicore |
| 135 |
- Immutable strings are now enforced at configuration time |
| 136 |
- User-defined indexing operators for multidimensional arrays |
| 137 |
- Coming soon: statmemprof, a new statistical memory profiler. |
| 138 |
- The external API will be released next version. |
| 139 |
- Various improvements to the manual |
| 140 |
- More precise exhaustiveness check for GADTs |
| 141 |
- Many bug fixes |
| 142 |
|
| 143 |
|
| 144 |
OCaml 4.09.1 (18 March 2020) |
| 145 |
---------------------------- |
| 146 |
|
| 147 |
Bug fixes. |
| 148 |
|
| 149 |
OCaml 4.09.0 (18 September 2019) |
| 150 |
-------------------------------- |
| 151 |
|
| 152 |
- New optimisations, in particular for affine functions in matches, |
| 153 |
for instance: |
| 154 |
|
| 155 |
type t = A | B | C |
| 156 |
let affine = function |
| 157 |
| A -> 4 |
| 158 |
| B -> 3 |
| 159 |
| C -> 2 |
| 160 |
|
| 161 |
- The `graphics` library was moved out of the compiler distribution. |
| 162 |
- The `vmthread` library was removed. |
| 163 |
- Support for compiler plugins was removed. |
| 164 |
- Many bug fixes. |
| 165 |
|
| 166 |
OCaml 4.08.1 (5 August 2019) |
| 167 |
---------------------------- |
| 168 |
|
| 169 |
Bug fixes. |
| 170 |
|
| 171 |
OCaml 4.08.0 (14 June 2019) |
| 172 |
--------------------------- |
| 173 |
|
| 174 |
- Binding operators (let*, let+, and*, etc). They can be used to |
| 175 |
streamline monadic code. |
| 176 |
|
| 177 |
- `open` now applies to arbitrary module expression in structures and |
| 178 |
to applicative paths in signatures. |
| 179 |
|
| 180 |
- A new notion of (user-defined) "alerts" generalizes the deprecated |
| 181 |
warning. |
| 182 |
|
| 183 |
- New modules in the standard library: Fun, Bool, Int, Option, Result. |
| 184 |
|
| 185 |
- A significant number of new functions in Float, including FMA |
| 186 |
support, and a new Float.Array submodule. |
| 187 |
|
| 188 |
- Source highlighting for errors and warnings in batch mode. |
| 189 |
|
| 190 |
- Many error messages were improved. |
| 191 |
|
| 192 |
- Improved AFL instrumentation for objects and lazy values. |
| 193 |
|
| 194 |
|
| 195 |
OCaml 4.07.1 (4 October 2018) |
| 196 |
----------------------------- |
| 197 |
|
| 198 |
This release consists mostly of bug fixes. The most salient bugs were |
| 199 |
|
| 200 |
- MPR#7820, GPR#1897: a bug in Array.of_seq (new in 4.07) |
| 201 |
(Thierry Martinez, review by Nicolás Ojeda Bär) |
| 202 |
|
| 203 |
- MPR#7815, GPR#1896: crash in the major GC with the first-fit policy |
| 204 |
(Stephen Dolan and Damien Doligez, report by Joris Giovannangeli) |
| 205 |
|
| 206 |
- MPR#7821, GPR#1908: the compiler loads more cmi, which breaks some builds |
| 207 |
(Jérémie Dimino, review by Gabriel Scherer) |
| 208 |
|
| 209 |
- MPR#7833, GPR#1946: typechecking failure (regression) on large GADT matchings |
| 210 |
(Thomas Refis, report by Jerome Simeon, review by Jacques Garrigue) |
| 211 |
|
| 212 |
See the detailed list of fixes at (Changes#4.07.1). |
| 213 |
|
| 214 |
|
| 215 |
OCaml 4.07.0 (10 July 2018): |
| 216 |
---------------------------- |
| 217 |
|
| 218 |
Some highlights of this release are: |
| 219 |
|
| 220 |
- The way the standard library modules are organized internally has |
| 221 |
changed (GPR#1010, by Jérémie Dimino): |
| 222 |
|
| 223 |
1. the `List` module (for example) is now named `Stdlib__list` |
| 224 |
2. a new Stdlib module contains a series of aliases |
| 225 |
such as `module List = Stdlib__list` |
| 226 |
3. the `Stdlib` module is implicitly opened when type-checking OCaml |
| 227 |
programs (as `Pervasives` previously was), so that `Stdlib.List` can be |
| 228 |
accessed as just `List`, as before. |
| 229 |
|
| 230 |
This should be invisible to most users, although it is possible that |
| 231 |
some tools show the `Stdlib.` or `Stdlib__` prefixes in |
| 232 |
messages. (You might want to report these situations as usability |
| 233 |
bugs.) The change prevents standard library modules from conflicting |
| 234 |
with end-user filenames (please avoid `stdlib.ml` and the |
| 235 |
`Stdlib__` prefix); we may introduce new standard library modules in |
| 236 |
the future with less fear of breaking user code. In particular, |
| 237 |
`Float` (GPR#1638, by Nicolás Ojeda Bär) and `Seq` (GPR#1002, by |
| 238 |
Simon Cruanes) modules have now been added to the standard library. |
| 239 |
|
| 240 |
- The error messages caused by various typing errors have been improved |
| 241 |
to be easier to understand, in particular for beginners. |
| 242 |
(GPR#1505, GPR#1510, by Arthur Charguéreau and Armaël Guéneau) |
| 243 |
|
| 244 |
For example, |
| 245 |
|
| 246 |
# while 1 do () done;; |
| 247 |
^ |
| 248 |
Error: This expression has type int but |
| 249 |
an expression was expected of type bool |
| 250 |
|
| 251 |
now adds the extra explanation |
| 252 |
|
| 253 |
because it is in the condition of a while-loop |
| 254 |
|
| 255 |
- Effort has been made to reduce the compilation time of flambda |
| 256 |
programs, and the size of the produced `.cmx` files when using |
| 257 |
the -Oclassic optimisation level. |
| 258 |
(GPR#1401, GPR#1455, GPR#1627, GPR#1665, by Pierre Chambart, Xavier |
| 259 |
Clerc, Fuyong Quah, and Leo White) |
| 260 |
|
| 261 |
- The HTML manual has benefited from various style improvements |
| 262 |
and should look visually nicer than previous editions. |
| 263 |
(GPR#1741, GPR#1757, GPR#1767 by Charles Chamberlain and steinuil) |
| 264 |
|
| 265 |
The new version of the manual can be consulted at |
| 266 |
<http://caml.inria.fr/pub/docs/manual-ocaml-4.07/>; see the |
| 267 |
previous version for comparison at |
| 268 |
<http://caml.inria.fr/pub/docs/manual-ocaml-4.06/>. |
| 269 |
|
| 270 |
- Since 4.01, it is possible to select a variant constructor or |
| 271 |
record field from a sub-module that is not opened in the current |
| 272 |
scope, if type information is available at the point of use. This |
| 273 |
now also works for GADT constructors. |
| 274 |
(GPR#1648, by Thomas Refis and Leo White) |
| 275 |
|
| 276 |
- The GC should handle the accumulation of custom blocks in the minor |
| 277 |
heap better; this solves some memory-usage issues observed by code |
| 278 |
which allocates a lot of small custom blocks, typically small bigarrays |
| 279 |
(GPR#1476, by Alain Frsich) |
| 280 |
|
| 281 |
See also the detailed list of changes: (Changes#4.07.0). |
| 282 |
|
| 283 |
|
| 284 |
OCaml 4.06.1 (16 Feb 2018): |
| 285 |
--------------------------- |
| 286 |
|
| 287 |
This release consists mostly of bug fixes. The most salient bugs were |
| 288 |
|
| 289 |
- An incorrect compilation of pattern-matching in presence of |
| 290 |
extensible variant constructors (such as exceptions), that had been |
| 291 |
present for a long time. |
| 292 |
(GPR#1459, GPR#1538, by Luc Maranget, Thomas Refis and Gabriel Scherer) |
| 293 |
|
| 294 |
- An optimization of `not (x = y)` into `x <> y`, introduced in |
| 295 |
4.06.0, is incorrect on floating-point numbers in the `nan` |
| 296 |
case. (GPR#1470, by Leo White) |
| 297 |
|
| 298 |
See the detailed list of fixes at (Changes#4.06.1). |
| 299 |
|
| 300 |
|
| 301 |
OCaml 4.06.0 (3 Nov 2017): |
| 302 |
-------------------------- |
| 303 |
|
| 304 |
- Strings (type `string`) are now immutable by default. In-place |
| 305 |
modification must use the type `bytes` of byte sequences, which is |
| 306 |
distinct from `string`. This corresponds to the `-safe-string` |
| 307 |
compile-time option, which was introduced in OCaml 4.02 in 2014, and |
| 308 |
which is now the default. |
| 309 |
(GPR#1252, by Damien Doligez) |
| 310 |
|
| 311 |
- Object types can now extend a previously-defined object type, |
| 312 |
as in `<t; a: int>`. |
| 313 |
(GPR#1118, by Runhang Li) |
| 314 |
|
| 315 |
- Destructive substitution over module signatures can now express more |
| 316 |
substitutions, such as `S with type M.t := type-expr` and `S with |
| 317 |
module M.N := path`. |
| 318 |
(GPR#792, by Valentin Gatien-Baron) |
| 319 |
|
| 320 |
- Users can now define operators that look like array indexing, |
| 321 |
e.g. `let ( .%() ) = List.nth in [0; 1; 2].%(1)` |
| 322 |
(GPR#1064, GPR#1392, by Florian Angeletti) |
| 323 |
|
| 324 |
- New escape `\u{XXXX}` in string literals, denoting the UTF-8 |
| 325 |
encoding of the Unicode code point `XXXX`. |
| 326 |
(GPR#1232, by Daniel Bünzli) |
| 327 |
|
| 328 |
- Full Unicode support was added to the Windows runtime system. In |
| 329 |
particular, file names can now contain Unicode characters. |
| 330 |
(GPR#153, GPR#1200, GPR#1357, GPR#1362, GPR#1363, GPR#1369, GPR#1398, |
| 331 |
GPR#1446, GPR#1448, by ygrek and Nicolás Ojeda Bär) |
| 332 |
|
| 333 |
- An alternate register allocator based on linear scan can be selected |
| 334 |
with `ocamlopt -linscan`. It reduces compilation time compared with |
| 335 |
the default register allocator. |
| 336 |
(GPR#375, Marcell Fischbach and Benedikt Meurer) |
| 337 |
|
| 338 |
- The Num library for arbitrary-precision integer and rational |
| 339 |
arithmetic is no longer part of the core distribution and can be |
| 340 |
found as a separate OPAM package. |
| 341 |
|
| 342 |
See the detailed list of changes: (Changes#4.06.0). |
| 343 |
|
| 344 |
|
| 345 |
OCaml 4.05.0 (13 Jul 2017): |
| 346 |
--------------------------- |
| 347 |
|
| 348 |
Some highlights include: |
| 349 |
|
| 350 |
- Instrumentation support for fuzzing with afl-fuzz. |
| 351 |
(GPR#504, by Stephen Dolan) |
| 352 |
|
| 353 |
- The compilers now accept new `-args/-args0 <file>` command-line |
| 354 |
parameters to provide extra command-line arguments in a file. User |
| 355 |
programs may implement similar options using the new `Expand` |
| 356 |
constructor of the `Arg` module. |
| 357 |
(GPR#748, GPR#843, GPR#864, by Bernhard Schommer) |
| 358 |
|
| 359 |
- Many functions of the standard library that raise an exception now |
| 360 |
have an option-returning variable suffixed by `_opt` Typical |
| 361 |
examples of the new functions include: |
| 362 |
|
| 363 |
int_of_string_opt: string -> int option |
| 364 |
List.nth_opt: 'a list -> int -> 'a option |
| 365 |
Hashtbl.find_opt : ('a, 'b) t -> 'a -> 'b option |
| 366 |
|
| 367 |
(GPR#885, by Alain Frisch) |
| 368 |
|
| 369 |
- The security of the runtime system is now hardened by using `secure_getenv` |
| 370 |
to access environment variables whenever its possible, to avoid unplanned |
| 371 |
privilege-escalation when running setuid binaries. |
| 372 |
(GPR#1213, by Damien Doligez) |
| 373 |
|
| 374 |
See the detailed list of changes: (Changes#4.05.0). |