An experimental runtime for the R language, written in Rust. (Rōbīgō is Latin for rust.)
robigo aims to run unmodified R code with GNU R's exact behaviour — same printed output, same messages — and then to make it fast: a specializing interpreter, vector fusion, and type information from ry. See docs/design.md for the research behind it, the architecture and the roadmap, and AGENTS.md for the porting contract.
Status: early, but it runs real R code. The parser matches GNU R's on R's
own library sources. robigo boots all of GNU R's base-package R code on top of
627 of R's 760 .Primitive/.Internal functions, starts up like R
(Renviron, profiles, a locked base namespace), and loads installed
packages from a GNU R 4.5.0 library through R's own loadNamespace:
utils, stats, grDevices and graphics work today. robigo cannot load
packages' compiled code, so native routines are ported to Rust (75 of
stats' distribution functions plus 33 others, including R's formula
engine, LINPACK QR, cov, glm families, read.csv/write.csv); a
routine without a port raises an error saying so. lm, glm,
summary, anova, predict, read.csv and write.csv give output
identical to GNU R, and all 157 conformance scripts match byte for byte.
Not yet: S4 (methods), many stats routines (optim, integrate,
fft, splines, ...), packages with compiled code beyond base R's, and
locale-aware string collation. Closures and loops run in a register
bytecode VM, hot loops as Cranelift native code; ROBIGO_COMPILE=0 runs
everything in the AST interpreter and ROBIGO_JIT=0 turns off native code.
ROBIGO_TYPE_PROFILE=out.json records observed types for comparison with
ry (docs/ry-integration.md).
Measured by CI on every merge to main (see
docs/verification.md); every benchmark and corpus
over time is on the progress page.
Nightly binaries for Linux (x86_64, aarch64) and macOS (aarch64,
x86_64) are on the rolling nightly
release
(with SHA256SUMS.txt). Or install from git (Rust 1.99+, a C
compiler; on Linux also zlib1g-dev libbz2-dev):
cargo install --git https://github.com/sims1253/robigo robigo-cliPlatforms, checksums, and the GNU R interplay are in docs/distribution.md.
cargo build --release
target/release/robigo -e 'f <- function(n) if (n < 2) n else f(n - 1) + f(n - 2); f(20)'
target/release/robigo script.R # like Rscript script.R
target/release/robigo # REPL
target/release/robigo parse file.R # parse tree in the oracle dump format(The workspace may build into ~/.cache/cargo-target if your cargo config
sets a shared target directory.)
Parse with robigo-syntax and compute with robigo-numerics from
crates.io; embed the full runtime (a git dependency until it is
publishable):
cargo add robigo-syntax robigo-numerics
cargo add robigo-runtime --git https://github.com/sims1253/robigolet arena = robigo_syntax::Arena::new();
let exprs = robigo_syntax::parse_program(&arena, "1 + 1").unwrap();
let mut interp = robigo_runtime::Interp::new();
robigo_runtime::bootstrap::load_base(&mut interp).unwrap();
interp.run_source("x <- 1 + 1\n", true);Details — library entry points, the crates.io table, and how releases are cut — are in docs/distribution.md.
GNU R 4.5.0 is the oracle:
tests/parse/— parse trees compared with GNU R'sparse(). Regenerate withscripts/regen-parse.sh; run the big corpus (R's own sources) withROBIGO_PARSE_CORPUS=... ROBIGO_PARSE_DUMPS=... cargo test -p robigo-syntax -- --ignored.tests/r/— conformance scripts; stdout/stderr/exit status recorded fromRscriptwithscripts/regen-expected.sh.tests/r/passing/is a ratchet (one marker file per script) of scripts that must keep passing.
cargo test # everything
ROBIGO_CONF_FILTER=tests/r/basics ROBIGO_CONF_DIFF=1 \
cargo test -p robigo-cli --test conformance -- --nocapturecrates/robigo-syntax— lexer and parsercrates/robigo-numerics— nmath and long double arithmeticcrates/robigo-runtime— object model, evaluator, builtins, printingcrates/robigo-core— object model and memory manager (G2)crates/robigo-capi—libR.so, GNU R 4.5's C API (G2)crates/robigo-cli— therobigobinary and conformance runnerrlib/— vendored GNU R base-package R sources (GPL-2+)docs/— design notes (distribution.mdfor installs and releases)
GPL-2.0-or-later, like GNU R, whose sources robigo ports and vendors.
The reference BLAS routines ported in crates/robigo-numerics/src/blas.rs
are LAPACK's, under its modified BSD licence (LICENSE-LAPACK).