[ANN] A tutorial for jlrs

jlrs is a crate for the Rust programming language for interop between Rust and Julia. You can use it to embed Julia in Rust applications, and to generate interfaces to libraries written in Rust.

This project has finally reached the point where I’m reasonably happy with the API and I expect it to remain more stable than it has used to be, so it felt like the right time to write a tutorial. While documentation has been available since the early versions, it can be hard to read without already being familiar with jlrs. Unlike the documentation, the tutorial introduces concepts one-by-one and provides many examples for clarification.

The tutorial is extensive. It covers both basic topics like setting up a project and calling Julia functions from Rust, and advanced topics like writing a recipe for Yggdrasil. It only assumes familiarity with the Julia and Rust programming languages.

I admit I’m not the best writer, so if you find anything unclear, please open an issue!

Tutorial
GitHub - Tutorial
GitHub - jlrs

34 Likes

I wonder if Typst-Julia interop could benefit from this too.

1 Like

I’m not familiar with Typst, but looking at the docs I think it should be possible to write a binding library for it and use that instead of the executable. I’m not sure if it would be an improvement over the current situation.

1 Like

I wouldn’t call this a tutorial, more like a book! Well done. I was always a bit afraid of using jlrs, but with this guide I plan on rewriting my Julia wrapper of startin. :slight_smile:

2 Likes

Thanks, most sections are pretty short so the index makes it look like it contains more material than it does imo. I’m happy to hear you’re interested in using jlrs, feel free to reach out if you need any input!