R packages using Rust

Nan Xiao February 28, 2025 2 min read

TL;DR: I’m curating a list of CRAN R packages that use Rust: https://github.com/nanxstats/r-rust-pkgs.

Dirt bike. Photo by POWERING OFFROAD.
Dirt bike. Photo by POWERING OFFROAD.

Rust in R packages

Rust has been the most admired programming language for nearly a decade. CRAN, the largest public repository for R packages, has also supported integrating Rust in R packages for several years. What’s the magic behind the language?

To me, Rust is a great choice for writing high-performance extensions for both R and Python, offering memory safety and a strong ecosystem. Python has maturin and pyo3, while R benefits from rextendr, an R package that simplifies scaffolding and interfacing with Rust. All of these came from outstanding community contributions that makes writing Rust-powered R packages much easier. For an introduction, I recommend checking out Josiah Parry’s video tutorial, which perfectly explains the R + Rust development workflow.

Why this list?

When learning a new programming language, I often study real-world package examples to understand language-specific engineering best practices. However, to my knowledge, there has not been a centralized way to find R packages that use Rust. To address this, I created nanxstats/r-rust-pkgs, a GitHub repository listing CRAN packages that contain Rust code in alphabetical order.

The list is automatically generated by scanning CRAN package DESCRIPTION files where SystemRequirements contains Cargo (the Rust package manager). Currently, it includes 27 packages. To update the list, simply fork the repo, render the README.Rmd file, and submit a pull request.