- Types written with
wheresyntax can now be used to define constructors, e.g.(Foo{T} where T)(x) = .... <--and<-->are now available as infix operators, with the same precedence and associativity as other arrow-like operators ([#36666]).- Compilation and type inference can now be enabled or disabled at the module level
using the experimental macro
Base.Experimental.@compiler_options([#37041]). - The library name passed to
ccallor@ccallcan now be an expression involving global variables and function calls. The expression will be evaluated the first time theccallexecutes ([#36458]). ꜛ(U+A71B),ꜜ(U+A71C) andꜝ(U+A71D) can now also be used as operator suffixes. They can be tab-completed from\^uparrow,\^downarrowand\^!in the REPL ([#37542]).- Standalone "dotted" operators now get parsed as
Expr(:., :op), which gets lowered toBase.BroadcastFunction(op). This means.opis functionally equivalent to(x...) -> (op).(x...), which can be useful for passing the broadcasted version of an operator to higher-order functions, like for examplemap(.*, A, B)for an elementwise product of two arrays of arrays. ([#37583]) - The syntax
import A as B(plusimport A: x as y,import A.x as y, andusing A: x as y) can now be used to rename imported modules and identifiers ([#1255]).
- The
-->operator now lowers to a:callexpression, so it can be defined as a function like other operators. The dotted version.-->is now parsed as well. For backwards compatibility,-->still parses using its own expression head instead of:call.
- All platforms can now use
@executable_pathwithinjl_load_dynamic_library(). This allows executable-relative paths to be embedded within executables on all platforms, not just MacOS, which the syntax is borrowed from. ([#35627]) - Constant propogation now occurs through keyword arguments ([#35976])
- The precompilation cache is now created atomically ([#36416]). Invoking n Julia processes simultaneously may create n temporary caches.
- There is no longer a concept of "home project": starting
julia --project=diris now exactly equivalent to startingjuliaand then doingpkg> activate $dirandjulia --projectis exactly equivalent to doing that wheredir = Base.current_project(). In particular, this means that if you dopkg> activateafter startingjuliawith the--projectoption (or withJULIA_PROJECTset) it will take you to the default active project, which is@v1.5unless you have modifiedLOAD_PATH. ([#36434])
- Windows Installer now has the option to 'Add Julia to Path'. To unselect this option
from the commandline simply remove the tasks you do not want to be installed: e.g.
./julia-installer.exe /TASKS="desktopicon,startmenu,addtopath", adds a desktop icon, a startmenu group icon, and adds Julia to system PATH.
- The
Base.downloadfunction has been deprecated (silently, by default) in favor of the newDownloads.downloadstandard library function ([#37340]). - The
Base.Grisucode has been officially removed (float printing was switched to the ryu algorithm code in 1.4)
- New function
Base.kron!and corresponding overloads for various matrix types for performing Kronecker product in-place. ([#31069]). - New function
Base.Threads.foreach(f, channel::Channel)for multithreadedChannelconsumption. ([#34543]). - New function
Base.readeach(io, T)for iteratively performingread(io, T). ([#36150]) Iterators.mapis added. It provides another syntaxIterators.map(f, iterators...)for writing(f(args...) for args in zip(iterators...)), i.e. a lazymap([#34352]).- New function
sincospifor simultaneously computingsinpi(x)andcospi(x)more efficiently ([#35816]). - New function
addenvfor adding environment mappings into aCmdobject, returning the newCmdobject. - New function
insortedfor determining whether an element is in a sorted collection or not ([#37490]). - New function
isdebugfor checking if julia is running in debug mode. Packages use different precompile caches in debug and non-debug mode thus it safe to use this function for compile time decisions. Also, note that@assertnow is a no-op unlessisdebug()is true. Debug mode is activated with the-g2flag.
- The
redirect_*functions can now be called onIOContextobjects. - New constructor
NamedTuple(iterator)that constructs a named tuple from a key-value pair iterator. - A new
reinterpret(reshape, T, a::AbstractArray{S})reinterpretsato have eltypeTwhile potentially inserting or consuming the first dimension depending on the ratio ofsizeof(T)andsizeof(S).
- The
nextprodfunction now accepts tuples and other array types for its first argument ([#35791]). - The
reverse(A; dims)function for multidimensionalAcan now reverse multiple dimensions at once by passing a tuple fordims, and defaults to reversing all dimensions; there is also a multidimensional in-placereverse!(A; dims)([#37367]). - The function
isapprox(x,y)now accepts thenormkeyword argument also for numeric (i.e., non-array) argumentsxandy([#35883]). ispow2(x)now supports non-Integerargumentsx([#37635]).view,@view, and@viewsnow work onAbstractStrings, returning aSubStringwhen appropriate ([#35879]).- All
AbstractUnitRange{<:Integer}s now work withSubString,view,@viewand@viewson strings ([#35879]). sum,prod,maximum, andminimumnow supportinitkeyword argument ([#36188], [#35839]).unique(f, itr; seen=Set{T}())now allows you to declare the container type used for keeping track of values returned byfon elements ofitr([#36280]).Libdlhas been moved toBase.Libc.Libdl, however it is still accessible as an stdlib ([#35628]).firstandlastfunctions now accept an integer as second argument to get that many leading or trailing elements of any iterable ([#34868]).intersectonCartesianIndicesnow returnsCartesianIndicesinstead ofVector{<:CartesianIndex}([#36643]).push!(c::Channel, v)now returns channelc. Previously, it returned the pushed valuev([#34202]).RegexMatchobjects can now be probed for whether a named capture group exists within it throughhaskey()([#36717]).- For consistency
haskey(r::RegexMatch, i::Integer)has also been added and returns if the capture group foriexists ([#37300]). - A new standard library
TOMLhas been added for parsing and printing TOML files ([#37034]). - The composition operator
∘now returns aBase.ComposedFunctioninstead of an anonymous function ([#37517]). - A new standard library
Downloadshas been added, which replaces the oldBase.downloadfunction withDownloads.download, providing cross-platform, multi-protocol, in-process download functionality implemented with libcurl ([#37340]). - The
Pkg.BinaryPlatformsmodule has been moved intoBaseasBase.BinaryPlatformsand heavily reworked. Applications that want to be compatible with the old API should continue to importPkg.BinaryPlatforms, however new users should useBase.BinaryPlatformsdirectly. ([#37320]) - Logging (such as
@warn) no longer catches exceptions in the logger itself ([#36600]). - The
Pkg.Artifactsmodule has been imported as a separate standard library. It is still available asPkg.Artifacts, however starting from Julia v1.6+, packages may import simplyArtifactswithout importing all ofPkgalongside. ([#37320]) - The
@assertmacro is now only active when julia is started with a debug level of 2 (julia -g2).
- New method
LinearAlgebra.issuccess(::CholeskyPivoted)for checking whether pivoted Cholesky factorization was successful ([#36002]). UniformScalingcan now be indexed into using ranges to return dense matrices and vectors ([#24359]).- New function
LinearAlgebra.BLAS.get_num_threads()for getting the number of BLAS threads. ([#36360]) (+)(::UniformScaling)is now defined, making+Ia valid unary operation. ([#36784])
- Complete overhaul of internal code to use the ryu float printing algorithms (from Julia 1.4); leads to consistent 2-5x performance improvements
- New
Printf.tofloatfunction allowing custom float types to more easily integrate with Printf formatting by converting their type toFloat16,Float32,Float64, orBigFloat - New
Printf.format"..."andPrintf.Format(...)functions that allow creatingPrintf.Formatobjects that can be passed toPrintf.formatfor easier dynamic printf formatting Printf.format(f::Printf.Format, args...)as a non-macro function that applies a printf formatfto providedargs
-
The
AbstractMenuextension interface ofREPL.TerminalMenushas been extensively overhauled. The new interface does not rely on global configuration variables, is more consistent in delegating printing of the navigation/selection markers, and provides improved support for dynamic menus. These changes are compatible with the previous (deprecated) interface, so are non-breaking.The new API offers several enhancements:
- Menus are configured in their constructors via keyword arguments
- For custom menu types, the new
ConfigandMultiSelectConfigreplace the globalCONFIGDict request(menu; cursor=1)allows you to control the initial cursor position in the menu (defaults to first item)MultiSelectMenuallows you to pass a list of initially-selected items with theselectedkeyword argumentwriteLinewas deprecated towriteline, andwritelinemethods are not expected to print the cursor indicator. The oldwriteLinecontinues to work, and any of its method extensions should print the cursor indicator as before.printMenuhas been deprecated toprintmenu, and it both accepts a state input and returns a state output that controls the number of terminal lines erased when the menu is next refreshed. This plus related changes makesprintmenuwork properly when the number of menu items might change depending on user choices.numoptions, returning the number of items in the menu, has been added as an alternative to implementingoptionssuppress_output(primarily a testing option) has been added as a keyword argument torequest, rather than a configuration option
-
Windows REPL now supports 24-bit colors, by correctly interpreting virtual terminal escapes.
- Display large sparse matrices with a Unicode "spy" plot of their nonzero patterns,
and display small sparse matrices by an
Matrix-like 2d layout of their contents. - New convenient
spdiagm([m, n,] v::AbstractVector)methods which callspdiagm([m, n,] 0 => v), consistently with their densediagmcounterparts. ([#37684])
Quarterperiod is defined ([#35519]).canonicalizecan now takePeriodas an input ([#37391])- Zero-valued
FixedPeriods andOtherPeriods now compare equal, e.g.,Year(0) == Day(0). The behavior of non-zeroPeriods is not changed. ([#37486])
- Change
uuid1anduuid4to useRandom.RandomDevice()as default random number generator ([#35872]). - Added
parse(::Type{UUID}, ::AbstractString)method
- On Unix systems, the
Mmap.madvise!function (along with OS-specificMmap.MADV_*constants) has been added to give advice on handling of memory-mapped arrays. ([#37369])