Skip to content

Commit d94e2b5

Browse files
authored
Merge branch 'master' into jq/inlineunionfields
2 parents cf4796c + 9725fb4 commit d94e2b5

File tree

233 files changed

+3220
-3181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+3220
-3181
lines changed

HISTORY.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,179 @@
1+
Julia v1.3 Release Notes
2+
========================
3+
4+
New language features
5+
---------------------
6+
7+
* Support for Unicode 12.1.0 ([#32002]).
8+
* Methods can now be added to an abstract type ([#31916]).
9+
* Support for unicode bold digits and double-struck digits 0 through 9 as valid identifiers ([#32838]).
10+
* Added the syntax `var"#str#"` for printing and parsing non-standard variable names ([#32408]).
11+
12+
Language changes
13+
----------------
14+
15+
16+
Multi-threading changes
17+
-----------------------
18+
19+
* New experimental `Threads.@spawn` macro that runs a task on any available thread ([#32600]).
20+
* All system-level I/O operations (e.g. files and sockets) are now thread-safe.
21+
This does not include subtypes of `IO` that are entirely in-memory, such as `IOBuffer`,
22+
although it specifically does include `BufferStream`.
23+
([#32309], [#32174], [#31981], [#32421]).
24+
* The global random number generator (`GLOBAL_RNG`) is now thread-safe (and thread-local) ([#32407]).
25+
* New `Channel(f::Function, spawn=true)` keyword argument to schedule the created Task on
26+
any available thread, matching the behavior of `Threads.@spawn` ([#32872]).
27+
* Simplified the `Channel` constructor, which is now easier to read and more idiomatic julia.
28+
Use of the keyword arguments `csize` and `ctype` is now discouraged ([#30855], [#32818]).
29+
30+
Build system changes
31+
--------------------
32+
33+
34+
New library functions
35+
---------------------
36+
37+
* `findfirst`, `findlast`, `findnext` and `findprev` now accept a character as first argument
38+
to search for that character in a string passed as the second argument ([#31664]).
39+
* New `findall(pattern, string)` method where `pattern` is a string or regex ([#31834]).
40+
* `count(pattern, string)` gives the number of things `findall` would match ([#32849]).
41+
* `istaskfailed` is now documented and exported, like its siblings `istaskdone` and `istaskstarted` ([#32300]).
42+
* `RefArray` and `RefValue` objects now accept index `CartesianIndex()` in `getindex` and `setindex!` ([#32653])
43+
* Added `sincosd(x)` to simultaneously compute the sine and cosine of `x`, where `x` is in degrees ([#30134]).
44+
* The function `nonmissingtype`, which removes `Missing` from type unions, is now exported ([#31562]).
45+
46+
Standard library changes
47+
------------------------
48+
49+
* `Pkg` can now download and install binary artifacts through the `Pkg.Artifacts`
50+
submodule and supporting functions. ([#32918])
51+
* When `wait` (or `@sync`, or `fetch`) is called on a failing `Task`, the exception is propagated as a
52+
`TaskFailedException` wrapping the task.
53+
This makes it possible to see the location of the original failure inside the task (as well as the
54+
location of the `wait` call, as before) ([#32814]).
55+
* `Regex` can now be multiplied (`*`) and exponentiated (`^`), like strings ([#23422]).
56+
* `Cmd` interpolation (``` `$(x::Cmd) a b c` ``` where) now propagates `x`'s process flags
57+
(environment, flags, working directory, etc) if `x` is the first interpolant and errors
58+
otherwise ([#24353]).
59+
* Zero-dimensional arrays are now consistently preserved in the return values of mathematical
60+
functions that operate on the array(s) as a whole (and are not explicitly broadcasted across their elements).
61+
Previously, the functions `+`, `-`, `*`, `/`, `conj`, `real` and `imag` returned the unwrapped element
62+
when operating over zero-dimensional arrays ([#32122]).
63+
* `IPAddr` subtypes now behave like scalars when used in broadcasting ([#32133]).
64+
* `Pair` is now treated as a scalar for broadcasting ([#32209]).
65+
* `clamp` can now handle missing values ([#31066]).
66+
* `empty` now accepts a `NamedTuple` ([#32534]).
67+
* `mod` now accepts a unit range as the second argument to easily perform offset modular arithmetic to ensure the result is inside the range ([#32628]).
68+
* `nothing` can now be `print`ed, and interpolated into strings etc. as the string `"nothing"`. It is still not permitted to be interpolated into Cmds (i.e. ``echo `$(nothing)` `` will still error without running anything.) ([#32148])
69+
* When `open` is called with a function, command, and keyword argument (e.g. ```open(`ls`, read=true) do f ...```)
70+
it now correctly throws a `ProcessFailedException` like other similar calls ([#32193]).
71+
* `mktemp` and `mktempdir` now try, by default, to remove temporary paths they create before the process exits ([#32851]).
72+
* Added argument `keep` to `unescape_string` ([#27125]).
73+
74+
#### Libdl
75+
76+
* `dlopen()` can now be invoked in `do`-block syntax, similar to `open()`.
77+
78+
#### LinearAlgebra
79+
80+
* The BLAS submodule no longer exports `dot`, which conflicts with that in LinearAlgebra ([#31838]).
81+
* `diagm` and `spdiagm` now accept optional `m,n` initial arguments to specify a size ([#31654]).
82+
* `Hessenberg` factorizations `H` now support efficient shifted solves `(H+µI) \ b` and determinants, and use a specialized tridiagonal factorization for Hermitian matrices. There is also a new `UpperHessenberg` matrix type ([#31853]).
83+
* Added keyword argument `alg` to `svd` and `svd!` that allows one to switch between different SVD algorithms ([#31057]).
84+
* Five-argument `mul!(C, A, B, α, β)` now implements inplace multiplication fused with addition _C = A B α + C β_ ([#23919]).
85+
86+
#### SparseArrays
87+
88+
* `SparseMatrixCSC(m,n,colptr,rowval,nzval)` perform consistency checks for arguments:
89+
`colptr` must be properly populated and lengths of `colptr`, `rowval`, and `nzval`
90+
must be compatible with `m`, `n`, and `eltype(colptr)`.
91+
* `sparse(I, J, V, m, n)` verifies lengths of `I`, `J`, `V` are equal and compatible with
92+
`eltype(I)` and `m`, `n`.
93+
94+
#### Dates
95+
96+
* `DateTime` and `Time` formatting/parsing now supports 12-hour clocks with AM/PM via `I` and `p` codes, similar to `strftime` ([#32308]).
97+
* Fixed `repr` such that it displays `Time` as it would be entered in Julia ([#32103]).
98+
99+
#### Statistics
100+
101+
* `mean` now accepts both a function argument and a `dims` keyword ([#31576]).
102+
103+
#### Sockets
104+
105+
* `Sockets.recvfrom` now returns both host and port as an InetAddr ([#32729]).
106+
* Added `InetAddr` constructor from `AbstractString`, representing IP address, and `Integer`,
107+
representing port number ([#31459]).
108+
109+
#### Miscellaneous
110+
111+
* `foldr` and `mapfoldr` now work on any iterator that supports `Iterators.reverse`, not just arrays ([#31781]).
112+
113+
Deprecated or removed
114+
---------------------
115+
116+
* `@spawn expr` from the `Distributed` standard library should be replaced with `@spawnat :any expr` ([#32600]).
117+
* `Threads.Mutex` and `Threads.RecursiveSpinLock` have been removed; use `ReentrantLock` (preferred) or
118+
`Threads.SpinLock` instead ([#32875]).
119+
120+
External dependencies
121+
---------------------
122+
123+
Tooling Improvements
124+
---------------------
125+
126+
* The `ClangSA.jl` static analysis package has been imported, which makes use of
127+
the clang static analyzer to validate GC invariants in Julia's C code. The analysis
128+
may be run using `make -C src analyzegc`.
129+
130+
<!--- generated by NEWS-update.jl: -->
131+
[#23422]: https://github.com/JuliaLang/julia/issues/23422
132+
[#23919]: https://github.com/JuliaLang/julia/issues/23919
133+
[#24353]: https://github.com/JuliaLang/julia/issues/24353
134+
[#27125]: https://github.com/JuliaLang/julia/issues/27125
135+
[#30134]: https://github.com/JuliaLang/julia/issues/30134
136+
[#30855]: https://github.com/JuliaLang/julia/issues/30855
137+
[#31057]: https://github.com/JuliaLang/julia/issues/31057
138+
[#31066]: https://github.com/JuliaLang/julia/issues/31066
139+
[#31459]: https://github.com/JuliaLang/julia/issues/31459
140+
[#31562]: https://github.com/JuliaLang/julia/issues/31562
141+
[#31576]: https://github.com/JuliaLang/julia/issues/31576
142+
[#31654]: https://github.com/JuliaLang/julia/issues/31654
143+
[#31664]: https://github.com/JuliaLang/julia/issues/31664
144+
[#31781]: https://github.com/JuliaLang/julia/issues/31781
145+
[#31834]: https://github.com/JuliaLang/julia/issues/31834
146+
[#31838]: https://github.com/JuliaLang/julia/issues/31838
147+
[#31853]: https://github.com/JuliaLang/julia/issues/31853
148+
[#31916]: https://github.com/JuliaLang/julia/issues/31916
149+
[#31981]: https://github.com/JuliaLang/julia/issues/31981
150+
[#32002]: https://github.com/JuliaLang/julia/issues/32002
151+
[#32103]: https://github.com/JuliaLang/julia/issues/32103
152+
[#32122]: https://github.com/JuliaLang/julia/issues/32122
153+
[#32133]: https://github.com/JuliaLang/julia/issues/32133
154+
[#32148]: https://github.com/JuliaLang/julia/issues/32148
155+
[#32174]: https://github.com/JuliaLang/julia/issues/32174
156+
[#32193]: https://github.com/JuliaLang/julia/issues/32193
157+
[#32209]: https://github.com/JuliaLang/julia/issues/32209
158+
[#32300]: https://github.com/JuliaLang/julia/issues/32300
159+
[#32308]: https://github.com/JuliaLang/julia/issues/32308
160+
[#32309]: https://github.com/JuliaLang/julia/issues/32309
161+
[#32407]: https://github.com/JuliaLang/julia/issues/32407
162+
[#32408]: https://github.com/JuliaLang/julia/issues/32408
163+
[#32421]: https://github.com/JuliaLang/julia/issues/32421
164+
[#32534]: https://github.com/JuliaLang/julia/issues/32534
165+
[#32600]: https://github.com/JuliaLang/julia/issues/32600
166+
[#32628]: https://github.com/JuliaLang/julia/issues/32628
167+
[#32653]: https://github.com/JuliaLang/julia/issues/32653
168+
[#32729]: https://github.com/JuliaLang/julia/issues/32729
169+
[#32814]: https://github.com/JuliaLang/julia/issues/32814
170+
[#32818]: https://github.com/JuliaLang/julia/issues/32818
171+
[#32838]: https://github.com/JuliaLang/julia/issues/32838
172+
[#32849]: https://github.com/JuliaLang/julia/issues/32849
173+
[#32851]: https://github.com/JuliaLang/julia/issues/32851
174+
[#32872]: https://github.com/JuliaLang/julia/issues/32872
175+
[#32875]: https://github.com/JuliaLang/julia/issues/32875
176+
1177
Julia v1.2 Release Notes
2178
========================
3179

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ $(build_depsbindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(buil
147147
@$(call PRINT_CC, $(HOSTCC) -o $(build_depsbindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c)
148148

149149
julia-base-cache: julia-sysimg-$(JULIA_BUILD_MODE) | $(DIRS) $(build_datarootdir)/julia
150-
@$(call spawn,JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
150+
@JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) $(call spawn, $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
151151
$(call cygpath_w,$(build_datarootdir)/julia/base.cache))
152152

153153
# public libraries, that are installed in $(prefix)/lib

NEWS.md

Lines changed: 5 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
Julia v1.3 Release Notes
1+
Julia v1.4 Release Notes
22
========================
33

44
New language features
55
---------------------
66

7-
* Support for Unicode 12.1.0 ([#32002]).
8-
* Methods can now be added to an abstract type ([#31916]).
9-
* Support for unicode bold-digits and double-struck digits 0 through 9 as valid identifiers ([#32838]).
107
* Structs with all isbits and isbitsunion fields are now stored inline in arrays ([#32448]).
118

129
Language changes
@@ -16,14 +13,6 @@ Language changes
1613
Multi-threading changes
1714
-----------------------
1815

19-
* All system-level I/O operations (e.g. files and sockets) are now thread-safe.
20-
This does not include subtypes of `IO` that are entirely in-memory, such as `IOBuffer`,
21-
although it specifically does include `BufferStream`.
22-
([#32309], [#32174], [#31981], [#32421]).
23-
* The global random number generator (`GLOBAL_RNG`) is now thread-safe (and thread-local) ([#32407]).
24-
* New experimental `Threads.@spawn` macro that runs a task on any available thread ([#32600]).
25-
* Simplified the `Channel` constructor, which is now easier to read and more idiomatic julia.
26-
The old constructor (which used kwargs) is still available, but use is discouraged ([#30855], [#32818]).
2716

2817
Build system changes
2918
--------------------
@@ -32,117 +21,42 @@ Build system changes
3221
New library functions
3322
---------------------
3423

35-
* `findfirst`, `findlast`, `findnext` and `findprev` now accept a character as first argument
36-
to search for that character in a string passed as the second argument ([#31664]).
37-
* New `findall(pattern, string)` method where `pattern` is a string or regex ([#31834]).
38-
* `count(pattern, string)` gives the number of things `findall` would match ([#32849]).
39-
* `istaskfailed` is now documented and exported, like its siblings `istaskdone` and `istaskstarted` ([#32300]).
40-
* `RefArray` and `RefValue` objects now accept index `CartesianIndex()` in `getindex` and `setindex!` ([#32653])
41-
* Added `sincosd(x)` to simultaneously compute the sine and cosine of `x`, where `x` is in degrees ([#30134]).
24+
* The `splitpath` function now accepts any `AbstractString` whereas previously it only accepted paths of type `String` ([#33012]).
25+
4226

4327
Standard library changes
4428
------------------------
4529

46-
* When `wait` (or `@sync`, or `fetch`) is called on a failing `Task`, the exception is propagated as a
47-
`TaskFailedException` wrapping the task.
48-
This makes it possible to see the location of the original failure inside the task (as well as the
49-
location of the `wait` call, as before) ([#32814]).
50-
* `Regex` can now be multiplied (`*`) and exponentiated (`^`), like strings ([#23422]).
51-
* `Cmd` interpolation (``` `$(x::Cmd) a b c` ``` where) now propagates `x`'s process flags
52-
(environment, flags, working directory, etc) if `x` is the first interpolant and errors
53-
otherwise ([#24353]).
54-
* Zero-dimensional arrays are now consistently preserved in the return values of mathematical
55-
functions that operate on the array(s) as a whole (and are not explicitly broadcasted across their elements).
56-
Previously, the functions `+`, `-`, `*`, `/`, `conj`, `real` and `imag` returned the unwrapped element
57-
when operating over zero-dimensional arrays ([#32122]).
58-
* `IPAddr` subtypes now behave like scalars when used in broadcasting ([#32133]).
59-
* `Pair` is now treated as a scalar for broadcasting ([#32209]).
60-
* `clamp` can now handle missing values ([#31066]).
61-
* `empty` now accepts a `NamedTuple` ([#32534]).
62-
* `mod` now accepts a unit range as the second argument to easily perform offset modular arithmetic to ensure the result is inside the range ([#32628]).
63-
* `Sockets.recvfrom` now returns both host and port as an InetAddr ([#32729]).
64-
* `nothing` can now be `print`ed, and interpolated into strings etc. as the string `"nothing"`. It is still not permitted to be interpolated into Cmds (i.e. ``echo `$(nothing)` `` will still error without running anything.) ([#32148])
65-
* When `open` is called with a function, command, and keyword argument (e.g. ```open(`ls`, read=true) do f ...```)
66-
it now correctly throws a `ProcessFailedException` like other similar calls ([#32193]).
67-
* `mktemp` and `mktempdir` now try, by default, to remove temporary paths they create before the process exits ([#32851]).
6830

6931
#### Libdl
7032

71-
* `dlopen()` can now be invoked in `do`-block syntax, similar to `open()`.
7233

7334
#### LinearAlgebra
7435

75-
* The BLAS submodule no longer exports `dot`, which conflicts with that in LinearAlgebra ([#31838]).
76-
* `diagm` and `spdiagm` now accept optional `m,n` initial arguments to specify a size ([#31654]).
77-
* `Hessenberg` factorizations `H` now support efficient shifted solves `(H+µI) \ b` and determinants, and use a specialized tridiagonal factorization for Hermitian matrices. There is also a new `UpperHessenberg` matrix type ([#31853]).
78-
* Five-argument `mul!(C, A, B, α, β)` now implements inplace multiplication fused with addition _C = A B α + C β_ ([#23919]).
36+
* `qr` and `qr!` functions support `blocksize` keyword argument ([#33053]).
37+
7938

8039
#### SparseArrays
8140

82-
* `SparseMatrixCSC(m,n,colptr,rowval,nzval)` perform consistency checks for arguments:
83-
`colptr` must be properly populated and lengths of `colptr`, `rowval`, and `nzval`
84-
must be compatible with `m`, `n`, and `eltype(colptr)`.
85-
* `sparse(I, J, V, m, n)` verifies lengths of `I`, `J`, `V` are equal and compatible with
86-
`eltype(I)` and `m`, `n`.
8741

8842
#### Dates
8943

90-
* `DateTime` and `Time` formatting/parsing now supports 12-hour clocks with AM/PM via `I` and `p` codes, similar to `strftime` ([#32308]).
91-
* Fixed `repr` such that it displays `Time` as it would be entered in Julia ([#32103]).
9244

9345
#### Statistics
9446

95-
* `mean` now accepts both a function argument and a `dims` keyword ([#31576]).
9647

9748
#### Sockets
9849

99-
* Added `InetAddr` constructor from `AbstractString`, representing IP address, and `Integer`,
100-
representing port number ([#31459]).
101-
102-
#### Miscellaneous
103-
104-
* `foldr` and `mapfoldr` now work on any iterator that supports `Iterators.reverse`, not just arrays ([#31781]).
10550

10651
Deprecated or removed
10752
---------------------
10853

109-
* `@spawn expr` from the `Distributed` standard library should be replaced with `@spawnat :any expr` ([#32600]).
110-
* `Threads.Mutex` and `Threads.RecursiveSpinLock` have been removed; use `ReentrantLock` (preferred) or
111-
`Threads.SpinLock` instead ([#32875]).
11254

11355
External dependencies
11456
---------------------
11557

11658
Tooling Improvements
11759
---------------------
11860

119-
* The `ClangSA.jl` static analysis package has been imported, which makes use of
120-
the clang static analyzer to validate GC invariants in Julia's C code. The analysis
121-
may be run using `make -C src analyzegc`.
12261

12362
<!--- generated by NEWS-update.jl: -->
124-
[#23422]: https://github.com/JuliaLang/julia/issues/23422
125-
[#24353]: https://github.com/JuliaLang/julia/issues/24353
126-
[#31066]: https://github.com/JuliaLang/julia/issues/31066
127-
[#31459]: https://github.com/JuliaLang/julia/issues/31459
128-
[#31576]: https://github.com/JuliaLang/julia/issues/31576
129-
[#31654]: https://github.com/JuliaLang/julia/issues/31654
130-
[#31664]: https://github.com/JuliaLang/julia/issues/31664
131-
[#31781]: https://github.com/JuliaLang/julia/issues/31781
132-
[#31834]: https://github.com/JuliaLang/julia/issues/31834
133-
[#31838]: https://github.com/JuliaLang/julia/issues/31838
134-
[#31853]: https://github.com/JuliaLang/julia/issues/31853
135-
[#31916]: https://github.com/JuliaLang/julia/issues/31916
136-
[#31981]: https://github.com/JuliaLang/julia/issues/31981
137-
[#32002]: https://github.com/JuliaLang/julia/issues/32002
138-
[#32103]: https://github.com/JuliaLang/julia/issues/32103
139-
[#32122]: https://github.com/JuliaLang/julia/issues/32122
140-
[#32133]: https://github.com/JuliaLang/julia/issues/32133
141-
[#32174]: https://github.com/JuliaLang/julia/issues/32174
142-
[#32300]: https://github.com/JuliaLang/julia/issues/32300
143-
[#32308]: https://github.com/JuliaLang/julia/issues/32308
144-
[#32309]: https://github.com/JuliaLang/julia/issues/32309
145-
[#32407]: https://github.com/JuliaLang/julia/issues/32407
146-
[#32421]: https://github.com/JuliaLang/julia/issues/32421
147-
[#32534]: https://github.com/JuliaLang/julia/issues/32534
148-
[#32600]: https://github.com/JuliaLang/julia/issues/32600

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.0-alpha
1+
1.4.0-DEV

base/abstractdict.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,9 @@ end
579579

580580
function setindex!(d::IdDict{K,V}, @nospecialize(val), @nospecialize(key)) where {K, V}
581581
!isa(key, K) && throw(ArgumentError("$(limitrepr(key)) is not a valid key for type $K"))
582-
val = convert(V, val)
582+
if !(val isa V) # avoid a dynamic call
583+
val = convert(V, val)
584+
end
583585
if d.ndel >= ((3*length(d.ht))>>2)
584586
rehash!(d, max(length(d.ht)>>1, 32))
585587
d.ndel = 0

0 commit comments

Comments
 (0)