Extendr - a rust R extension package.

We are developing a Rust extension mechanism for R here:

Rust is likely to be the successor to C++ because of its safety and ease of use.
In particular, it is possible to write domain specific languages within Rust code
and generate wrappers to other languages through procedural macros.
Rust has tens of thousands of excellent packages and it is our hope to be able
to automate the wrapping of general rust packages to provide a vast range of extra
R packages for free.

It would be very nice if we could have some help with RStudio integration including build
testing and CI support.

2 Likes

Hi,
I don't know Rust, but I've heard good things! I just wanted to point out that, if this is a feature request for the IDE, you might want to file it in the RStudio IDE repo:

The link below will open up the feature-request template there for you:
RStudio IDE issue tempalte: feature request.


aside: Guessing you already know about this, but just in case:

Hi Mara,

Nice to hear from you. One of our developers is having build issues under RStudio
and it might be useful to diagnose the problem.

As for an IDE extension, Rust has a number of excellent language servers (RLS and Rust analyser that handle hover events and annotate code with types. It would be an interesting project for someone
to integrate these, but that would be a far bigger ask :slight_smile:

Andy

Joroen has done some excellent work introducing R users to Rust
using the .C interface, but for this to be useful, we need to be able to
wrap functions and interfaces in an automated way through the .Call
interface which is a lot more complex.

Saying this, the two systems are highly complementary and I've provided
the raw interface, libR-sys so that alternate mechanisms can be supported.

1 Like

In that case, I'd definitely open an issue in the repo (or at least put this in the RStudio IDE category).

I'll ask him to raise an issue then. It would be great to be running in the RStudio
environment.

Andy

Thank you for your effort! I am just looking for something like this.

Can we write functions in Rust and then call them from R? Do you have a tutorial of doing that?

Still early days yet, so no tutorials.

There are a few examples of R -> Rust, but the converse is also possible
as the Rust language is very flexible.

The current task is to generate the R package which integrates the DLL bindings
into R packages. The aim is to make the generation of rust functions as frictionless
as possible.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.