Skip to content

Getting started

ry is a toolchain for R, written in Rust. It is four tools in one binary:

  1. A language server — hover, completion, go-to-definition, references, rename, and inlay hints, in any editor that supports LSP.
  2. A formatter — a single consistent style; no configuration beyond indent width and line endings.
  3. An R console — a REPL with project-aware completion.
  4. A type checker — optional; its inferred types also power the editor features.

It requires no changes to your code, and the same binary runs in your editor and in CI.

Roughly can be used either as a standalone command-line tool or as an extension in supported editors like VS Code:

For detailed instructions or other installation methods (e.g. for RStudio or building from source) see the installation page.

No configuration, no annotations:

Terminal window
ry check
apply_discount <- function(price, rate) {
price * ratee
}
apply_discount(100, 0.2)
unresolved
! I could not resolve `ratee` in this package, its imports, or builtins. Did you mean `rate`?
--[discount.R:2:11]
1 | apply_discount <- function(price, rate) {
2 | price * ratee
| ^^^^^
3 | }
1 problem in 1 file

One transposed letter, found without running anything. R reports the same mistake only when execution reaches that line.

Fix the typo and make a different mistake — one no linter can catch, because catching it requires knowing what a value is:

ry.toml
[check]
typing = true
apply_discount(100, "0.2")
type-mismatch
x expected `double`, found `character`
--[discount.R:5:21]
4 |
5 | apply_discount(100, "0.2")
| ^^^^^

Nothing was annotated. ry worked out that rate is a number because you multiply by it, and that same knowledge is what hover, completion, and the console’s tab completion read. It runs whether or not you turn the errors on.

  • Features — everything you get before configuring anything
  • Tutorial — the type checker on real code
  • Why ry — why this exists, and how far along it is