Skip to content

R bindings#149

Merged
Hiddentale merged 24 commits into
developmentfrom
r_bindings
May 8, 2026
Merged

R bindings#149
Hiddentale merged 24 commits into
developmentfrom
r_bindings

Conversation

@Hiddentale
Copy link
Copy Markdown
Contributor

@Hiddentale Hiddentale commented Apr 15, 2026

Description

Proper idiomatic R bindings. Relevant files are:

crates/cir/src/rust/src/lib.rs
crates/cir/src/rust/src/util.rs

The rest of the files are all generated by extendr and hence do not need to be reviewed.

Related Issues

implements #162 #164 #143

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • I ran cargo fmt --all (code is formatted)
  • I ran cargo clippy --workspace --all-targets -- -D warnings (no warnings)
  • I ran cargo test --workspace (all tests pass)
  • I added tests for new functionality
  • I updated relevant documentation

@Hiddentale Hiddentale self-assigned this Apr 15, 2026
@Hiddentale Hiddentale changed the title chore: initial commit add r bindings Apr 24, 2026
@Hiddentale Hiddentale changed the title add r bindings Add R bindings May 6, 2026
@Hiddentale Hiddentale changed the title Add R bindings R bindings May 8, 2026
@Hiddentale Hiddentale marked this pull request as ready for review May 8, 2026 08:42
Copy link
Copy Markdown

@ol590 ol590 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks idiomatic and logical. However, README file needs to be more precise on what dependencies to install and in which order

@tehinator tehinator self-requested a review May 8, 2026 10:51
Copy link
Copy Markdown

@tehinator tehinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor code quality comments. I think the test names here are a lot clearer than on the rust side, maybe something to look at.


/// Converts a [`TestResult`] into a named R list.
///
/// The returned list always contains a `kind` field identifying the variant:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a name like "return format" would be more informative

/// `data_type` must be one of `"discrete"`, `"continuous"`, or `"mixed"` (case-insensitive).
/// Returns an error for any other value.
#[extendr]
fn list_ci_tests_for(data_type: &str) -> anyhow::Result<Vec<String>> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely certain if having a specialized version of another function is good code quality due to code duplication etc. Don't know if a better alternative is present for this case but maybe worth considering.

Copy link
Copy Markdown

@ol590 ol590 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good. Code has been tested on Linux and runs without errors.

Copy link
Copy Markdown

@ol590 ol590 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works

Copy link
Copy Markdown

@tehinator tehinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything is awesome

@Hiddentale Hiddentale merged commit b298745 into development May 8, 2026
6 checks passed
@Hiddentale Hiddentale deleted the r_bindings branch May 8, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants