The release of the programming language Julia 1.10 has been published, combining such qualities as high performance, support for dynamic typing and built-in tools for parallel programming. The syntax of Julia is close to MATLAB, with some elements borrowed from Ruby and Lisp. The string manipulation method is reminiscent of Perl. The project code is distributed under the MIT license.
Key features of the language:
- High performance: one of the key goals of the project is to achieve performance close to C programs. The Julia compiler is based on the LLVM project and generates efficient native machine code for many target platforms;
- Support for various programming paradigms, including elements of object-oriented and functional programming. The standard library provides functions for asynchronous I/O, process management, logging, profiling, and package management, among other things;
- Dynamic typing: The language does not require explicit definition of types for variables, by analogy with scripting programming languages. Supports interactive mode;
- Optional ability to explicitly specify types;
- Syntax that is excellent for numerical calculations, scientific calculations, machine learning systems and data visualization. Support for many numeric data types and tools for parallelizing calculations.
- Ability to directly call functions from C libraries without additional layers.
Major changes in Julia 1.10:
- New language features
- By default, the new and improved JuliaSyntax.jl parser is enabled. If you need to revert to the old one, you should set the environment variable JULIA_USE_FLISP_PARSER to 1.
- The symbols β₯Ί (U+297A, \leftarrowsubset) and β₯· (U+2977, \leftarrowless) can now be used as binary operators with arrow precedence.
- Language changes
- When spawning child tasks, the local RNG (random number generator) of the parent task is no longer affected. The new random number generator initialization scheme is similar to the SplitMix and DotMix implementations.
- A new method selection rule has been proposed that disambiguates the type "Union{}" in favor of a method defined explicitly to handle an argument of type "Union{}".
- The character "h bar" β (\hslash U+210F) is now treated as equivalent to Δ§ (\hbar U+0127).
- The "@simd" macro now has specific semantics: it only allows floating point reordering and pruning instead of enabling all the "@fastmath" optimizations. If running programs experience performance degradation due to this change, then the previous behavior can be restored using "@fastmath @simd".
- When displayed in the stack trace of a method with keywords, the textual representation of the keywords is now simplified using the new macro syntax "@Kwargs{key1::Type1, ...}".
- Compiler/Runtime Improvements
- The garbage collector now performs multi-threaded selection of objects for disposal.
- JITLink is enabled by default in Linux-systems based on the aarch64 architecture when building Julia with LLVM 15 or later.
- The precompilation process involves locking pid files. Only one julia process performs precompilation at a time. Previously, all processes ran in parallel, and there was a danger of corrupting compilation cache files due to race conditions.
- Command line parameter changes
- Added "--gcthreads" option, which allows you to specify how many parallel threads the garbage collector will use. The default value is "N/2", where N is the number of worker threads ("-threads") used by Julia.
- Build system changes
- The βSparseArraysβ and βSuiteSparseβ nodes are excluded from the system image by default. The Julia base package no longer contains GPL-licensed libraries. However, these libraries are still included with the language in the standard binary distribution.
- New library functions
- "tanpi" calculates "tan(Ο*x)" more accurately than "tan(pi*x)".
- "fourroot(x)" is defined in Base.Math and can be used to calculate the fourth root of "x". The short name for this method is the Unicode character β, which can be entered using the \fourthroot command.
- Added functions "Libc.memmove", "Libc.memset" and "Libc.memcpy", whose functionality corresponds to the functionality of the corresponding C calls.
- Added "Base.isprecompiled(pkg::PkgId)" method which returns "true" if the package has already been precompiled.
- Library Function Options
- "binomial(x, k)" now supports non-integer "x".
- "CartesianIndex" is now treated as a "scalar" for broadcast.
- The "printstyled" method now supports italic output.
- The "parent" and "parentindices" methods now support the "SubStrings" type.
- The "replace(string,pattern...)" method now supports an optional "IO" argument for outputting to a stream rather than returning a string.
- The "startswith" method now supports I/O threads.
- Base library changes
- From the βsortperm!β methods and βpartialsortperm!β removed the "initialized=true" keyword, which could lead to unsafe behavior.
- When printing "Rational" type integers, their denominator is now skipped in the context of "Rational" typed streams (such as arrays).
- Package manager
- The "Pkg.precompile" method now takes "timing" as a key argument, displaying precompile timing information for each package - "Pkg.precompile(timing=true)".
- LinearAlgebra
- The type "AbstractQ" is no longer a subtype of "AbstractMatrix". Moreover, the "adjoint(Q::AbstractQ)" method no longer wraps "Q" in the "Adjoint" type, replacing it with "AdjointQ", which is itself a subtype of "AbstractQ". This change is due to the fact that typically "AbstractQ" instances behave like linear operators based on functions and matrices and are not accessible by index. Additionally, many "AbstractQ" types can operate on vectors/matrices of different sizes, acting like a matrix with a context-dependent size. With this change, the "AbstractQ" type now has a well-defined interface, which is described in detail in the Julia documentation.
- Factorization results are no longer wrapped in "Adjoint" and "Transpose" wrapper types. Instead, the types βAdjointFactorizationβ and βTranposeFactorizationβ have been added, which themselves are subtypes of βFactorizationβ.
- New functions "hermitianpart" and "hermitianpart!" to find the Hermitian (truly symmetric) part of the matrix.
- The "norm" method of a transposed child matrix of type "AbstractMatrix" now returns the norm of the parent matrix by default, which matches the current behavior for "AbstractVectors".
- Added methods for calculating eigenvectors "eigen(A, B)" and "eigvals(A, B)" for the case where one of A or B is symmetric or Hermitian.
- The "eigvals/eigen(A, cholesky(B))" methods now compute the generalized eigenvalues ββ(eigen: and eigenvectors) of A and B via the Cholesky expansion for positive definite B.
- printf
- Format specifiers now support dynamic width and precision, such as "%*s" and "%*.*g".
- REPL
- When printing a stack trace, the depth of printed types in function signatures is limited to avoid overly verbose output.
- Test
- The "@test_broken" macro (or "@test" with "broken=true") now throws an error if the test expression does not return false/true.
- If there is an error when calling "@test" or an error within a function, a detailed stack trace is now provided to help understand the position of the test in the "@testset".
- InteractiveUtils
- "code_native" and "@code_native" now use Intel syntax instead of AT&T.
- "@time_imports" now shows the execution time of "__init__()" for imported modules.
- Outdated and subject to removal structures
- The "@pure" macro has been deprecated. "Base.@assume_effects :foldable" should be used instead.
Source: opennet.ru
