Skip to content

Consider exposing a stable native API for S7 interoperability #788

Closed

Description

@eitsupi

I'm using S7 objects from Rust via savvy in https://github.com/pola-rs/r-polars.

The upcoming S7 1.0.0 changes how class definitions are stored internally (#742), which highlighted that native extensions currently need to rely on implementation details or call back into R.

Would it make sense to expose a small, stable native API through R_RegisterCCallable() / R_GetCCallable()?

Two potentially useful operations are:

  • Retrieve an S7 class definition from an instance, independent of its internal representation.
  • Retrieve an S7 property, respecting custom getters rather than accessing attributes directly.

S7 already implements these operations in C (S7_class_() and prop_()), so exposing suitable wrappers might require relatively little additional code.

This would enable interoperability with Rust bindings such as savvy, as well as C/C++ extensions, without depending on S7 internals.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions