Recent Releases of extendr

extendr - extendr v0.8.0 🚀

This release of extendr has some significant changes that we are very excited by. This release also ensures that R packages pass R CMD check on R-devel.

extendr-ffi

Firstly, a new crate, extendr-ffi is introduced which replaces the dependency onlibR-sys in extendr-api. extendr-ffi contains a subset of R's C bindings that are used by extendr. extendr-ffi also contains backports for deprecated C functions ensuring compatibility across all versions of R from 4.2 onwards.

Multiple impl blocks

One major improvement is the ability to have multiple #[extendr] impl blocks in a package. Each module can contain one impl block per struct / enum. To enable this change, structs must also have an #[extendr] attribute macro annotation.

Example: ```rs use extendr_api::prelude::*; //now required if impl block function // takes Self or returns Self #[extendr] struct Counter { n: i32, } mod create { use super::*; #[extendr] impl Counter { fn new() -> Self { Self { n: 0 } } } extendr_module! { mod create; impl Counter; } } mod increment { use super::*; #[extendr] impl Counter { fn get(&self) -> i32 { self.n } fn increment(&mut self) { self.n += 1 } } extendr_module! { mod increment; impl Counter; } } extendr_module! { mod counter; use create; use increment; } ``` See https://github.com/extendr/extendr/pull/882

Migration from 0.7.1 -> 0.8.0

Below is a rough guide to migrate from 0.7.1 to 0.8.0.

First, install the development version of {rextendr}

r remotes:install_github("extendr/rextendr")

Bump the version of your R package:

r usethis::use_version("patch")

Delete your Makevars and Makevars.win files. Important if you are using additional linkers, be sure to note these and add them to your Makevars.in and Makevars.win.in later.

Open src/rust/Cargo.toml and:

  • under [package] add rust-version = "1.65.0" or your MSRV if it is different than extendr
  • under [dependencies] set extendr-api = "0.8.0"
  • If libR-sys is included, remove it as extendr-ffi replaces it.

For any #[extendr] impls, be sure to add #[extendr] on the struct or enum as shown in the above heading.

Run

r rextendr::use_extendr()

When prompted do not delete Cargo.toml and lib.rs. Do overwrite configure, configure.win, tools/msrv.R.

Delete your Cargo.lock file to ensure that re-vendoring succeeds.

Run

r rextendr::document() rextendr::vendor_pkgs()

Update your NEWS.md

Submit to CRAN :rocket:

