Julia v1.10 Release Notes
New language features
- JuliaSyntax.jl is now used as the default parser, providing better diagnostics and faster parsing. Set environment variable
JULIA_USE_NEW_PARSERto0to switch back to the old parser if necessary (and if you find this necessary, please file an issue) (#46372). ⥺(U+297A,\leftarrowsubset) and⥷(U+2977,\leftarrowless) may now be used as binary operators with arrow precedence. (#45962)
Language changes
- When a task forks a child, the parent task's task-local RNG (random number generator) is no longer affected. The seeding of child based on the parent task also takes a more disciplined approach to collision resistance, using a design based on the SplitMix and DotMix splittable RNG schemes (#49110).
- A new more-specific rule for methods resolves ambiguities containing Union{} in favor of the method defined explicitly to handle the Union{} argument. This makes it possible to define methods to explicitly handle Union{} without the ambiguities that commonly would result previously. This also lets the runtime optimize certain method lookups in a way that significantly improves load and inference times for heavily overloaded methods that dispatch on Types (such as traits and constructors).
- The "h bar"
ℏ(\hslashU+210F) character is now treated as equivalent toħ(\hbarU+0127). - The
@simdmacro now has a more limited and clearer semantics, it only enables reordering and contraction of floating-point operations, instead of turning on all "fastmath" optimizations. If you observe performance regressions due to this change, you can recover previous behavior with@fastmath @simd, if you are OK with all the optimizations enabled by the@fastmathmacro. (#49405) - When a method with keyword arguments is displayed in the stack trace view, the textual representation of the keyword arguments' types is simplified using the new
@Kwargs{key1::Type1, ...}macro syntax (#49959).
Compiler/Runtime improvements
Updated GC heuristics to count allocated pages instead of individual objects (#50144).
The
@puremacro is now deprecated. UseBase.@assume_effects :foldableinstead (#48682).The mark phase of the Garbage Collector is now multi-threaded (#48600).
JITLink is enabled by default on Linux aarch64 when Julia is linked to LLVM 15 or later versions (#49745). This should resolve many segmentation faults previously observed on this platform.
Command-line option changes
- New option
--gcthreadsto set how many threads will be used by the Garbage Collector (#48600). The default is set toN/2whereNis the amount of worker threads (--threads) used by Julia.
Multi-threading changes
Build system changes
New library functions
tanpiis now defined. It computes tan(πx) more accurately thantan(pi*x)(#48575).fourthroot(x)is now defined inBase.Mathand can be used to compute the fourth root ofx. It can also be accessed using the unicode character∜, which can be typed by\fourthroot<tab>(#48899).Libc.memmove,Libc.memset, andLibc.memcpyare now defined, whose functionality matches that of their respective C calls.Base.isprecompiled(pkg::PkgId)to identify whether a package has already been precompiled (#50218).
New library features
- The
initialized=truekeyword assignment forsortperm!andpartialsortperm!is now a no-op (#47979). It previously exposed unsafe behavior (#47977). binomial(x, k)now supports non-integerx(#48124).- A
CartesianIndexis now treated as a "scalar" for broadcasting (#47044). printstylednow supports italic output (#45164).parentandparentindicessupportSubStringsreplace(string, pattern...)now supports an optionalIOargument to write the output to a stream rather than returning a string (#48625).
Standard library changes
startswithnow supports seekableIOstreams (#43055)- printing integral
Rationals will skip the denominator inRational-typed IO context (e.g. inArrays) (#45396)
Package Manager
Pkg.precompilenow acceptstimingas a keyword argument which displays per package timing information for precompilation (e.g.Pkg.precompile(timing=true))
LinearAlgebra
AbstractQno longer subtypes toAbstractMatrix. Moreover,adjoint(Q::AbstractQ)no longer wrapsQin anAdjointtype, but instead in anAdjointQ, that itself subtypesAbstractQ. This change accounts for the fact that typicallyAbstractQinstances behave like function-based, matrix-backed linear operators, and hence don't allow for efficient indexing. Also, manyAbstractQtypes can act on vectors/matrices of different size, acting like a matrix with context-dependent size. With this change,AbstractQhas a well-defined API that is described in detail in the Julia documentation (#46196).- Adjoints and transposes of
Factorizationobjects are no longer wrapped inAdjointandTransposewrappers, respectively. Instead, they are wrapped inAdjointFactorizationandTranposeFactorizationtypes, which themselves subtypeFactorization(#46874). - New functions
hermitianpartandhermitianpart!for extracting the Hermitian (real symmetric) part of a matrix (#31836). - The
normof the adjoint or transpose of anAbstractMatrixnow returns the norm of the parent matrix by default, matching the current behaviour forAbstractVectors (#49020). eigen(A, B)andeigvals(A, B), where one ofAorBis symmetric or Hermitian, are now fully supported (#49533)eigvals/eigen(A, cholesky(B))now computes the generalized eigenvalues (eigen: and eigenvectors) ofAandBvia Cholesky decomposition for positive definiteB. Note: The second argument is the output ofcholesky.
Printf
- Format specifiers now support dynamic width and precision, e.g.
%*sand%*.*g(#40105).
Profile
Random
REPL
- When stack traces are printed, the printed depth of types in function signatures will be limited to avoid overly verbose output (#49795).
SuiteSparse
SparseArrays
Test
- The
@test_brokenmacro (or@testwithbroken=true) now complains if the test expression returns a non-boolean value in the same way as a non-broken test. (#47804) - When a call to
@testfails or errors inside a function, a larger stacktrace is now printed such that the location of the test within a@testsetcan be retrieved (#49451)
Dates
Distributed
Unicode
DelimitedFiles
InteractiveUtils
code_nativeand@code_nativenow default to intel syntax instead of AT&T.@time_importsnow shows the timing of any module__init__()s that are run (#49529)