Julia Community 🟣

Cover image for 3 features just added in Julia 1.8 you won’t want to miss!
Logan Kilpatrick
Logan Kilpatrick

Posted on • Originally published at logankilpatrick.Medium

3 features just added in Julia 1.8 you won’t want to miss!

Julia 1.8 is hot off the GitHub release pipeline jam packed with tons of helpful new features. If you want a full overview of all of the new changes, check out the release blog post from the core development team: https://julialang.org/blog/2022/08/julia-1.8-highlights/
In this post, I will highlight 3 of the features mentioned in the link above which get me the most excited about this release!

Improved support for Apple Silicon 🍎💻

With more and more developers starting to make the transition to using Apple Silicon, the need for open source tools to work well out of the box on this architecture is increasingly more important. Julia 1.8 solves a host of issues related to:

how Julia internally uses LLVM to generate and link the code for this platform and were eventually solved in Julia 1.8 by moving to a more modern linker, which has better support for ARM CPUs on macOS.

While the issues and frequent segmentation faults were fixed for Julia 1.8, the issues could not be back ported to Julia 1.7, so that release will always have issues with Apple Silicon. If you are using Julia 1.7 and were experiencing any of these issues, it is recommended to update to 1.8 since the release changes Apple Silicon to Tier 2 support (with Julia 1.9 likely bringing Tier 1 support for Apple Silicon).

It is awesome to see so much effort being put into getting stability for the Apple Silicon Mac users. As one of those users myself, I have run into a few rough edges during the transition period but for the most part, these issues seems to be quickly decreasing in frequency. Also, in case you missed it, a technical preview of the Metal.jl, the package to program Apple M1 GPUs in Julia, was announced in late June of 2022, find out more on the Julia GPU blog.

The future is bright for M1 Mac Julia users!

Typed globals ⌨️ 🌎

In previous versions of Julia, it was not possible to specify the type of non-constant global variables. In Julia 1.7 and before, the language would give an error like the following if you tried this:

Julia 1.7 REPL showing error with global vars!

In this example, we are trying to set the type of a to be an Int but Julia gives an error when we do so.

In Julia 1.8, you can see the behavior has been updated to support this functionality:

Julia 1.8 showing that global typed vars works

The 1.8 blog post also notes that:

Type annotating global variables removes much (but not all) of the cost of using non-constant global variables.

which is great to hear since a core part of the reason to previously avid global variables was that it introduced a large computational overhead. This change should remove a small sharp edge for new and experienced Julia users alike!

Pkg status update with upgradable package indicator 📦

Anyone who has read any of my previous articles (like this one) knows that the Package Manager in Julia is one of my favorite features. It truly makes doing things in Julia a real pleasure as I can be confident that I am not going to have any weird issues getting things running on my local computer.

With Julia 1.8, another awesome quality of life improvement related to package versions is available. In previous Julia versions, when you run the status command in the package manager, you would get a print out of all the packages in your active environment. While this can be helpful, it does not always give the full context you need if you want to know what version of a package you should be using or the most up to date version available.

Now in Julia 1.8, the package manager gives a visual indication if there is a newer version of one of your installed packages available, as well as if the package version can be successfully updated given the version constraints of the other packages. Let’s take a look at this example from the announcement post:

Image of the Julia Pkg manager from the announcement post showing how the new version indicator works

Here, we can see when we run the st command (short hand for status), we get the different types of up arrows denoting the two different behaviors. This new feature will make it a lot easier to tell if a package has a new available version along with if there’s a reason you can’t update said package.
If you want a little more context on this, I would encourage you to read the full blog post.

Other cool things in Julia 1.8 👀

Julia 1.8 is jam packed with tons of great features. I wanted to highlight three in this post that I was especially excited about. With that said, I would be remiss to not mention some great JuliaCon 2022 talks which highlighted some of the work that took place in 1.8. For starters, Tim Holy and Valentin Churavy did a talk on “Improvements in package precompilation” which were part of Julia 1.8 (I actually already highlighted this video in my other article “5 important talks you might have missed at JuliaCon 2022”):

Another video worth checking out is from Nathan Daly and Pete Vilter on the topic of Hunting down allocations with Julia 1.8’s Allocation Profiler which was a new feature introduced with Julia 1.8:

With so much amazing stuff happening in 1.8, I can only begin to imagine what helpful new features are coming in Julia 1.9 (hopefully more Package Manager stuff)! Stay tuned and please do share with me what features in the release you are most excited for.

Top comments (0)