All Projects → extendr → Extendr

extendr / Extendr

Licence: mit
R extension library for rust designed to be familiar to R users.

Programming Languages

rust
11053 projects
r
7636 projects

Projects that are alternatives of or similar to Extendr

Arxivscraper
A python module to scrape arxiv.org for specific date range and categories
Stars: ✭ 121 (-9.02%)
Mutual labels:  api-wrapper
Cphalcon
High performance, full-stack PHP framework delivered as a C extension.
Stars: ✭ 10,534 (+7820.3%)
Mutual labels:  extension
Skip Silence
🔇 Chrome extension to skip silent parts in videos and audio files on any webpage
Stars: ✭ 130 (-2.26%)
Mutual labels:  extension
Dwwxpay
微信支付/订单查询
Stars: ✭ 122 (-8.27%)
Mutual labels:  extension
Service Worker Detector
This extension detects if a website registers a Service Worker.
Stars: ✭ 124 (-6.77%)
Mutual labels:  extension
Anyapi
AnyAPI is a library that helps you to write any API wrappers with ease and in pythonic way.
Stars: ✭ 126 (-5.26%)
Mutual labels:  api-wrapper
Genesis
Almighty Book Downloader
Stars: ✭ 120 (-9.77%)
Mutual labels:  extension
Plugin.video.catchuptvandmore
Replay, Live TV and websites videos addon for Kodi
Stars: ✭ 131 (-1.5%)
Mutual labels:  extension
Kdeconnect Chrome Extension
A browser extension to send pages and content from your browser to connected KDE Connect devices.
Stars: ✭ 124 (-6.77%)
Mutual labels:  extension
Lockbox Extension
Experimental Firefox extension for login management experiences, not being actively developed
Stars: ✭ 130 (-2.26%)
Mutual labels:  extension
Span Tree
🌳 Tree for GitLab
Stars: ✭ 123 (-7.52%)
Mutual labels:  extension
Reverseextension
A UITableView extension that enables cell insertion from the bottom of a table view.
Stars: ✭ 1,631 (+1126.32%)
Mutual labels:  extension
Nocoin
No Coin is a tiny browser extension aiming to block coin miners such as Coinhive.
Stars: ✭ 1,586 (+1092.48%)
Mutual labels:  extension
Ttv aderaser
TTV AdEraser aims to remove livestream ads as well as add some useful features to our favourite streaming site.
Stars: ✭ 122 (-8.27%)
Mutual labels:  extension
Spotify.py
🌐 API wrapper for Spotify 🎶
Stars: ✭ 131 (-1.5%)
Mutual labels:  api-wrapper
Php Ext Xlswriter
🚀 PHP Extension for creating and reader XLSX files.
Stars: ✭ 1,734 (+1203.76%)
Mutual labels:  extension
Fastai Extensions Repository
A list of extensions for the fastai library.
Stars: ✭ 125 (-6.02%)
Mutual labels:  extension
Nautilus Git
Nautilus/Nemo extension to add important information about the current git directory
Stars: ✭ 132 (-0.75%)
Mutual labels:  extension
Bittrex.net
A C# .Net wrapper for the Bittrex web API including all features easily accessible and usable
Stars: ✭ 131 (-1.5%)
Mutual labels:  api-wrapper
Lightbeam We
Web Extension version of the Firefox Lightbeam add-on
Stars: ✭ 129 (-3.01%)
Mutual labels:  extension

extendr - A safe and user friendly R extension interface using Rust.

Github Actions Build Status Crates.io Documentation License: MIT

Logo

Installation - Rust

Extendr is available on crates.io.

Simply add this line to the [dependencies] section of a rust crate. You will then be able to call R code from Rust.

[dependencies]
extendr-api = "0.2"

Installation - R

There are two ways you can use the extendr API from R. First, you can use the rextendr package to call individual Rust functions from an R session. Second, you can write an R package that uses compiled Rust code, see the helloextendr repo for a minimal example.

Overview

Extendr is a Rust extension mechanism for R

It is intended to be easier to use than the C interface and Rcpp as Rust gives type safety and freedom from segfaults.

The following code illustrates a simple structure trait which is written in Rust. The data is defined in the struct declaration and the methods in the impl.

use extendr_api::prelude::*;

struct Person {
    pub name: String,
}

#[extendr]
impl Person {
    fn new() -> Self {
        Self { name: "".to_string() }
    }

    fn set_name(&mut self, name: &str) {
        self.name = name.to_string();
    }

    fn name(&self) -> &str {
        self.name.as_str()
    }
}

#[extendr]
fn aux_func() {
}


// Macro to generate exports
extendr_module! {
    mod classes;
    impl Person;
    fn aux_func;
}

The #[extendr] attribute causes the compiler to generate wrapper and registration functions for R which are called when the package is loaded.

The extendr_module! macro lists the module name and exported functions and interfaces.

This library aims to provide an interface that will be familiar to first-time users of Rust or indeed any compiled language.

Anyone who knows the R library should be able to write R extensions.

Goals of the project

Instead of wrapping R objects, we convert to Rust native objects on entry to a function. This makes the wrapped code clean and dependency free. The ultimate goal is to allow the wrapping of existing Rust libraries without markup, but in the meantime, the markup is as light as possible.

#[extendr]
pub fn my_sum(v: &[f64]) -> f64 {
    v.iter().sum()
}

You can interact in more detail with R objects using the RObj type which wraps the native R object type. This supports a large subset of the R internals functions, but wrapped to prevent accidental segfaults and failures.

extendr roadmap

Basic

  • [x] Be able to build simple rust extensions for R.
  • [x] Wrap the R SEXP object safely (Robj)
  • [x] Iterator support for matrices and vectors.
  • [x] Class support.

Documentation

  • [x] Begin documentation.
  • [ ] Begin book-form documentation.
  • [ ] Paper for Bioinformatics.
  • [ ] Build and publish CRAN R package.
  • [ ] Publish Use R! series book.

Automation

  • [x] Auto-generate binding wrappers.
  • [ ] Auto-generate NAMESPACE and lib.R.

Features

  • [ ] Feature-gated support for ndarray.
  • [ ] Feature-gated support for rayon.

R packages

  • [ ] Bindings for rust-bio

Contributing

We are happy about any contributions!

To get started you can take a look at our Github issues.

You can also get in contact via our Discord server!

Development

The documentation for the latest development version is available here: https://extendr.github.io/extendr/extendr_api/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].