Jlrs 0.13: LTS, stable, Windows, tokio, and plotting support

jlrs is a crate for the Rust programming language that provides bindings to the Julia C API. As you’re probably well aware, last week a new stable version of Julia was released, version 1.7, and version 1.6 was designated the new LTS version. jlrs 0.13 supports both versions and introduces several other new features.

Windows is supported again, pregenerated bindings are provided for both the stable and LTS version. The only limitation is that there are a few functions that are not yet available for the LTS version on Windows. In order to use the LTS version rather than the stable version on either OS the lts feature must be enabled.

Tokio can now be used as a backing runtime for the async runtime. Previously, only async-std could be used as backing runtime. To choose one, either the tokio-rt or async-std-rt feature must be enabled. The async feature now only exposes the async traits AsyncTask and PersistentTask (which was previously named GeneratorTask), allowing implementations of these traits to be provided by libraries without depending on a backing runtime.

Similarly, the sync runtime provided by Julia is no longer available by default. The sync-rt feature must now be enabled. The same is true for CCall and the ccall feature, and and the derive macros and the jlrs-derive feature.

I hope you haven’t had enough of features, because there’s one more to talk about: pyplot. This new feature uses the PyCall and PyPlot packages in combination with GTK-3 (all of which must be installed) to allow plotting Julia data from Rust.

Finally, it’s no longer required to set the JULIA_DIR environment variable if Julia has been installed globally, the files required to build jlrs can be detected automatically in this case.

Docs.rs
Crate
Github

5 Likes

Cool. I will give it a shot.

With this landing in 1.8, it might open some new use cases for the combo of julia + rust: https://github.com/JuliaLang/julia/pull/41936

The rust toolchain was also recently updated/fixed in BinaryBuilder recently, perhaps that will help compatibility between cargo and a julia runtime linking to rust libs: https://github.com/JuliaPackaging/Yggdrasil/pull/3976#issuecomment-985907412

1 Like