new release and many features. What did the developers add and what changed? / Hebrew
Source.
A new version of the Julia programming language 1.11 has been released, which combines high performance with the flexibility of dynamic typing, and also offers built-in facilities for parallel programming. The syntax of the language is similar to MATLAB, includes elements of Ruby and Lisp, and working with strings resembles Perl. The project is distributed under the MIT license. In general, it is a good and necessary NAP, which we will talk about today. Details are below.
A bit of history
The Julia programming language was developed in 2009 and released in 2012. The creators of Julia are Jeff Besanson, Stefan Karpinski, Viral Shah and Alan Edelman. The main goal of the development was to create a language that would combine high performance with the ease of use characteristic of languages such as Python or R. They sought to solve a problem that often arises in scientific and numerical computing: the need to write prototypes in convenient but slow languages and then rewrite them in more productive ones such as C or Fortran.
Julia received support for many programming paradigms, integration with C libraries, the possibility of efficient numerical calculations, and built-in tools for working with parallel tasks.
The main features of the language
- High performance: One of Julia’s main goals is to achieve performance levels comparable to programs written in C. The language’s compiler, built on top of LLVM, generates efficient machine code for a variety of target platforms.
- Support for multiple programming paradigms: Julia supports elements of object-oriented and functional programming. The standard library includes functions for asynchronous input/output, process management, logging, profiling, and package management.
- Dynamic typing: As with most scripting languages, Julia variables do not require an explicit type specification. Interactive mode of operation is supported.
- Optional strict typing: Optionally, you can explicitly specify the types of variables and function arguments to improve performance and ease of debugging.
- Optimized syntax for numerical calculations: Julia is ideal for scientific and mathematical calculations, machine learning, and data visualization due to its wide set of built-in data types and support for parallel computing.
- Direct call to C libraries: Julia allows you to call functions from C libraries without intermediate layers, which increases flexibility and performance.
Main innovations in version 1.11
New language features:
- Memory Type: A new Memory data type has been introduced, which is a low-level alternative to Array. It requires fewer resources and has a faster constructor, which makes it better for tasks where the full functionality of Array is not needed, for example, for working with multidimensional arrays. The internal implementation of Array methods is now based on Memory, resulting in a significant speedup of some operations such as push.
- The public keyword: A new public keyword has been introduced, which is used to mark identifiers that are part of the external interface. Unlike export , such identifiers are not automatically imported into the module context when using using in other modules.
help?> GC.in_finalizer
│ Warning
│
│ The following bindings may be internal; they may change or be removed in future versions:
│
│ • Base.GC.in_finalizer
GC.in_finalizer()::Bool
- Package ScopedValue: A new package has appeared to support dynamic scoping in parallel programming using Threads/tasks.
- Manifest.toml files: Renaming Manifest.toml files to Manifest-v{major} format is now supported. {minor}.toml, which allows certain versions of Julia to be used. For example, Manifest-v1.11.toml will be associated with version 1.11 and Manifest.toml with other versions.
- Unicode 15.1: The new version adds support for Unicode 15.1, which expands the possibilities of working with text in different languages.
Language changes:
- Precompilation and atexit handling: During precompilation, the atexit handler is now started, allowing background tasks to be safely terminated and resources released before the program terminates.
- Code Coverage Files: Code coverage and memory allocation files are no longer created during recompilation. pkgimage caches are now used for untracked packages, which speeds up testing and improves performance.
- Processing of the JULIA_DEPOT_PATH variable: Now, when specifying one path of the JULIA_DEPOT_PATH variable, only it will be inserted into the value of the variable. If the path ends with “:”, system paths are also added.
- Precompile caches: Precompile cache files can now be moved, and their validity is checked using hashes of the contents of the source files, rather than the modified date of the files.
Multithreading improvements:
- New scheduler mode: greedy: A new scheduler mode: greedy has been added to the Threads.@threads macro, which is optimized for tasks with uneven computational load.
- New Base.Lockable structure: Added a new Base.Lockable structure that simplifies code when accessing elements of composite types in parallel, reducing the chance of errors.
Compilation and runtime changes:
- Garbage Collector: Updated the garbage collector to process memory pages in their entirety instead of individual objects, improving performance.
- Annotation support: Added the ability to annotate code using the Base.@assume_effects macro, which expands the ability to manage side effects in code.
New command line options:
- Main.main(args) entry point: Now clearly defined Main.main(args) entry point for executing scripts via the command line. This unifies the behavior of the code when it is compiled and run.
- –project=@script Argument: The –project=@script argument is now supported to specify the path to the Project.toml file relative to the running script.
New library features:
- Types for Annotated Strings: Added new types for working with annotated text, such as AnnotatedString, AnnotatedChar, and AnnotatedIOBuffer. These types allow you to add instructions to strings and symbols, which is useful for style-aware data visualization.
- Sys.username() Method: You can now get the name of the current user using the Sys.username() method. Added methods for checking access rights — Sys.isreadable() and Sys.iswritable().
- New methods for strings and collections: The eachrsplit() method now lets you split a string from the end, and the reachnge() function creates logarithmic sequences. The allequal() method checks the equality of all elements of the collection, and allunique() checks for uniqueness.
Changes in base libraries:
- write(::IO, ::AbstractArray) method: Array writing to the stream is now done recursively for each element, which improves compatibility with the read! method.
- New Standard Library StyledStrings: Introduced a library for styled text display. Using the @styled_str macro allows you to create annotated strings with different styles such as color and decorations.
Obsolete and remote methods:
- Removal of Base.map, Iterators.map, and single-argument foreach methods: These methods are no longer supported and have been removed.
External dependencies:
- libuv update: In the new version of Julia, the libuv library has been updated from 1.44.2 to 1.48.0, which improves the handling of system resources.
- Replacing tput with terminfo: The tput method for checking terminal capabilities is no longer used, it has been replaced by terminfo analysis, implemented entirely in the Julia language.
Tool improvements:
- Automatic type checking in CI: CI now automatically checks the types of merge requests, which improves code stability.
Julia 1.11 brought many changes that improved performance, parallel processing, memory management, and enhanced functionality for scientific and high-performance computing. You can get acquainted with the full list
right here
.