|
1 |
| -Julia v1.5 Release Notes |
2 |
| -======================== |
3 |
| - |
4 |
| -New language features |
5 |
| ---------------------- |
6 |
| -* Macro calls `@foo {...}` can now also be written `@foo{...}` (without the space) ([#34498]). |
7 |
| -* `⨟` is now parsed as a binary operator with times precedence. It can be entered in the REPL |
8 |
| - with `\bbsemi` followed by <kbd>TAB</kbd> ([#34722]). |
9 |
| - |
10 |
| -* `±` and `∓` are now unary operators as well, like `+` or `-`. Attention has to be paid in |
11 |
| - macros and matrix constructors, which are whitespace sensitive, because expressions like |
12 |
| - `[a ±b]` now get parsed as `[a ±(b)]` instead of `[±(a, b)]`. ([#34200]) |
13 |
| - |
14 |
| -* Passing an identifier `x` by itself as a keyword argument or named tuple element |
15 |
| - is equivalent to `x=x`, implicitly using the name of the variable as the keyword |
16 |
| - or named tuple field name. |
17 |
| - Similarly, passing an `a.b` expression uses `b` as the keyword or field name ([#29333]). |
18 |
| - |
19 |
| -* Packages can now provide custom hints to help users resolve errors by using the |
20 |
| - `register_error_hint` function. Packages that define custom exception types |
21 |
| - can support hints by calling `show_error_hints` from their `showerror` method. ([#35094]) |
22 |
| - |
23 |
| -* Support for Unicode 13.0.0 (via utf8proc 2.5) ([#35282]). |
24 |
| - |
25 |
| -* The compiler optimization level can now be set per-module using the experimental macro |
26 |
| - `Base.Experimental.@optlevel n`. For code that is not performance-critical, setting |
27 |
| - this to 0 or 1 can provide significant latency improvements ([#34896]). |
28 |
| - |
29 |
| -Language changes |
30 |
| ----------------- |
31 |
| - |
32 |
| -* The interactive REPL now uses "soft scope" for top-level expressions: an assignment inside a |
33 |
| - scope block such as a `for` loop automatically assigns to a global variable if one has been |
34 |
| - defined already. This matches the behavior of Julia versions 0.6 and prior, as well as |
35 |
| - [IJulia](https://github.com/JuliaLang/IJulia.jl). |
36 |
| - Note that this only affects expressions interactively typed or pasted directly into the |
37 |
| - default REPL ([#28789], [#33864]). |
38 |
| - |
39 |
| -* Outside of the REPL (e.g. in a file), assigning to a variable within a top-level scope |
40 |
| - block is considered ambiguous if a global variable with the same name exists. |
41 |
| - A warning is given if that happens, to alert you that the code will work differently |
42 |
| - than in the REPL. |
43 |
| - A new command line option `--warn-scope` controls this warning ([#33864]). |
44 |
| - |
45 |
| -* Converting arbitrary tuples to `NTuple`, e.g. `convert(NTuple, (1, ""))` now gives an error, |
46 |
| - where it used to be incorrectly allowed. This is because `NTuple` refers only to homogeneous |
47 |
| - tuples (this meaning has not changed) ([#34272]). |
48 |
| - |
49 |
| -* In docstrings, a level-1 markdown header "Extended help" is now |
50 |
| - interpreted as a marker dividing "brief help" from "extended help." |
51 |
| - The REPL help mode only shows the brief help (the content before the |
52 |
| - "Extended help" header) by default; prepend the expression with '?' |
53 |
| - (in addition to the one that enters the help mode) to see the full |
54 |
| - docstring. ([#25930]) |
55 |
| - |
56 |
| -* The syntax `(;)` (which was deprecated in v1.4) now creates an empty named tuple ([#30115]). |
57 |
| - |
58 |
| -* `@inline` macro can now be applied to short-form anonymous functions ([#34953]). |
59 |
| - |
60 |
| -* In triple-quoted string literals, whitespace stripping is now done before processing |
61 |
| - escape sequences instead of after. For example, the syntax |
62 |
| - ``` |
63 |
| - """ |
64 |
| - a\n b""" |
65 |
| - ``` |
66 |
| - used to yield the string " a\nb", since the single space before `b` set the indent level. |
67 |
| - Now the result is "a\n b", since the space before `b` is no longer considered to occur |
68 |
| - at the start of a line. The old behavior is considered a bug ([#35001]). |
69 |
| - |
70 |
| -* The line number of function definitions is now added by the parser as an |
71 |
| - additional `LineNumberNode` at the start of each function body ([#35138]). |
72 |
| - |
73 |
| -Command-line option changes |
74 |
| ---------------------------- |
75 |
| - |
76 |
| -* Deprecation warnings are no longer shown by default. i.e. if the `--depwarn=...` flag is |
77 |
| - not passed it defaults to `--depwarn=no`. The warnings are printed from tests run by |
78 |
| - `Pkg.test()`. ([#35362]). |
79 |
| - |
80 |
| -* Color now defaults to on when stdout and stderr are TTYs ([#34347]) |
81 |
| - |
82 |
| -Command-line option changes |
83 |
| ---------------------------- |
84 |
| - |
85 |
| - * `-t N`, `--threads N` starts Julia with `N` threads. This option takes precedence over |
86 |
| - `JULIA_NUM_THREADS`. The specified number of threads also propagates to worker |
87 |
| - processes spawned using the `-p`/`--procs` or `--machine-file` command line arguments. |
88 |
| - In order to set number of threads for worker processes spawned with `addprocs` use the |
89 |
| - `exeflags` keyword argument, e.g. `` addprocs(...; exeflags=`--threads 4`) `` ([#35108]). |
90 |
| - |
91 |
| -Multi-threading changes |
92 |
| ------------------------ |
93 |
| - |
94 |
| - |
95 |
| -Build system changes |
96 |
| --------------------- |
97 |
| - |
98 |
| - |
99 |
| -New library functions |
100 |
| ---------------------- |
101 |
| -* The `@ccall` macro has been added added to Base. It is a near drop-in replacement for `ccall` with more Julia-like syntax. It also wraps the new `foreigncall` API for varargs of different types, though it lacks the capability to specify an LLVM calling convention. ([#32748]) |
102 |
| -* New functions `mergewith` and `mergewith!` supersede `merge` and `merge!` with `combine` |
103 |
| - argument. They don't have the restriction for `combine` to be a `Function` and also |
104 |
| - provide one-argument method that returns a closure. The old methods of `merge` and |
105 |
| - `merge!` are still available for backward compatibility ([#34296]). |
106 |
| -* The new `isdisjoint` function indicates whether two collections are disjoint ([#34427]). |
107 |
| -* Add function `ismutable` and deprecate `isimmutable` to check whether something is mutable.([#34652]) |
108 |
| -* `include` now accepts an optional `mapexpr` first argument to transform the parsed |
109 |
| - expressions before they are evaluated ([#34595]). |
110 |
| -* New function `bitreverse` for reversing the order of bits in a fixed-width integer ([#34791]). |
111 |
| -* New function `bitrotate(x, k)` for rotating the bits in a fixed-width integer ([#33937]). |
112 |
| -* One argument methods `startswith(x)` and `endswith(x)` have been added, returning partially-applied versions of the functions, similar to existing methods like `isequal(x)` ([#33193]). |
113 |
| - |
114 |
| -New library features |
115 |
| --------------------- |
116 |
| -* Function composition now works also on one argument `∘(f) = f` (#34251) |
117 |
| -* `@NamedTuple{key1::Type1, ...}` macro for convenient `NamedTuple` declarations ([#34548]). |
118 |
| - |
119 |
| -* `isapprox` (or `≈`) now has a one-argument "curried" method `isapprox(x)` which returns a function, like `isequal` (or `==`) ([#32305]). |
120 |
| -* `Ref{NTuple{N,T}}` can be passed to `Ptr{T}`/`Ref{T}` `ccall` signatures ([#34199]) |
121 |
| -* `x::Signed % Unsigned` and `x::Unsigned % Signed` are supported for integer bitstypes. |
122 |
| -* `signed(unsigned_type)` is supported for integer bitstypes, `unsigned(signed_type)` has been supported. |
123 |
| -* `accumulate`, `cumsum`, and `cumprod` now support `Tuple` ([#34654]) and arbitrary iterators ([#34656]). |
124 |
| -* In `splice!` with no replacement, values to be removed can now be specified with an |
125 |
| - arbitrary iterable (instead of a `UnitRange`) ([#34524]). |
126 |
| - |
127 |
| -Standard library changes |
128 |
| ------------------------- |
129 |
| -* A 1-d `Zip` iterator (where `Base.IteratorSize` is `Base.HasShape{1}()`) with defined length of `n` has now also size of `(n,)` (instead of throwing an error with truncated iterators) ([#29927]). |
130 |
| -* The `@timed` macro now returns a `NamedTuple` ([#34149]) |
131 |
| -* New `supertypes(T)` function returns a tuple of all supertypes of `T` ([#34419]). |
132 |
| -* Sorting-related functions such as `sort` that take the keyword arguments `lt`, `rev`, `order` |
133 |
| - and `by` now do not discard `order` if `by` or `lt` are passed. In the former case, the |
134 |
| - order from `order` is used to compare the values of `by(element)`. In the latter case, |
135 |
| - any order different from `Forward` or `Reverse` will raise an error about the |
136 |
| - ambiguity. |
137 |
| -* `close` on a file (`IOStream`) can now throw an exception if an error occurs when trying |
138 |
| - to flush buffered data to disk ([#35303]). |
139 |
| - |
140 |
| -#### LinearAlgebra |
141 |
| -* The BLAS submodule now supports the level-2 BLAS subroutine `hpmv!` ([#34211]). |
142 |
| -* `normalize` now supports multidimensional arrays ([#34239]) |
143 |
| -* `lq` factorizations can now be used to compute the minimum-norm solution to under-determined systems ([#34350]). |
144 |
| -* The BLAS submodule now supports the level-2 BLAS subroutine `spmv!` ([#34320]). |
145 |
| -* The BLAS submodule now supports the level-1 BLAS subroutine `rot!` ([#35124]). |
146 |
| -* New generic `rotate!(x, y, c, s)` and `reflect!(x, y, c, s)` functions ([#35124]). |
147 |
| - |
148 |
| -#### Markdown |
149 |
| - |
150 |
| - |
151 |
| -#### Random |
152 |
| - |
153 |
| - |
154 |
| -#### REPL |
155 |
| - |
156 |
| - |
157 |
| -#### SparseArrays |
158 |
| -* `lu!` accepts `UmfpackLU` as an argument to make use of its symbolic factorization. |
159 |
| -* The `trim` keyword argument for the functions `fkeep!`, `tril!`, `triu!`, |
160 |
| - `droptol!`,`dropzeros!` and `dropzeros` has been removed in favour of always |
161 |
| - trimming. Calling these with `trim=false` could result in invalid sparse |
162 |
| - arrays. |
163 |
| - |
164 |
| -#### Dates |
165 |
| -* The `eps` function now accepts `TimeType` types ([#31487]). |
166 |
| - |
167 |
| -#### Statistics |
168 |
| - |
169 |
| - |
170 |
| -#### Sockets |
171 |
| - |
172 |
| -#### Distributed |
173 |
| -* `launch_on_machine` now supports and parses ipv6 square-bracket notation ([#34430]) |
174 |
| - |
175 |
| -Deprecated or removed |
176 |
| ---------------------- |
177 |
| - |
178 |
| -External dependencies |
179 |
| ---------------------- |
180 |
| - |
181 |
| -Tooling Improvements |
182 |
| ---------------------- |
183 |
| - |
184 |
| - |
185 |
| - |
186 |
| -<!--- generated by NEWS-update.jl: --> |
| 1 | +Julia v1.5 Release Notes |
| 2 | +======================== |
| 3 | + |
| 4 | +New language features |
| 5 | +--------------------- |
| 6 | +* Macro calls `@foo {...}` can now also be written `@foo{...}` (without the space) ([#34498]). |
| 7 | +* `⨟` is now parsed as a binary operator with times precedence. It can be entered in the REPL |
| 8 | + with `\bbsemi` followed by <kbd>TAB</kbd> ([#34722]). |
| 9 | + |
| 10 | +* `±` and `∓` are now unary operators as well, like `+` or `-`. Attention has to be paid in |
| 11 | + macros and matrix constructors, which are whitespace sensitive, because expressions like |
| 12 | + `[a ±b]` now get parsed as `[a ±(b)]` instead of `[±(a, b)]`. ([#34200]) |
| 13 | + |
| 14 | +* Passing an identifier `x` by itself as a keyword argument or named tuple element |
| 15 | + is equivalent to `x=x`, implicitly using the name of the variable as the keyword |
| 16 | + or named tuple field name. |
| 17 | + Similarly, passing an `a.b` expression uses `b` as the keyword or field name ([#29333]). |
| 18 | + |
| 19 | +* Packages can now provide custom hints to help users resolve errors by using the |
| 20 | + `register_error_hint` function. Packages that define custom exception types |
| 21 | + can support hints by calling `show_error_hints` from their `showerror` method. ([#35094]) |
| 22 | + |
| 23 | +* Support for Unicode 13.0.0 (via utf8proc 2.5) ([#35282]). |
| 24 | + |
| 25 | +* The compiler optimization level can now be set per-module using the experimental macro |
| 26 | + `Base.Experimental.@optlevel n`. For code that is not performance-critical, setting |
| 27 | + this to 0 or 1 can provide significant latency improvements ([#34896]). |
| 28 | + |
| 29 | +Language changes |
| 30 | +---------------- |
| 31 | + |
| 32 | +* The interactive REPL now uses "soft scope" for top-level expressions: an assignment inside a |
| 33 | + scope block such as a `for` loop automatically assigns to a global variable if one has been |
| 34 | + defined already. This matches the behavior of Julia versions 0.6 and prior, as well as |
| 35 | + [IJulia](https://github.com/JuliaLang/IJulia.jl). |
| 36 | + Note that this only affects expressions interactively typed or pasted directly into the |
| 37 | + default REPL ([#28789], [#33864]). |
| 38 | + |
| 39 | +* Outside of the REPL (e.g. in a file), assigning to a variable within a top-level scope |
| 40 | + block is considered ambiguous if a global variable with the same name exists. |
| 41 | + A warning is given if that happens, to alert you that the code will work differently |
| 42 | + than in the REPL. |
| 43 | + A new command line option `--warn-scope` controls this warning ([#33864]). |
| 44 | + |
| 45 | +* Converting arbitrary tuples to `NTuple`, e.g. `convert(NTuple, (1, ""))` now gives an error, |
| 46 | + where it used to be incorrectly allowed. This is because `NTuple` refers only to homogeneous |
| 47 | + tuples (this meaning has not changed) ([#34272]). |
| 48 | + |
| 49 | +* In docstrings, a level-1 markdown header "Extended help" is now |
| 50 | + interpreted as a marker dividing "brief help" from "extended help." |
| 51 | + The REPL help mode only shows the brief help (the content before the |
| 52 | + "Extended help" header) by default; prepend the expression with '?' |
| 53 | + (in addition to the one that enters the help mode) to see the full |
| 54 | + docstring. ([#25930]) |
| 55 | + |
| 56 | +* The syntax `(;)` (which was deprecated in v1.4) now creates an empty named tuple ([#30115]). |
| 57 | + |
| 58 | +* `@inline` macro can now be applied to short-form anonymous functions ([#34953]). |
| 59 | + |
| 60 | +* In triple-quoted string literals, whitespace stripping is now done before processing |
| 61 | + escape sequences instead of after. For example, the syntax |
| 62 | + ``` |
| 63 | + """ |
| 64 | + a\n b""" |
| 65 | + ``` |
| 66 | + used to yield the string " a\nb", since the single space before `b` set the indent level. |
| 67 | + Now the result is "a\n b", since the space before `b` is no longer considered to occur |
| 68 | + at the start of a line. The old behavior is considered a bug ([#35001]). |
| 69 | + |
| 70 | +* The line number of function definitions is now added by the parser as an |
| 71 | + additional `LineNumberNode` at the start of each function body ([#35138]). |
| 72 | + |
| 73 | +Command-line option changes |
| 74 | +--------------------------- |
| 75 | + |
| 76 | +* Deprecation warnings are no longer shown by default. i.e. if the `--depwarn=...` flag is |
| 77 | + not passed it defaults to `--depwarn=no`. The warnings are printed from tests run by |
| 78 | + `Pkg.test()`. ([#35362]). |
| 79 | + |
| 80 | +* Color now defaults to on when stdout and stderr are TTYs ([#34347]) |
| 81 | + |
| 82 | +Command-line option changes |
| 83 | +--------------------------- |
| 84 | + |
| 85 | + * `-t N`, `--threads N` starts Julia with `N` threads. This option takes precedence over |
| 86 | + `JULIA_NUM_THREADS`. The specified number of threads also propagates to worker |
| 87 | + processes spawned using the `-p`/`--procs` or `--machine-file` command line arguments. |
| 88 | + In order to set number of threads for worker processes spawned with `addprocs` use the |
| 89 | + `exeflags` keyword argument, e.g. `` addprocs(...; exeflags=`--threads 4`) `` ([#35108]). |
| 90 | + |
| 91 | +Multi-threading changes |
| 92 | +----------------------- |
| 93 | + |
| 94 | + |
| 95 | +Build system changes |
| 96 | +-------------------- |
| 97 | + |
| 98 | + |
| 99 | +New library functions |
| 100 | +--------------------- |
| 101 | +* The `@ccall` macro has been added added to Base. It is a near drop-in replacement for `ccall` with more Julia-like syntax. It also wraps the new `foreigncall` API for varargs of different types, though it lacks the capability to specify an LLVM calling convention. ([#32748]) |
| 102 | +* New functions `mergewith` and `mergewith!` supersede `merge` and `merge!` with `combine` |
| 103 | + argument. They don't have the restriction for `combine` to be a `Function` and also |
| 104 | + provide one-argument method that returns a closure. The old methods of `merge` and |
| 105 | + `merge!` are still available for backward compatibility ([#34296]). |
| 106 | +* The new `isdisjoint` function indicates whether two collections are disjoint ([#34427]). |
| 107 | +* Add function `ismutable` and deprecate `isimmutable` to check whether something is mutable.([#34652]) |
| 108 | +* `include` now accepts an optional `mapexpr` first argument to transform the parsed |
| 109 | + expressions before they are evaluated ([#34595]). |
| 110 | +* New function `bitreverse` for reversing the order of bits in a fixed-width integer ([#34791]). |
| 111 | +* New function `bitrotate(x, k)` for rotating the bits in a fixed-width integer ([#33937]). |
| 112 | +* One argument methods `startswith(x)` and `endswith(x)` have been added, returning partially-applied versions of the functions, similar to existing methods like `isequal(x)` ([#33193]). |
| 113 | + |
| 114 | +New library features |
| 115 | +-------------------- |
| 116 | +* Function composition now works also on one argument `∘(f) = f` (#34251) |
| 117 | +* `@NamedTuple{key1::Type1, ...}` macro for convenient `NamedTuple` declarations ([#34548]). |
| 118 | + |
| 119 | +* `isapprox` (or `≈`) now has a one-argument "curried" method `isapprox(x)` which returns a function, like `isequal` (or `==`) ([#32305]). |
| 120 | +* `Ref{NTuple{N,T}}` can be passed to `Ptr{T}`/`Ref{T}` `ccall` signatures ([#34199]) |
| 121 | +* `x::Signed % Unsigned` and `x::Unsigned % Signed` are supported for integer bitstypes. |
| 122 | +* `signed(unsigned_type)` is supported for integer bitstypes, `unsigned(signed_type)` has been supported. |
| 123 | +* `accumulate`, `cumsum`, and `cumprod` now support `Tuple` ([#34654]) and arbitrary iterators ([#34656]). |
| 124 | +* In `splice!` with no replacement, values to be removed can now be specified with an |
| 125 | + arbitrary iterable (instead of a `UnitRange`) ([#34524]). |
| 126 | + |
| 127 | +Standard library changes |
| 128 | +------------------------ |
| 129 | +* A 1-d `Zip` iterator (where `Base.IteratorSize` is `Base.HasShape{1}()`) with defined length of `n` has now also size of `(n,)` (instead of throwing an error with truncated iterators) ([#29927]). |
| 130 | +* The `@timed` macro now returns a `NamedTuple` ([#34149]) |
| 131 | +* New `supertypes(T)` function returns a tuple of all supertypes of `T` ([#34419]). |
| 132 | +* Sorting-related functions such as `sort` that take the keyword arguments `lt`, `rev`, `order` |
| 133 | + and `by` now do not discard `order` if `by` or `lt` are passed. In the former case, the |
| 134 | + order from `order` is used to compare the values of `by(element)`. In the latter case, |
| 135 | + any order different from `Forward` or `Reverse` will raise an error about the |
| 136 | + ambiguity. |
| 137 | +* `close` on a file (`IOStream`) can now throw an exception if an error occurs when trying |
| 138 | + to flush buffered data to disk ([#35303]). |
| 139 | + |
| 140 | +#### LinearAlgebra |
| 141 | +* The BLAS submodule now supports the level-2 BLAS subroutine `hpmv!` ([#34211]). |
| 142 | +* `normalize` now supports multidimensional arrays ([#34239]) |
| 143 | +* `lq` factorizations can now be used to compute the minimum-norm solution to under-determined systems ([#34350]). |
| 144 | +* The BLAS submodule now supports the level-2 BLAS subroutine `spmv!` ([#34320]). |
| 145 | +* The BLAS submodule now supports the level-1 BLAS subroutine `rot!` ([#35124]). |
| 146 | +* New generic `rotate!(x, y, c, s)` and `reflect!(x, y, c, s)` functions ([#35124]). |
| 147 | + |
| 148 | +#### Markdown |
| 149 | + |
| 150 | + |
| 151 | +#### Random |
| 152 | + |
| 153 | + |
| 154 | +#### REPL |
| 155 | + |
| 156 | + |
| 157 | +#### SparseArrays |
| 158 | +* `lu!` accepts `UmfpackLU` as an argument to make use of its symbolic factorization. |
| 159 | +* The `trim` keyword argument for the functions `fkeep!`, `tril!`, `triu!`, |
| 160 | + `droptol!`,`dropzeros!` and `dropzeros` has been removed in favour of always |
| 161 | + trimming. Calling these with `trim=false` could result in invalid sparse |
| 162 | + arrays. |
| 163 | + |
| 164 | +#### Dates |
| 165 | +* The `eps` function now accepts `TimeType` types ([#31487]). |
| 166 | + |
| 167 | +#### Statistics |
| 168 | + |
| 169 | + |
| 170 | +#### Sockets |
| 171 | + |
| 172 | +#### Distributed |
| 173 | +* `launch_on_machine` now supports and parses ipv6 square-bracket notation ([#34430]) |
| 174 | + |
| 175 | +Deprecated or removed |
| 176 | +--------------------- |
| 177 | + |
| 178 | +External dependencies |
| 179 | +--------------------- |
| 180 | + |
| 181 | +Tooling Improvements |
| 182 | +--------------------- |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | +<!--- generated by NEWS-update.jl: --> |
0 commit comments