Skip to content

Releases: yutannihilation/savvy

v0.5.3 (2024-04-16)

16 Apr 16:31
Compare
Choose a tag to compare

Release Notes

New features

  • Savvy now catches crash not only on the debug build, but also on the release
    build if panic = "unwind". Instead, now savvy-cli init generates a
    Cargo.toml with a release profile of panic = "abort". You need to modify
    this setting if you really want to catch panics on the release build.

  • savvy-cli update now ensures .Rbuildignore contains ^src/rust/.cargo$
    and ^src/rust/target$.

  • savvy-cli test now uses OS's cache dir instead of the .savvy directory.

Fixed bugs

  • Now savvy-cli test works for other crates than savvy.

Download savvy-cli 0.5.3

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

v0.5.2 (2024-04-14)

14 Apr 13:23
Compare
Choose a tag to compare

Release Notes

New features

  • Now savvy's debug build (when DEBUG envvar is set to true, i.e.,
    devtools::load_all()), panic doesn't crash R session and shows bactrace.
    This is useful for investigating what's the cause of the panic.

    Please keep in mind that, in Rust, panic is an unrecoverable error. So,
    not crashing doesn't mean you are saved.

  • savvy-cli test no longer relies on the savvy R package.

Fixed bugs

  • Fixed a bug in try_from_iter() when the actual length is different than the
    size reported by size_hint().

  • savvy-cli test now uses the local crate as the path dependency, instead of
    using the savvy crate fixedly.

Download savvy-cli 0.5.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

v0.5.1 (2024-04-13)

13 Apr 08:17
Compare
Choose a tag to compare

Release Notes

New features

  • An experimental new subcommand savvy-cli test runs tests by extracting and
    wrapping the test code with a temporary R package. This is because savvy
    always requires a real R session, which means cargo test doesn't work. Note
    that this relies on the savvy R package. Please install it before trying this.

    install.packages("savvy", repos = c("https://yutannihilation.r-universe.dev", "https://cloud.r-project.org"))
  • savvy-cli init now generates Makevars that supports debug build when
    DEBUG envvar is set to true (i.e., in devtools::load_all()).

Download savvy-cli 0.5.1

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

v0.5.0 (2024-04-05)

05 Apr 00:14
Compare
Choose a tag to compare

Release Notes

