Julia v1.11 Release Notes
New language features
- New Memorytype that provides a lower-level container as an alternative toArray.Memoryhas less overhead and a faster constructor, making it a good choice for situations that do not need all the features ofArray(e.g. multiple dimensions). Most of theArraytype is now implemented in Julia on top ofMemory, leading to significant speedups for several functions (e.g.push!) as well as more maintainable code (#51319).
- publicis a new keyword. Symbols marked with- publicare considered public API. Symbols marked with- exportare now also treated as public API. The difference between- publicand- exportis that- publicnames do not become available when- usinga package/module (#50105).
- ScopedValueimplements dynamic scope with inheritance across tasks (#50958).
- Manifest.tomlfiles can now be renamed in the format- Manifest-v{major}.{minor}.tomlto be preferentially picked up by the given julia version. i.e. in the same folder, a- Manifest-v1.11.tomlwould be used by v1.11 and- Manifest.tomlby every other julia version. This makes managing environments for multiple julia versions at the same time easier (#43845).
- Support for Unicode 15.1 (#51799).
Language changes
- During precompilation, atexithooks now run before saving the output file. This allows users to safely tear down background state (such as closingTimers and sending disconnect notifications to heartbeat tasks) and cleanup other resources when the program wants to begin exiting.
- Code coverage and malloc tracking is no longer generated during the package precompilation stage. Further, during these modes pkgimage caches are now used for packages that are not being tracked. This means that coverage testing (the default for julia-actions/julia-runtest) will by default use pkgimage caches for all other packages than the package being tested, likely meaning faster test execution (#52123).
- Specifying a path in JULIA_DEPOT_PATHnow results in the expansion of empty strings to omit the default user depot (#51448).
- Precompilation cache files are now relocatable and their validity is now verified through a content hash of their source files instead of their mtime(#49866).
- Extensions may now depend on other extensions, if their triggers include all triggers of any extension they wish to depend upon (+ at least one other trigger). Ext-to-ext dependencies that don't meet this requirement are now blocked from using Base.get_extensionduring pre- compilation, to prevent extension cycles #55557.
Compiler/Runtime improvements
- Updated GC heuristics to count allocated pages instead of individual objects (#50144).
- Added support for annotating Base.@assume_effectson code blocks (#52400).
Command-line option changes
- The entry point for Julia has been standardized to Main.main(args). This must be explicitly opted into using the@mainmacro (see the docstring for further details). When opted-in, andjuliais invoked to run a script or expression (i.e. usingjulia script.jlorjulia -e expr),juliawill subsequently run theMain.mainfunction automatically. This is intended to unify script and compilation workflows, where code loading may happen in the compiler and execution ofMain.mainmay happen in the resulting executable. For interactive use, there is no semantic difference between defining amainfunction and executing the code directly at the end of the script (#50974).
- The --compiled-modulesand--pkgimagesflags can now be set toexisting, which will cause Julia to consider loading existing cache files, but not to create new ones (#50586, #52573).
- The --projectargument now accepts@scriptto give a path to a directory with a Project.toml relative to the passed script file.--project=@script/foofor thefoosubdirectory. If no path is given after (i.e.--project=@script) then (like--project=@.) the directory and its parents are searched for a Project.toml (#50864 and #53352)
Multi-threading changes
- Threads.@threadsnow supports the- :greedyscheduler, intended for non-uniform workloads (#52096).
- A new public (but unexported) struct Base.Lockable{T, L<:AbstractLock}makes it easy to bundle a resource and its lock together (#52898).
Build system changes
- There is a new Makefileto build Julia and LLVM using the profile-guided and link-time optimizations (PGO and LTO) strategies, seecontrib/pgo-lto/Makefile(#45641).
New library functions
- Three new types around the idea of text with "annotations" (Pair{Symbol, Any}entries, e.g.:lang => "en"or:face => :magenta). These annotations are preserved across operations (e.g. string concatenation with*) when possible.- AnnotatedStringis a new- AbstractStringtype. It wraps an underlying string and allows for annotations to be attached to regions of the string. This type is used extensively in the new- StyledStringsstandard library to hold styling information.
- AnnotatedCharis a new- AbstractChartype. It wraps another char and holds a list of annotations that apply to it.
- AnnotatedIOBufferis a new- IOtype that mimics an- IOBuffer, but has specialised- read/- writemethods for annotated content. This can be thought of both as a "string builder" of sorts and also as glue between annotated and unannotated content.
 
- in!(x, s::AbstractSet)will return whether- xis in- s, and insert- xin- sif not (#45156, #51636).
- The new Libc.mkfifofunction wraps themkfifoC function on Unix platforms (#34587).
- logrange(start, stop; length)makes a range of constant ratio, instead of constant step (#39071)
- copyuntil(out, io, delim)and- copyline(out, io)copy data into an- out::IOstream (#48273).
- eachrsplit(string, pattern)iterates split substrings right to left (#51646).
- Sys.username()can be used to return the current user's username (#51897).
- Sys.isreadable(), Sys.iswritable()can be used to check if the current user has access permissions that permit reading and writing, respectively. (#53320).
- GC.logging_enabled()can be used to test whether GC logging has been enabled via- GC.enable_logging(#51647).
- IdSetis now exported from Base and considered public (#53262).
- @timenow reports a count of any lock conflicts where a- ReentrantLockhad to wait, plus a new macro- @lock_conflictswhich returns that count (#52883).
- The new macro Base.Cartesian.@ncallkwis analogous toBase.Cartesian.@ncall, but allows adding keyword arguments to the function call (#51501).
- New function Docs.hasdoc(module, symbol)tells whether a name has a docstring (#52139).
- New function Docs.undocumented_names(module)returns a module's undocumented public names (#52413).
New library features
- invmod(n, T)where- Tis a native integer type now computes the modular inverse of- nin the modular integer ring that- Tdefines (#52180).
- invmod(n)is an abbreviation for- invmod(n, typeof(n))for native integer types (#52180).
- replace(string, pattern...)now supports an optional- IOargument to write the output to a stream rather than returning a string (#48625).
- New methods allequal(f, itr)andallunique(f, itr)taking a predicate function (#47679).
- sizehint!(s, n)now supports an optional- shrinkargument to disable shrinking (#51929).
- Passing an IOBufferas a stdout argument forProcessspawn now works as expected, synchronized withwaitorsuccess, so aBase.BufferStreamis no longer required there for correctness to avoid data races (#52461).
- After a process exits, closewritewill no longer be automatically called on the stream passed to it. Callwaiton the process instead to ensure the content is fully written, then callclosewritemanually to avoid data races, or use the callback form ofopento have all that handled automatically (#52461).
- @timednow additionally returns the elapsed compilation and recompilation time (#52889).
- filtercan now act on a- NamedTuple(#50795).
- Iterators.cycle(iter, n)runs over- itera fixed number of times, instead of forever (#47354).
- zero(::AbstractArray)now applies recursively, so- zero([[1,2],[3,4,5]])now produces the additive identity- [[0,0],[0,0,0]]rather than erroring (#38064).
- include_dependency(path; track_content=true)allows switching from using- mtimeto hashing of the precompilation dependency in order to restore relocatability of precompilation caches (#51798).
Standard library changes
- The fallback method write(::IO, ::AbstractArray)used to recursively callwriteon each element, but now writes the in-memory representation of each value. For example,write(io, 'a':'b')now writes 4 bytes for each character, instead of writing the UTF-8 representation of each character. The new format is compatible with that used byArray, making it possible to useread!to get the data back (#42593).
- It's not possible to define lengthfor stateful iterators in a generally consistent manner. The potential for silently incorrect results forStatefuliterators is addressed by deleting thelength(::Stateful)method. The last type parameter ofStatefulis gone, too. Issue: (#47790), PR: (#51747).
Package Manager
- It is now possible to specify "sources" for packages in a [sources]section in Project.toml. This can be used to add non-registered normal or test dependencies.
- Pkg now obeys [compat]bounds forjuliaand raises an error if the version of the running Julia binary is incompatible with the bounds inProject.toml. Pkg has always obeyed this compat when working with Registry packages. This change affects mostly local packages
- pkg> addand- Pkg.addwill now add compat entries for new direct dependencies if the active environment is a package (has a- nameand- uuidentry).
- Dependencies can now be directly added as weak deps or extras via the pkg> add --weak/extra FooorPkg.add("Foo", target=:weakdeps/:extras)forms.
StyledStrings
- A new standard library for handling styling in a more comprehensive and structured way (#49586).
- The new Facesstruct serves as a container for text styling information (think typeface, as well as color and decoration), and comes with a framework to provide a convenient, extensible (viaaddface!), and customisable (with a user'sFaces.tomlandloadfaces!) approach to styled content (#49586).
- The new @styled_strstring macro provides a convenient way of creating aAnnotatedStringwith various faces or other attributes applied (#49586).
Libdl
- A new LazyLibrarytype is exported fromLibdlfor use in building chained lazy library loads, primarily to be used within JLLs (#50074).
LinearAlgebra
- cbrt(::AbstractMatrix{<:Real})is now defined and returns real-valued matrix cube roots of real-valued matrices (#50661).
- eigvals/eigen(A, bunchkaufman(B))and- eigvals/eigen(A, lu(B)), which utilize the Bunchkaufman (LDL) and LU decomposition of- B, respectively, now efficiently compute the generalized eigenvalues (- eigen: and eigenvectors) of- Aand- B. Note: The second argument is the output of- bunchkaufmanor- lu(#50471).
- There is now a specialized dispatch for eigvals/eigen(::Hermitian{<:Tridiagonal})which performs a similarity transformation to create a real symmetric tridiagonal matrix, and solve that using the LAPACK routines (#49546).
- Structured matrices now retain either the axes of the parent (for Symmetric/Hermitian/AbstractTriangular/UpperHessenberg), or that of the principal diagonal (for banded matrices) (#52480).
- bunchkaufmanand- bunchkaufman!now work for any- AbstractFloat,- Rationaland their complex variants.- bunchkaufmannow supports- Integertypes, by making an internal conversion to- Rational{BigInt}. Added new function- inertiathat computes the inertia of the diagonal factor given by the- BunchKaufmanfactorization object of a real symmetric or Hermitian matrix. For complex symmetric matrices,- inertiaonly computes the number of zero eigenvalues of the diagonal factor (#51487).
- Packages that specialize matrix-matrix mul!with a method signature of the formmul!(::AbstractMatrix, ::MyMatrix, ::AbstractMatrix, ::Number, ::Number)no longer encounter method ambiguities when interacting withLinearAlgebra. Previously, ambiguities used to arise when multiplying aMyMatrixwith a structured matrix type provided by LinearAlgebra, such asAbstractTriangular, which used to necessitate additional methods to resolve such ambiguities. Similar sources of ambiguities have also been removed for matrix-vectormul!operations (#52837).
- luand- issuccess(::LU)now accept an- allowsingularkeyword argument. When set to- true, a valid factorization with rank-deficient U factor will be treated as success instead of throwing an error. Such factorizations are now shown by printing the factors together with a "rank-deficient" note rather than printing a "Failed Factorization" message (#52957).
Random
- randnow supports sampling over- Tupletypes (#35856, #50251).
- randnow supports sampling over- Pairtypes (#28705).
- When seeding RNGs provided by Random, negative integer seeds can now be used (#51416).
- Seedable random number generators from Randomcan now be seeded by a string, e.g.seed!(rng, "a random seed")(#51527).
REPL
- Tab complete hints now show in lighter text while typing in the repl. To disable set Base.active_repl.options.hint_tab_completes = falseinteractively, or in startup.jl:
 (#51229).if VERSION >= v"1.11.0-0" atreplinit() do repl repl.options.hint_tab_completes = false end end
- Meta-M with an empty prompt now toggles the contextual module between the previous non-Main contextual module and Main so that switching back and forth is simple (#51616, #52670).
Dates
The undocumented function adjust is no longer exported but is now documented (#53092).
Statistics
- Statistics is now an upgradeable standard library (#46501).
Distributed
- pmapnow defaults to using a- CachingPool(#33892).
Deprecated or removed
- Base.map,- Iterators.map, and- foreachlost their single-argument methods (#52631).
External dependencies
- The libuv library has been updated from a base of v1.44.2 to v1.48.0 (#49937).
- tputis no longer called to check terminal capabilities; it has been replaced with a pure-Julia terminfo parser (#50797).
- The terminal info database, terminfo, is now vendored by default, providing a better REPL user experience whenterminfois not available on the system. Julia can be built without vendoring the database using the Makefile optionWITH_TERMINFO=0. (#55411)
Tooling Improvements
- CI now performs limited automatic typo detection on all PRs. If you merge a PR with a failing typo CI check, then the reported typos will be automatically ignored in future CI runs on PRs that edit those same files (#51704).