What's Changed

  • JOSS paper citation by @CGMossa in https://github.com/extendr/extendr/pull/817
  • Add tests for extendr features by @JosiahParry in https://github.com/extendr/extendr/pull/815
  • Improve derive macros by @CGMossa in https://github.com/extendr/extendr/pull/818
  • Don't rely on prelude in extendr-macros by @CGMossa in https://github.com/extendr/extendr/pull/824
  • CHANGELOG by @CGMossa in https://github.com/extendr/extendr/pull/819
  • [docs] Various small link fixes by @CGMossa in https://github.com/extendr/extendr/pull/823
  • Documentation: Adjusting README by @CGMossa in https://github.com/extendr/extendr/pull/822
  • Less ambigious return type for colnames/rownames by @CGMossa in https://github.com/extendr/extendr/pull/801
  • Support for Option<Strings>, Option<Doubles>, and friends by @CGMossa in https://github.com/extendr/extendr/pull/802
  • Update rstest requirement from 0.19.0 to 0.22.0 by @dependabot in https://github.com/extendr/extendr/pull/836
  • Mark isvalidstring as non-API by @JosiahParry in https://github.com/extendr/extendr/pull/842
  • Patch release PR: 0.7.1 by @CGMossa in https://github.com/extendr/extendr/pull/844
  • Add PartialEq for Rstr by @CGMossa in https://github.com/extendr/extendr/pull/845
  • Add missing impls to ExternalPtr<T> by @CGMossa in https://github.com/extendr/extendr/pull/833
  • Try again: Type-checking ExternalPtr<T> by downcasting.. by @CGMossa in https://github.com/extendr/extendr/pull/853
  • Soundness: Robj must be transparent by @CGMossa in https://github.com/extendr/extendr/pull/855
  • Added conversions to tuples of up to size 12 by @CGMossa in https://github.com/extendr/extendr/pull/857
  • Hotfix: Mishandling NULL pointer by @CGMossa in https://github.com/extendr/extendr/pull/861
  • Add conversions into [T;N] by @CGMossa in https://github.com/extendr/extendr/pull/856
  • Fix cargo msrv CI check by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/867
  • chore: bump faer to 0.20 by @JosiahParry in https://github.com/extendr/extendr/pull/870
  • Chore/add from iterator implementations by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/879
  • Add support for 4D and 5D matrices by @andyquinterom in https://github.com/extendr/extendr/pull/875
  • Extendr proc refactor - multiple impl blocks and struct converions by @jtlandis in https://github.com/extendr/extendr/pull/882
  • chore: avoid r-devel check by @JosiahParry in https://github.com/extendr/extendr/pull/883
  • Implement Index and IndexMut for 3D Array (RMatrix3D) by @wenjie1991 in https://github.com/extendr/extendr/pull/897
  • fix: Backports, R-devel WARNINGs by @JosiahParry in https://github.com/extendr/extendr/pull/888
  • Use full path in macros by @CGMossa in https://github.com/extendr/extendr/pull/868
  • Generalize HashMap conversion by @CGMossa in https://github.com/extendr/extendr/pull/854
  • update: Don't export faer and ndarray and their contents in prelude by @CGMossa in https://github.com/extendr/extendr/pull/832
  • Minor internal change: Use variable $(TARGET_DIR) by @CGMossa in https://github.com/extendr/extendr/pull/903
  • chore: ensure build.rs always succeeds by @JosiahParry in https://github.com/extendr/extendr/pull/904
  • chore: set up R in docs CI step by @JosiahParry in https://github.com/extendr/extendr/pull/905
  • extendr-ffi: remove unnecessary static mut from bindings by @CGMossa in https://github.com/extendr/extendr/pull/906
  • Preparing for Release v0.8.0 by @CGMossa in https://github.com/extendr/extendr/pull/907

New Contributors

  • @jtlandis made their first contribution in https://github.com/extendr/extendr/pull/882

Full Changelog: https://github.com/extendr/extendr/compare/v0.7.0...extendr-api-v0.8.0

Scientific Software - Peer-reviewed - Rust
Published by JosiahParry 9 months ago

extendr - v0.7.0

