new release and many features. What have the developers added and what has changed?
Released a new version of the Julia 1.11 programming language, which combines high performance with the flexibility of dynamic typing, and also offers built-in tools for parallel programming. The language syntax is similar to MATLAB, includes elements of Ruby and Lisp, and work with strings is reminiscent of Perl. The project is distributed under the MIT license. In general, it’s a good and useful language, which we’ll talk about today. Details are under the cut.
A little history
The Julia programming language was developed in 2009 and released in 2012. Julia was created by Jeff Bezanson, 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 user-friendly 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 ability to perform efficient numerical calculations, and built-in tools for working with parallel tasks.
Main features of the language
- High performance: One of the main goals of Julia is to achieve a level of performance comparable to programs written in C. The language compiler, built on top of LLVM, generates efficient machine code for various target platforms.
- Supports multiple programming paradigms: Julia supports elements of object-oriented and functional programming. The standard library includes functions for asynchronous I/O, process control, logging, profiling, and package management.
- Dynamic typing: Like most scripting languages, variables in Julia do not require explicit types. Interactive mode is supported.
- Optional strong typing: If necessary, 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, thanks to its wide range of built-in data types and support for parallel computing.
- Direct call to C libraries: Julia allows you to directly 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 preferable for tasks where the full functionality of Array is not required, for example, working with multidimensional arrays. The internal implementation of Array methods is now based on Memory, which has resulted in significant speedup for some operations such as push.
- Public Keyword: A new public keyword has been introduced, which is used to mark identifiers that are part of the frontend. Unlike export, such identifiers are not automatically imported in the module context when 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
- ScopedValue package: A new package has been introduced to support dynamic scope for parallel programming using Threads/tasks.
- Manifest.toml files: Renaming Manifest.toml files to Manifest-v{major} format is now supported. {minor}.toml, which allows you to use specific versions of Julia. For example, the file 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 the Unicode 15.1 standard, which expands the ability to work with text in different languages.
Language changes:
- Precompilation and atexit handling: Precompilation now runs the atexit handler, allowing you to safely terminate background tasks and free resources before terminating the program.
- Code coverage files: Code coverage and memory allocation files are no longer created during precompilation. pkgimage caches are now used for packages that are not tracked, speeding up testing and improving performance.
- Processing of the JULIA_DEPOT_PATH variable: Now, when specifying one path in the JULIA_DEPOT_PATH variable, only it will be inserted into the value of the variable. If the path ends with a “:”, system paths are also added.
- Precompilation caches: Precompile cache files can now be moved, and their relevance is checked using hashes of the contents of the source files, rather than by the date the files were modified.
Multithreading improvements:
- New :greedy scheduler mode: A new :greedy scheduler mode has been added to the Threads.@threads macro, which is optimized for tasks with uneven computing load.
- New Base.Lockable structure: A new Base.Lockable structure has been added, which simplifies the code when accessing elements of complex types in parallel, reducing the likelihood of errors.
Compilation and runtime changes:
- Garbage Collector: The garbage collector has been updated to allow entire memory pages to be processed rather than 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 the code.
New command line options:
- Main.main(args) entry point: The Main.main(args) entry point for executing scripts via the command line is now strictly defined. 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: New types have been added for working with annotated text, such as AnnotatedString, AnnotatedChar and AnnotatedIOBuffer. These types allow you to add annotations to strings and characters, which are useful for visualizing style-sensitive data.
- Sys.username() method: Now you can get the name of the current user using the Sys.username() method. Methods for checking access rights have also been added – Sys.isreadable() and Sys.iswritable().
- New methods for strings and collections: The eachrsplit() method now allows you to split a string from the end, and the logrange() function creates logarithmic sequences. The allequal() method checks for equality of all elements in a collection, and allunique() checks for uniqueness.
Changes in base libraries:
- Write(::IO, ::AbstractArray): The array is now written to the stream recursively for each element, improving compatibility with the read! method.
- New standard library StyledStrings: A library for stylized text display has been introduced. Using the @styled_str macro allows you to create annotated strings with different styles such as color and decoration.
Deprecated and removed 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 work with system resources.
- Replacing tput with terminfo: The tput method for checking terminal capabilities is no longer used, it has been replaced by terminfo parsers implemented entirely in Julia.
Tool improvements:
- Automatic type checking in CI: CI now automatically checks types in merge requests, which improves code stability.
Julia 1.11 introduced many changes that improved performance, parallel processing, memory handling, and expanded functionality for scientific and high-performance computing. The full list can be found
.