eternal-flame-ad/typed-sexp — explained in plain English
Analysis updated 2026-07-18 · repo last pushed 2024-09-16
Write high-performance R extensions in Rust with type safety against common memory and data-structure errors.
Embed the R statistical engine inside a Rust program to use R's analysis capabilities from Rust code.
Call R functions from Rust with properly typed arguments and safely handle R's garbage collection.
Build computational tools like vector and matrix operations that bridge R and Rust safely.
| eternal-flame-ad/typed-sexp | codeitlikemiley/antigravity-sdk-rust | dedsec-xu/needle | |
|---|---|---|---|
| Stars | 3 | 3 | 3 |
| Language | Rust | Rust | Rust |
| Last pushed | 2024-09-16 | — | — |
| Maintenance | Stale | — | — |
| Setup difficulty | moderate | hard | moderate |
| Complexity | 3/5 | 4/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires understanding of R's internal SEXP objects and a local R installation to build and link against.
Typed-SEXP is a Rust library that lets developers write extensions for the R programming language with better safety guarantees. R is popular for statistics and data analysis, and people often write extensions in faster languages like C++ or Rust to speed up calculations. The problem is that R's internal interface for doing this is notoriously confusing and error-prone. This library gives developers a safer way to interact with R's internal data structures without adding heavy dependencies or complex tooling. At its core, the library wraps R's internal objects, called SEXP objects, in Rust's type system so that mistakes get caught before the code runs. It handles things like safely accessing elements of vectors and matrices, managing memory so objects don't get prematurely cleaned up by R's garbage collector, and calling R functions from Rust with properly typed arguments. It also works the other direction: you can embed R inside a Rust program and use R's capabilities from pure Rust code. The library deliberately stays close to R's actual internals rather than offering a polished, high-level wrapper. The intended user is someone who already understands how R works under the hood and wants to write R extensions in Rust without pulling in large macro-based frameworks. The author specifically avoids macros because they can be hard to debug and can confuse code analysis tools. Existing alternatives like Rcpp and extendr provide more abstraction, but this project takes a minimalist approach: enough type safety to prevent common mistakes, without hiding what's really happening. The project includes a few demos showing practical use cases: vector addition, matrix multiplication, calling closures passed from R, and embedding R in a Rust program. There's also a tongue-in-cheek project called "rasm" that implements inline assembly for R, which doubles as a stress test for the library's stability. The README notes that dynamically creating R functions from Rust is a planned feature but not yet implemented.
A Rust library for writing safe R language extensions by wrapping R's internal data objects in Rust's type system, catching errors before code runs without heavy frameworks or macros.
Mainly Rust. The stack also includes Rust, R.
Stale — no commits in 1-2 years (last push 2024-09-16).
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.