Breaking change

  • To support enum properly (the details follow), now savvy requires to put
    #[savvy] macro also on struct.

    #[savvy]   // NEW!
    struct Person {
        pub name: String,
    }
    
    #[savvy]
    impl Person {

    This might be a bit inconvenient on the one hand, but, on the other hand,
    several good things are introduced by this change! See the New Features
    section.

New features

  • Now #[savvy] macro supports enum to express the possible options for a
    parameter. This is useful when you want to let users specify some option
    without fear of typo. See the guide for more details.

    Example:

    /// @export
    #[savvy]
    enum LineType {
        Solid,
        Dashed,
        Dotted,
    }
    
    /// @export
    #[savvy]
    fn plot_line(x: IntegerSexp, y: IntegerSexp, line_type: &LineType) -> savvy::Result<()> {
        match line_type {
            LineType::Solid => {
                ...
            },
            LineType::Dashed => {
                ...
            },
            LineType::Dotted => {
                ...
            },
        }
    }
    plot_line(x, y, LineType$Solid)
  • Savvy now allows impl definition over multiple files. It had been a headache
    that it wouldn't compile when you specified #[savvy] on impl of a same
    struct multiple times. But now, you can split the impl not only within a
    same file but also over multiple files.

    Note that, in general, if you specify a #[savvy] function or struct in other
    file than lib.rs, you need to export the objects by *. This is because
    #[savvy] defines additional functions other than the original ones and these
    also need to be exported. Since you don't know the names of such
    auto-generated functions, * is the solution.

    mod foo;
    pub use foo::*;
  • OwnedListSexp and ListSexp gains unchecked_*() variants of the set and
    get methods for a fast but unsafe operation. Thanks @daniellga!

Download savvy-cli 0.5.0

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

v0.4.2 (2024-04-01)

01 Apr 22:51
Compare
Choose a tag to compare

Release Notes

New features

  • OwnedIntegerSexp and etc now have try_from_iter() method for constructing
    a new instance from an iterator.

    Example:

    #[savvy]
    fn filter_integer_odd(x: IntegerSexp) -> savvy::Result<Sexp> {
        // is_na() is to propagate NAs
        let iter = x.iter().copied().filter(|i| i.is_na() || *i % 2 == 0);
        let out = OwnedIntegerSexp::try_from_iter(iter)?;
        out.into()
    }
  • OwnedIntegerSexp and etc now have try_from_slice() method for constructing
    a new instance from a slice or vec. This conversion is and has been possible
    via try_from(), but this method was added for discoverability.

  • OwnedIntegerSexp and etc now have try_from_scalar() method for
    constructing a new instance from a scalar value (e.g. i32). This conversion
    is and has been possible via try_from(), but this method was added for
    discoverability.

  • savvy-cli update and savvy-cli init now tries to parse the Rust files
    actually declared by mod keyword.

Download savvy-cli 0.4.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

v0.4.1 (2024-03-30)

30 Mar 05:01
Compare
Choose a tag to compare

Release Notes

Breaking changes

  • Sexp loses is_environment() method becuase this isn't useful, considering
    savvy doesn't support environment.

New features

  • get_dim() and set_dim() are now available also on Sexp.

  • Now savvy allows to consume the value behind an external pointer. i.e., T
    instead of &T or &mut T as the argument. After getting consumed, the
    pointer is null, so any function call on the already-consumed R object results
    in an error. See the guide for more details.

    Example:

    struct Value {};
    struct Wrapper { inner: Value }
    
    #[savvy]
    impl Value {
      fn new() -> Self {
        Self {}
      }
    }
    
    #[savvy]
    impl Wrapper {
      fn new(value: Value) -> Self {
        Self { inner: value }
      }
    }
    v <- Value$new()
    w <- Wrapper$new(v)  # value is consumed here.
    
    w <- Wrapper$new(v)
    #> Error: This external pointer is already consumed or deleted
  • Sexp now has assert_integer() etc to verify the type of the underlying
    SEXP is as expected.

Download savvy-cli 0.4.1

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

v0.4.0 (2024-03-27)

27 Mar 09:00
Compare
Choose a tag to compare

Release Notes

Breaking changes

  • #[savvy] on a struct's impl now generates the same name of R object that
    holds all the accociated functions. For example, previously the below code
    generates a constructor Person(), but now the constructor is available as
    Person$new().
struct Person {
    pub name: String,
}

/// @export
#[savvy]
impl Person {
    fn new() -> Self {
        Self {
            name: "".to_string(),
        }
    }
}

New Features

  • A struct marked with #[savvy] can be used as the return type of the
    associated function. In conjunction with the change in v0.3.0, now a
    user-defined struct can be used more flexibly than before. Please refer to
    the "Struct" section of the guide
  • An experimental support on complex is added under compex feature flag.
    ComplexSexp and OwnedComplexSexp are the corresponding Rust types.
  • OwnedIntegerSexp and etc now have set_na(i) method for shorthand of
    set_elt(i, T::na()). This is particularly useful for OwnedLogicalSexp
    because its setter interface set_elt() only accepts bool and no missing
    values.

Fixed bugs

  • An expert-only method new_without_init() now skips initialization as
    intended.

Download savvy-cli 0.4.0

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

v0.3.0 (2024-03-24)

24 Mar 14:53
Compare
Choose a tag to compare

Release Notes

New Features

  • Now user-defined struct can be used as an argument of #[savvy]-ed functions.
    It must be specified as &Ty or &mut Ty, not Ty.

Example:

struct Person {
    pub name: String,
}

#[savvy]
impl Person {
    fn get_name(&self) -> savvy::Result<savvy::Sexp> {
        let name = self.name.as_str();
        name.try_into()
    }
}

#[savvy]
fn get_name_external(x: &Person) -> savvy::Result<savvy::Sexp> {
    x.get_name()
}

Fixed bugs

  • Previously, savvy-cli init and savvy-cli update didn't handle the package
    name properly ("packageName" vs "package_name"). Now it's fixed.

Breaking changes

  • While this is described in the New Features section, it was already allowed to
    specify user-defined structs as argument if the user defines the necessary
    TryFrom implementations propoerly. At that time, specifying it without &
    was possible, but now it's not allowed. Anyway, as this was undocumented and
    expert-only usage, I expect no one notices this breaking change.

Download savvy-cli 0.3.0

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

v0.2.20 (2024-03-23)

23 Mar 05:42
Compare
Choose a tag to compare

Release Notes

New Features

  • LogicalSexp and OwnedLogicalSexp now have as_slice_raw() method. This
    is an expert-only function which might be found useful when you really need
    to distinguish NAs.

Minor improvements

  • savvy-cli init now generates <dllname>-win.def to avoid the infamous
    "export ordinal too large" error on Windows.

Download savvy-cli 0.2.20

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

v0.2.18 (2024-03-11)

11 Mar 15:38
Compare
Choose a tag to compare

Release Notes

Minor improvements

  • The version requirement is a bit more strict now.

Download savvy-cli 0.2.18

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