/savvy-helper-R-package

A Simple Wrapper of 'savvy-cli' Command

Primary LanguageROtherNOASSERTION

savvy (R package)

R-CMD-check

This is a simple wrapper R package around savvy-cli command.

Installation

You can install this package from R-universe.

install.packages("savvy", repos = c("https://yutannihilation.r-universe.dev", "https://cloud.r-project.org"))

Usage

# Run savvy_init() to do the initial setup for using savvy framework
savvy::savvy_init()

# Run savvy_update() to re-generate the C and R wrapper files from the Rust files.
savvy::savvy_update()

# To update savvy, please Run this command to overwrite the existing savvy-cli binary.
savvy::download_savvy_cli()

Also, on-the-fly Rust code compilation is experimentally supported.

savvy::savvy_source('
use savvy::savvy;

#[savvy]
fn hello() -> savvy::Result<()> {
    savvy::r_println!("Hello!!!!!!");
    Ok(())
}
')

hello()
#> Hello!!!!!!