|
| 1 | +Julia v1.13 Release Notes |
| 2 | +======================== |
| 3 | + |
| 4 | +New language features |
| 5 | +--------------------- |
| 6 | + |
| 7 | + - New `Base.@acquire` macro for a non-closure version of `Base.acquire(f, s::Base.Semaphore)`, like `@lock`. ([#56845]) |
| 8 | + - New `nth` function to access the `n`-th element of a generic iterable. ([#56580]) |
| 9 | + - New `@__FUNCTION__` macro to refer to the innermost enclosing function. ([#58940]) |
| 10 | + - The character U+1F8B2 (RIGHTWARDS ARROW WITH LOWER HOOK), newly added by Unicode 16, |
| 11 | + is now a valid operator with arrow precedence, accessible as `\hookunderrightarrow` at the REPL. |
| 12 | + ([JuliaLang/JuliaSyntax.jl#525], [#57143]) |
| 13 | + - Support for Unicode 17 ([#59534]). |
| 14 | + |
| 15 | +Language changes |
| 16 | +---------------- |
| 17 | +* `mod(x::AbstractFloat, -Inf)` now returns `x` (as long as `x` is finite), this aligns with C standard and is considered a bug fix ([#47102]) |
| 18 | + |
| 19 | +* The `hash` algorithm and its values have changed for certain types, most notably AbstractString. Any `hash` specializations for equal types to those that changed, such as some third-party string packages, may need to be deleted. ([#57509], [#59691]) |
| 20 | + |
| 21 | +* The `hash(::AbstractString)` function is now a zero-copy / zero-cost function, based upon providing a correct implementation of the `codeunit` and `iterate` functions. Third-party string packages should migrate to the new algorithm by deleting their existing overrides of the `hash` function. ([#59691]) |
| 22 | + |
| 23 | +* Indexless `getindex` and `setindex!` (i.e. `A[]`) on `ReinterpretArray` now correctly throw a `BoundsError` when there is more than one element. ([#58814]) |
| 24 | + |
| 25 | +Command-line option changes |
| 26 | +--------------------------- |
| 27 | + |
| 28 | +* The option `--sysimage-native-code=no` has been deprecated. |
| 29 | +* The `JULIA_CPU_TARGET` environment variable now supports a `sysimage` keyword to match (or extend) the CPU target used to build the current system image ([#58970]). |
| 30 | +* The `--code-coverage=all` option now automatically throws away sysimage caches so that code coverage can be accurately measured on methods within the sysimage. It is thrown away after startup (and after startup.jl), before any user code is executed ([#59234]) |
| 31 | +* New `--trace-eval` command-line option to show expressions being evaluated during top-level evaluation. Supports `--trace-eval=loc` or just `--trace-eval` (show location only), `--trace-eval=full` (show full expressions), and `--trace-eval=no` (disable tracing). Also adds `Base.TRACE_EVAL` global control that takes priority over the command-line option and can be set to `:no`, `:loc`, `:full`, or `nothing` (to use command-line setting). ([#57137]) |
| 32 | +* Julia now automatically enables verbose debugging options (`--trace-eval` and `JULIA_TEST_VERBOSE`) when CI debugging has been triggered. i.e. via the "debug logging" UI toggle is enabled on github actions re-runs. Other platforms are supported too ([#59551]) |
| 33 | + |
| 34 | +Multi-threading changes |
| 35 | +----------------------- |
| 36 | + |
| 37 | +* A new `AbstractSpinLock` is defined with `SpinLock <: AbstractSpinLock` ([#55944]). |
| 38 | +* A new `PaddedSpinLock <: AbstractSpinLock` is defined. It has extra padding to avoid false sharing ([#55944]). |
| 39 | + |
| 40 | +New library functions |
| 41 | +--------------------- |
| 42 | + |
| 43 | +* `ispositive(::Real)` and `isnegative(::Real)` are provided for performance and convenience ([#53677]). |
| 44 | +* The `Test` module now supports the `JULIA_TEST_VERBOSE` environment variable. When set to `true`, |
| 45 | + it enables verbose testset entry/exit messages with timing information and sets the default `verbose=true` |
| 46 | + for `DefaultTestSet` to show detailed hierarchical test summaries ([#59295]). |
| 47 | +* Exporting function `fieldindex` to get the index of a struct's field ([#58119]). |
| 48 | +* `Base.donotdelete` is now public. It prevents deadcode elimination of its arguments ([#55774]). |
| 49 | +* `Sys.sysimage_target()` returns the CPU target string used to build the current system image ([#58970]). |
| 50 | +* `Iterators.findeach` is a lazy version of `findall` ([#54124]). |
| 51 | + |
| 52 | +New library features |
| 53 | +-------------------- |
| 54 | + |
| 55 | +* `fieldoffset` now also accepts the field name as a symbol as `fieldtype` already did ([#58100]). |
| 56 | +* `sort(keys(::Dict))` and `sort(values(::Dict))` now automatically collect, they previously threw ([#56978]). |
| 57 | +* `Base.AbstractOneTo` is added as a supertype of one-based axes, with `Base.OneTo` as its subtype ([#56902]). |
| 58 | +* `takestring!(::IOBuffer)` removes the content from the buffer, returning the content as a `String`. |
| 59 | +* `chopprefix` and `chopsuffix` can now also accept an `AbstractChar` as the prefix/suffix to remove. |
| 60 | +* The `macroexpand` (with default true) and the new `macroexpand!` (with default false) |
| 61 | + functions now support a `legacyscope` boolean keyword argument to control whether to run |
| 62 | + the legacy scope resolution pass over the result. The legacy scope resolution code has |
| 63 | + known design bugs and will be disabled by default in a future version. Users should |
| 64 | + migrate now by calling `legacyscope=false` or using `macroexpand!`. This may often require |
| 65 | + fixes to the code calling `macroexpand` with `Meta.unescape` and `Meta.reescape` or by |
| 66 | + updating tests to expect `hygienic-scope` or `escape` markers might appear in the result. |
| 67 | +* `Base.ScopedValues.LazyScopedValue{T}` is introduced for scoped values that compute their default using a |
| 68 | + `OncePerProcess{T}` callback, allowing for lazy initialization of the default value. `AbstractScopedValue` is |
| 69 | + now the abstract base type for both `ScopedValue` and `LazyScopedValue`. ([#59372]) |
| 70 | +* New `Base.active_manifest()` function to return the path of the active manifest, like `Base.active_project()`. |
| 71 | + Also can return the manifest that would be used for a given project file ([#57937]) |
| 72 | + |
| 73 | +Standard library changes |
| 74 | +------------------------ |
| 75 | + |
| 76 | +#### Random |
| 77 | + |
| 78 | +* `randperm!` and `randcycle!` now support non-`Array` `AbstractArray` inputs, assuming they are mutable and their indices are one-based ([#58596]). |
| 79 | + |
| 80 | +* `shuffle` now may take an argument of `NTuple` value ([#56906]). |
| 81 | + |
| 82 | +#### REPL |
| 83 | + |
| 84 | +* The Julia REPL now support bracketed paste on Windows which should significantly speed up pasting large code blocks into the REPL ([#59825]) |
| 85 | +* The REPL now provides syntax highlighting for input as you type. See the REPL docs for more info about customization. |
| 86 | +* The REPL now supports automatic insertion of closing brackets, parentheses, and quotes. See the REPL docs for more info about customization. |
| 87 | +* History searching has been rewritten to use a new interactive modal dialogue, using a fzf-like style. |
| 88 | +* The display of `AbstractChar`s in the main REPL mode now includes LaTeX input information like what is shown in help mode ([#58181]). |
| 89 | +* Display of repeated frames and cycles in stack traces has been improved by bracketing them in the trace and treating them consistently ([#55841]). |
| 90 | +* The superscript character U+107A5 𐞥 (MODIFIER LETTER SMALL Q), which was already supported in the language, can now be accessed at the REPL with `\^q` ([#59544]). |
| 91 | + |
| 92 | +#### Test |
| 93 | + |
| 94 | +* Test failures when using the `@test` macro now show evaluated arguments for all function calls ([#57825], [#57839]). |
| 95 | +* Transparent test sets (`@testset let`) now show context when tests error ([#58727]). |
| 96 | +* `@test_throws` now supports a three-argument form `@test_throws ExceptionType pattern expr` to test both exception type and message pattern in one call ([#59117]). |
| 97 | +* The testset stack was changed to use `ScopedValue` rather than task local storage ([#53462]). |
| 98 | + |
| 99 | +#### InteractiveUtils |
| 100 | + |
| 101 | +* Introspection utilities such as `@code_typed`, `@which` and `@edit` now accept type annotations as substitutes for values, recognizing forms such as `f(1, ::Float64, 3)` or even `sum(::Vector{T}; init = ::T) where {T<:Real}`. Type-annotated variables as in `f(val::Int; kw::Float64)` are not evaluated if the type annotation provides the necessary information, making this syntax compatible with signatures found in stacktraces ([#57909], [#58222]). |
| 102 | +* Code introspection macros such as `@code_lowered` and `@code_typed` now have a much better support for broadcasting expressions, including broadcasting assignments of the form `x .+= f(y)` ([#58349]). |
| 103 | + |
| 104 | +#### Dates |
| 105 | + |
| 106 | +* `isoweekdate`, `isoyear`, `weeksinyear` are now implemented and exported for week based calendars, following [ISO week date](https://en.wikipedia.org/wiki/ISO_week_date) ([#48507]). |
| 107 | + |
| 108 | +External dependencies |
| 109 | +--------------------- |
| 110 | + |
| 111 | + * 7-Zip updated from p7zip v17.06 to upstream 7-Zip v25.01. On Windows, the full 7z.exe/7z.dll bundle is replaced with standalone 7za.exe, which supports fewer formats but unifies cross-platform behavior. ([#60025]). |
| 112 | + |
| 113 | +Deprecated or removed |
| 114 | +--------------------- |
| 115 | + |
| 116 | +* The method `merge(combine::Callable, d::AbstractDict...)` is now deprecated to favor `mergewith` instead ([#59775]). |
| 117 | + |
| 118 | +<!--- generated by NEWS-update.jl: --> |
| 119 | +[#47102]: https://github.com/JuliaLang/julia/issues/47102 |
| 120 | +[#48507]: https://github.com/JuliaLang/julia/issues/48507 |
| 121 | +[#53462]: https://github.com/JuliaLang/julia/issues/53462 |
| 122 | +[#53677]: https://github.com/JuliaLang/julia/issues/53677 |
| 123 | +[#54124]: https://github.com/JuliaLang/julia/issues/54124 |
| 124 | +[#55774]: https://github.com/JuliaLang/julia/issues/55774 |
| 125 | +[#55841]: https://github.com/JuliaLang/julia/issues/55841 |
| 126 | +[#55944]: https://github.com/JuliaLang/julia/issues/55944 |
| 127 | +[#56580]: https://github.com/JuliaLang/julia/issues/56580 |
| 128 | +[#56845]: https://github.com/JuliaLang/julia/issues/56845 |
| 129 | +[#56902]: https://github.com/JuliaLang/julia/issues/56902 |
| 130 | +[#56906]: https://github.com/JuliaLang/julia/issues/56906 |
| 131 | +[#56978]: https://github.com/JuliaLang/julia/issues/56978 |
| 132 | +[#57137]: https://github.com/JuliaLang/julia/issues/57137 |
| 133 | +[#57143]: https://github.com/JuliaLang/julia/issues/57143 |
| 134 | +[#57509]: https://github.com/JuliaLang/julia/issues/57509 |
| 135 | +[#57825]: https://github.com/JuliaLang/julia/issues/57825 |
| 136 | +[#57839]: https://github.com/JuliaLang/julia/issues/57839 |
| 137 | +[#57909]: https://github.com/JuliaLang/julia/issues/57909 |
| 138 | +[#57937]: https://github.com/JuliaLang/julia/issues/57937 |
| 139 | +[#58100]: https://github.com/JuliaLang/julia/issues/58100 |
| 140 | +[#58119]: https://github.com/JuliaLang/julia/issues/58119 |
| 141 | +[#58181]: https://github.com/JuliaLang/julia/issues/58181 |
| 142 | +[#58222]: https://github.com/JuliaLang/julia/issues/58222 |
| 143 | +[#58349]: https://github.com/JuliaLang/julia/issues/58349 |
| 144 | +[#58596]: https://github.com/JuliaLang/julia/issues/58596 |
| 145 | +[#58727]: https://github.com/JuliaLang/julia/issues/58727 |
| 146 | +[#58814]: https://github.com/JuliaLang/julia/issues/58814 |
| 147 | +[#58940]: https://github.com/JuliaLang/julia/issues/58940 |
| 148 | +[#58970]: https://github.com/JuliaLang/julia/issues/58970 |
| 149 | +[#59117]: https://github.com/JuliaLang/julia/issues/59117 |
| 150 | +[#59234]: https://github.com/JuliaLang/julia/issues/59234 |
| 151 | +[#59295]: https://github.com/JuliaLang/julia/issues/59295 |
| 152 | +[#59372]: https://github.com/JuliaLang/julia/issues/59372 |
| 153 | +[#59534]: https://github.com/JuliaLang/julia/issues/59534 |
| 154 | +[#59544]: https://github.com/JuliaLang/julia/issues/59544 |
| 155 | +[#59551]: https://github.com/JuliaLang/julia/issues/59551 |
| 156 | +[#59691]: https://github.com/JuliaLang/julia/issues/59691 |
| 157 | +[#59775]: https://github.com/JuliaLang/julia/issues/59775 |
| 158 | +[#59825]: https://github.com/JuliaLang/julia/issues/59825 |
| 159 | +[#60025]: https://github.com/JuliaLang/julia/issues/60025 |
| 160 | + |
| 161 | + |
1 | 162 | Julia v1.12 Release Notes |
2 | 163 | ========================= |
3 | 164 |
|
|
0 commit comments