savvy
Savvy is a simple R extension interface using Rust.
This is nothing but my personal challenge to re-invent the wheel in order to get better understanding about what extendr does. While this is usable, ergonomics is not included. If you prefer friendliness, please use extendr.
For the full details, please read savvy's crate documentation.
/// Convert to Upper-case
///
/// @param x A character vector.
/// @export
Getting Started
Prerequisite
Before starting, install a helper R package for savvy.
Note that, under the hood, this is just a simple wrapper around
savvy-cli. So, if you prefer shell, you can directly use the CLI
instead, which is available on the
releases.
Create a new R package
First, create a new package. usethis::create_package() is convenient
for this.
usethis::
Then, move to the package directory and generate necessary files like
Makevars and Cargo.toml, as well as generating C and R wrapper code
corresponding to the Rust code. savvy::savvy_init() does this all
(under the hood, this simply runs savvy-cli init).
Lastly, run devtools::document() to generate NAMESPACE and
documents.
savvy::
devtools::
Now, this package is ready to install!
Update wrapper files
After modifying or adding some Rust code, you can update the C and R
wrapper files by running savvy::savvy_update() (under the hood, this
simply runs savvy-cli update).
savvy::
devtools::