What's Changed

  • Use ty for types in macros instead of tokens tt by @CGMossa in https://github.com/extendr/extendr/pull/636
  • Add .Generic symbol by @CGMossa in https://github.com/extendr/extendr/pull/639
  • Added single_threaded on things by @CGMossa in https://github.com/extendr/extendr/pull/642
  • Use [workspace.package] in Cargo.toml by @yutannihilation in https://github.com/extendr/extendr/pull/640
  • [internal] Add CLI tool for extendr developers by @CGMossa in https://github.com/extendr/extendr/pull/611
  • Add get_mut to deal with unsoundness of Robj by @CGMossa in https://github.com/extendr/extendr/pull/644
  • xtask: Add r-cmd-check by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/648
  • [CI] Use cargo extendr r-cmd-check to run {extendrtests} by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/649
  • set_class returns the same object! by @CGMossa in https://github.com/extendr/extendr/pull/653
  • Fix notes on extendrtests/README.md by @CGMossa in https://github.com/extendr/extendr/pull/651
  • hotfix for RMatrix's new_matrix by @CGMossa in https://github.com/extendr/extendr/pull/661
  • Update README to latest version by @CGMossa in https://github.com/extendr/extendr/pull/662
  • Refactor passing of &str to r by @CGMossa in https://github.com/extendr/extendr/pull/643
  • Refurbished #635: Replace mechanism for single-threaded access to R-API by @CGMossa in https://github.com/extendr/extendr/pull/658
  • Update toml_edit requirement from 0.20.2 to 0.21.0 by @dependabot in https://github.com/extendr/extendr/pull/670
  • Bump extendrtests version by @CGMossa in https://github.com/extendr/extendr/pull/676
  • Remove MSYS2 from CI by @CGMossa in https://github.com/extendr/extendr/pull/675
  • Tiny improvent to Raw by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/682
  • Clarify .inherits() behavior by @JosiahParry in https://github.com/extendr/extendr/pull/689
  • Use public RSPM in both setup-r workflows by @JosiahParry in https://github.com/extendr/extendr/pull/690
  • fix: should not use @docType "package" by @eitsupi in https://github.com/extendr/extendr/pull/685
  • Fix compilation with features result_list and result_condition by @eitsupi in https://github.com/extendr/extendr/pull/686
  • Fix a likely regression in new pwsh version by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/699
  • Bump baptiste0928/cargo-install from 2 to 3 by @dependabot in https://github.com/extendr/extendr/pull/696
  • Update toml_edit requirement from 0.21.0 to 0.22.6 by @dependabot in https://github.com/extendr/extendr/pull/704
  • Add user-documentation to S4 by @CGMossa in https://github.com/extendr/extendr/pull/680
  • [Doc] mention i32 in RMatrix::new_matrix() by @JosiahParry in https://github.com/extendr/extendr/pull/707
  • fix ci: r-devel now uses rtools44 by default by @CGMossa in https://github.com/extendr/extendr/pull/711
  • ci: Upload results of r-cmd-check by @CGMossa in https://github.com/extendr/extendr/pull/712
  • Initialize empty RMatrix by @CGMossa in https://github.com/extendr/extendr/pull/654
  • Implement IntoRobj for Dataframe by @JosiahParry in https://github.com/extendr/extendr/pull/713
  • Remove data-field from RArray by @CGMossa in https://github.com/extendr/extendr/pull/657
  • followup to #657 by @CGMossa in https://github.com/extendr/extendr/pull/717
  • fixex throw_r_error may crash R session #716 by @CGMossa in https://github.com/extendr/extendr/pull/718
  • Use error instead of panic! in extendr-macros by @yutannihilation in https://github.com/extendr/extendr/pull/634
  • xtask add more features by @CGMossa in https://github.com/extendr/extendr/pull/719
  • extendr-impl: Support returning &Self and &mut Self by @CGMossa in https://github.com/extendr/extendr/pull/722
  • Fix #[extendr] conversions into Dataframe<T> by @CGMossa in https://github.com/extendr/extendr/pull/723
  • Update rstest requirement from 0.18.1 to 0.19.0 by @dependabot in https://github.com/extendr/extendr/pull/734
  • Added unsafe SendSEXP to ownership-module by @CGMossa in https://github.com/extendr/extendr/pull/666
  • Add TryFrom for ExternalPtr by @CGMossa in https://github.com/extendr/extendr/pull/730
  • nit: an early-return branch should also UNPROTECT() by @yutannihilation in https://github.com/extendr/extendr/pull/741
  • Various documentation updates by @CGMossa in https://github.com/extendr/extendr/pull/748
  • Bump peaceiris/actions-gh-pages from 3 to 4 by @dependabot in https://github.com/extendr/extendr/pull/733
  • Remove unnecessary constraints on ExternalPtr<T> by @CGMossa in https://github.com/extendr/extendr/pull/747
  • Introduce optional faer support by @0urobor0s in https://github.com/extendr/extendr/pull/706
  • Add Attributes to all vector types by @CGMossa in https://github.com/extendr/extendr/pull/745
  • xtask: Minor documentation addition by @CGMossa in https://github.com/extendr/extendr/pull/751
  • extendr-macros: Accept argument alias with mut in front by @CGMossa in https://github.com/extendr/extendr/pull/752
  • Replaces SEXPTYPE and Rboolean to the new enum-versions by @CGMossa in https://github.com/extendr/extendr/pull/742
  • Various maintenance by @CGMossa in https://github.com/extendr/extendr/pull/754
  • Update CHANGELOG by @CGMossa in https://github.com/extendr/extendr/pull/756
  • Fix integerish conversions by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/757
  • Convert integer-ish values based on f64::classify() by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/758
  • use-try-from = true as default by @CGMossa in https://github.com/extendr/extendr/pull/759
  • [urgent!] #[extendr]-impl requires libR-sys by @CGMossa in https://github.com/extendr/extendr/pull/762
  • Clean-up after #759 by @CGMossa in https://github.com/extendr/extendr/pull/760
  • extendrtests: added null externalptr test by @CGMossa in https://github.com/extendr/extendr/pull/769
  • STANDALONE: Removing unnecessary clones by @CGMossa in https://github.com/extendr/extendr/pull/772
  • Faster string conversion by @CGMossa in https://github.com/extendr/extendr/pull/761
  • STANDALONE: ExternalPtr is a pointer by @CGMossa in https://github.com/extendr/extendr/pull/765
  • STANDALONE: Re-use ExternalPtr creation method by @CGMossa in https://github.com/extendr/extendr/pull/766
  • STANDALONE: faer isn't in the prelude by @CGMossa in https://github.com/extendr/extendr/pull/764
  • #[extendr]-impl: Return the right reference by @CGMossa in https://github.com/extendr/extendr/pull/726
  • bug: removed &[u32] interpretation of Robj by @CGMossa in https://github.com/extendr/extendr/pull/767
  • [error handling]: Ensure all arguments are dropped by @CGMossa in https://github.com/extendr/extendr/pull/781
  • Bug fix: Don't use libR_sys in macros by @CGMossa in https://github.com/extendr/extendr/pull/792
  • Remove libR-sys from extendrtests permanently by @CGMossa in https://github.com/extendr/extendr/pull/793
  • Updates libR-sys by @andyquinterom in https://github.com/extendr/extendr/pull/798
  • Update main README.md by @CGMossa in https://github.com/extendr/extendr/pull/795
  • Updating documentation everywhere by @CGMossa in https://github.com/extendr/extendr/pull/784
  • Added mutable slices from AsTypedSlice to TryFrom by @CGMossa in https://github.com/extendr/extendr/pull/790
  • Add names<-, dim<- and dimnames<- to RArray and friends by @CGMossa in https://github.com/extendr/extendr/pull/796
  • [internal] Adjust path for extendrtests by @CGMossa in https://github.com/extendr/extendr/pull/810
  • Fix unnecessary note when running CMD CHECK by @dfalbel in https://github.com/extendr/extendr/pull/811
  • [urgent] fix: relying on specific behavior for List::iter by @CGMossa in https://github.com/extendr/extendr/pull/782
  • [urgent] Update non-API for CRAN by @CGMossa in https://github.com/extendr/extendr/pull/809
  • Lower MSRV for CRAN Compliance by @CGMossa in https://github.com/extendr/extendr/pull/812
  • Preparing for 0.7.0 release by @CGMossa in https://github.com/extendr/extendr/pull/814

