Skip to content

v0.6.2 (2024-05-04)

Compare
Choose a tag to compare
@github-actions github-actions released this 04 May 03:37
· 102 commits to main since this release

Release Notes

New features

  • New macro #[savvy_init] makes the function executed when the DLL is loaded
    by R. This is useful for initializaing resources. See the guide for more details.

    Example:

    use std::sync::OnceLock;
    
    static GLOBAL_FOO: OnceLock<Foo> = OnceLock::new();
    
    #[savvy_init]
    fn init_global_foo(dll_info: *mut DllInfo) -> savvy::Result<()> {
        GLOBAL_FOO.get_or_init(|| Foo::new());
    
        Ok(())
    }
  • Savvy now experimentally supports ALTREP. See the guide for more details.

    Example:

    struct MyAltInt(Vec<i32>);
    
    impl MyAltInt {
        fn new(x: Vec<i32>) -> Self {
            Self(x)
        }
    }
    
    impl savvy::IntoExtPtrSexp for MyAltInt {}
    
    impl AltInteger for MyAltInt {
        const CLASS_NAME: &'static str = "MyAltInt";
        const PACKAGE_NAME: &'static str = "TestPackage";
    
        fn length(&mut self) -> usize {
            self.0.len()
        }
    
        fn elt(&mut self, i: usize) -> i32 {
            self.0[i]
        }
    }

Download savvy-cli 0.6.2

File Platform Checksum
savvy-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
savvy-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
savvy-cli-x86_64-pc-windows-msvc.zip x64 Windows checksum
savvy-cli-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum
savvy-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum