|Julia 1.5 Improves Struct Layout Support|
|Written by Kay Ewbank|
|Monday, 10 August 2020|
Julia has been updated with improvements including struct layouts and allocation optimizations, and stabilization of the multithreading API.
Julia is a dynamic language for technical computing that is especially good at running MATLAB and R-style programs. Development began on Julia at MIT in 2009, and has increased in popularity, recently becoming one of the top six languages for machine learning projects on GitHub.
The development team says this release brings a major, long-desired optimization that can significantly reduce heap allocations in some workloads. Prior to this release, layout optimizations for immutable objects had a significant limitation requiring heap allocation. This has been rectified so immutable objects can now be stack allocated, passed and returned by value, and stored more efficiently inline in arrays and other objects
The multithreading API has also been stabilized and improved. Threading support was greatly improved in version 1.3, and is now widely used. It is no longer considered experimental, and the team is marking most of the thread API as stable. Improvements include better thread-safety of top level expressions, and the SuiteSparse bindings are now thread-safe,
Developers can now choose the optimization level per module to reduce compilation delays when code that isn't performance critical. The compiler performance has also been improved, with some packages loading around 40% faster.
The final main change is that 'soft scope' has been added back in this release. In versions of Julia prior to version 1.0, the language made assumptions about whether a variable should to be local or global. The basic rule was that inside of a loop but outside of any function body—in a so-called "soft scope"— non-global variables were created as local to the loop. This was effective, but some developers found it confusing and inconsistent. Julia 1.0 therefore had a simplified rule, where assigning to a variable in a local scope (function or loop) with no existing local created a new local variable.
While simple, this wasn't popular with everyone, to the extent that that the developers of IJulia (a Julia-language backend combined with the Jupyter interactive environment) added code to rewrite inputs in a way that restored the old pre-1.0 scope behavior. As the Julia team point out, having the commonly-used Jupyter front-end behave differently than the default REPL is not a good situation.
In view of this, the solution in v1.5 is to make the REPL behave like IJulia, and Julia versions 0.6 or earlier while keeping the 1.0 behavior in files, to avoid breaking anybody's code.
Summer SALE Kindle 9.99 Paperback $10 off!!
or email your comment to: firstname.lastname@example.org
|Last Updated ( Monday, 10 August 2020 )|