New Contributors

  • @0urobor0s made their first contribution in https://github.com/extendr/extendr/pull/706
  • @andyquinterom made their first contribution in https://github.com/extendr/extendr/pull/798

Full Changelog: https://github.com/extendr/extendr/compare/v0.6.0...v0.7.0

Scientific Software - Peer-reviewed - Rust
Published by CGMossa over 1 year ago

extendr - v0.6.0-joss

What's Changed

  • Use ty for types in macros instead of tokens tt by @CGMossa in https://github.com/extendr/extendr/pull/636
  • Add .Generic symbol by @CGMossa in https://github.com/extendr/extendr/pull/639
  • Added single_threaded on things by @CGMossa in https://github.com/extendr/extendr/pull/642
  • Use [workspace.package] in Cargo.toml by @yutannihilation in https://github.com/extendr/extendr/pull/640
  • [internal] Add CLI tool for extendr developers by @CGMossa in https://github.com/extendr/extendr/pull/611
  • Add get_mut to deal with unsoundness of Robj by @CGMossa in https://github.com/extendr/extendr/pull/644
  • xtask: Add r-cmd-check by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/648
  • [CI] Use cargo extendr r-cmd-check to run {extendrtests} by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/649
  • set_class returns the same object! by @CGMossa in https://github.com/extendr/extendr/pull/653
  • Fix notes on extendrtests/README.md by @CGMossa in https://github.com/extendr/extendr/pull/651
  • hotfix for RMatrix's new_matrix by @CGMossa in https://github.com/extendr/extendr/pull/661
  • Update README to latest version by @CGMossa in https://github.com/extendr/extendr/pull/662
  • Refactor passing of &str to r by @CGMossa in https://github.com/extendr/extendr/pull/643
  • Refurbished #635: Replace mechanism for single-threaded access to R-API by @CGMossa in https://github.com/extendr/extendr/pull/658
  • Update toml_edit requirement from 0.20.2 to 0.21.0 by @dependabot in https://github.com/extendr/extendr/pull/670
  • Bump extendrtests version by @CGMossa in https://github.com/extendr/extendr/pull/676
  • Remove MSYS2 from CI by @CGMossa in https://github.com/extendr/extendr/pull/675
  • Tiny improvent to Raw by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/682
  • Clarify .inherits() behavior by @JosiahParry in https://github.com/extendr/extendr/pull/689
  • Use public RSPM in both setup-r workflows by @JosiahParry in https://github.com/extendr/extendr/pull/690
  • fix: should not use @docType "package" by @eitsupi in https://github.com/extendr/extendr/pull/685
  • Fix compilation with features result_list and result_condition by @eitsupi in https://github.com/extendr/extendr/pull/686
  • Fix a likely regression in new pwsh version by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/699
  • Bump baptiste0928/cargo-install from 2 to 3 by @dependabot in https://github.com/extendr/extendr/pull/696
  • Update toml_edit requirement from 0.21.0 to 0.22.6 by @dependabot in https://github.com/extendr/extendr/pull/704
  • Add user-documentation to S4 by @CGMossa in https://github.com/extendr/extendr/pull/680
  • [Doc] mention i32 in RMatrix::new_matrix() by @JosiahParry in https://github.com/extendr/extendr/pull/707
  • fix ci: r-devel now uses rtools44 by default by @CGMossa in https://github.com/extendr/extendr/pull/711
  • ci: Upload results of r-cmd-check by @CGMossa in https://github.com/extendr/extendr/pull/712
  • Initialize empty RMatrix by @CGMossa in https://github.com/extendr/extendr/pull/654
  • Implement IntoRobj for Dataframe by @JosiahParry in https://github.com/extendr/extendr/pull/713
  • Remove data-field from RArray by @CGMossa in https://github.com/extendr/extendr/pull/657
  • followup to #657 by @CGMossa in https://github.com/extendr/extendr/pull/717
  • fixex throw_r_error may crash R session #716 by @CGMossa in https://github.com/extendr/extendr/pull/718
  • Use error instead of panic! in extendr-macros by @yutannihilation in https://github.com/extendr/extendr/pull/634
  • xtask add more features by @CGMossa in https://github.com/extendr/extendr/pull/719
  • extendr-impl: Support returning &Self and &mut Self by @CGMossa in https://github.com/extendr/extendr/pull/722
  • Fix #[extendr] conversions into Dataframe<T> by @CGMossa in https://github.com/extendr/extendr/pull/723
  • Update rstest requirement from 0.18.1 to 0.19.0 by @dependabot in https://github.com/extendr/extendr/pull/734
  • Added unsafe SendSEXP to ownership-module by @CGMossa in https://github.com/extendr/extendr/pull/666
  • Add TryFrom for ExternalPtr by @CGMossa in https://github.com/extendr/extendr/pull/730
  • nit: an early-return branch should also UNPROTECT() by @yutannihilation in https://github.com/extendr/extendr/pull/741
  • Various documentation updates by @CGMossa in https://github.com/extendr/extendr/pull/748
  • Bump peaceiris/actions-gh-pages from 3 to 4 by @dependabot in https://github.com/extendr/extendr/pull/733
  • Remove unnecessary constraints on ExternalPtr<T> by @CGMossa in https://github.com/extendr/extendr/pull/747
  • Introduce optional faer support by @0urobor0s in https://github.com/extendr/extendr/pull/706
  • Add Attributes to all vector types by @CGMossa in https://github.com/extendr/extendr/pull/745
  • xtask: Minor documentation addition by @CGMossa in https://github.com/extendr/extendr/pull/751
  • extendr-macros: Accept argument alias with mut in front by @CGMossa in https://github.com/extendr/extendr/pull/752
  • Replaces SEXPTYPE and Rboolean to the new enum-versions by @CGMossa in https://github.com/extendr/extendr/pull/742
  • Various maintenance by @CGMossa in https://github.com/extendr/extendr/pull/754
  • Update CHANGELOG by @CGMossa in https://github.com/extendr/extendr/pull/756
  • Fix integerish conversions by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/757
  • Convert integer-ish values based on f64::classify() by @Ilia-Kosenkov in https://github.com/extendr/extendr/pull/758
  • use-try-from = true as default by @CGMossa in https://github.com/extendr/extendr/pull/759
  • [urgent!] #[extendr]-impl requires libR-sys by @CGMossa in https://github.com/extendr/extendr/pull/762
  • Clean-up after #759 by @CGMossa in https://github.com/extendr/extendr/pull/760
  • extendrtests: added null externalptr test by @CGMossa in https://github.com/extendr/extendr/pull/769
  • STANDALONE: Removing unnecessary clones by @CGMossa in https://github.com/extendr/extendr/pull/772
  • Faster string conversion by @CGMossa in https://github.com/extendr/extendr/pull/761
  • STANDALONE: ExternalPtr is a pointer by @CGMossa in https://github.com/extendr/extendr/pull/765
  • STANDALONE: Re-use ExternalPtr creation method by @CGMossa in https://github.com/extendr/extendr/pull/766
  • STANDALONE: faer isn't in the prelude by @CGMossa in https://github.com/extendr/extendr/pull/764
  • #[extendr]-impl: Return the right reference by @CGMossa in https://github.com/extendr/extendr/pull/726
  • bug: removed &[u32] interpretation of Robj by @CGMossa in https://github.com/extendr/extendr/pull/767
  • [error handling]: Ensure all arguments are dropped by @CGMossa in https://github.com/extendr/extendr/pull/781
  • Bug fix: Don't use libR_sys in macros by @CGMossa in https://github.com/extendr/extendr/pull/792
  • Remove libR-sys from extendrtests permanently by @CGMossa in https://github.com/extendr/extendr/pull/793
  • Updates libR-sys by @andyquinterom in https://github.com/extendr/extendr/pull/798
  • Update main README.md by @CGMossa in https://github.com/extendr/extendr/pull/795
  • Updating documentation everywhere by @CGMossa in https://github.com/extendr/extendr/pull/784
  • Added mutable slices from AsTypedSlice to TryFrom by @CGMossa in https://github.com/extendr/extendr/pull/790
  • Add names<-, dim<- and dimnames<- to RArray and friends by @CGMossa in https://github.com/extendr/extendr/pull/796
  • [internal] Adjust path for extendrtests by @CGMossa in https://github.com/extendr/extendr/pull/810
  • Fix unnecessary note when running CMD CHECK by @dfalbel in https://github.com/extendr/extendr/pull/811
  • [urgent] fix: relying on specific behavior for List::iter by @CGMossa in https://github.com/extendr/extendr/pull/782
  • [urgent] Update non-API for CRAN by @CGMossa in https://github.com/extendr/extendr/pull/809

New Contributors

  • @0urobor0s made their first contribution in https://github.com/extendr/extendr/pull/706
  • @andyquinterom made their first contribution in https://github.com/extendr/extendr/pull/798

Full Changelog: https://github.com/extendr/extendr/compare/v0.6.0...v0.6.0-joss

Scientific Software - Peer-reviewed - Rust
Published by CGMossa over 1 year ago

extendr - v0.4.0

For release notes, please refer to the changelog: https://github.com/extendr/extendr/blob/master/CHANGELOG.md#040

Scientific Software - Peer-reviewed - Rust
Published by multimeric almost 3 years ago