Skip to content
felix-andreasPublic

About

An extremely fast R language server and code formatter, written in Rust.

Topics

Resources

Stars

21 stars

Watchers

1 watching

Forks

Repository files navigation

ry

A toolchain for R, written in Rust.

Docs · Releases · VS Code · Zed

ry is a language server, checker, formatter, and console for R. It analyzes source code without running it, so it reports problems as you type and needs no R installation except for the console.

Its parser is written for tooling: it says what is missing and keeps analyzing the rest of the file.

planets <- c("Mercury", "Venus" "Earth", "Mars")

syntax-error: missing `,` between these arguments

R reports the same mistake as Error: unexpected string constant in "planets <- c("Mercury", "Venus" "Earth"".

Install

  • VS Code: the extension bundles the binary.
  • Binary: download 0.3.1-beta. GitHub's "latest" release is an old build from when ry was called Roughly. The 0.3.1-beta Linux binary, also bundled in the extension, starts only under Nix, so build from source on Linux.
  • Cargo: cargo install --git https://github.com/felix-andreas/ry ry-lang.
ry check    # report problems
ry fmt      # format in place (--check for CI)
ry server   # the language server; your editor starts it
ry repl     # an R console with typed completion (needs R)

Type checking

ry includes a static type checker for R. It infers types from how values are used, so existing code needs no annotations, and the ones you write are #: comments, so files stay plain R. It is opt-in:

# ry.toml
[check]
typing = true

R is too dynamic to check completely, so ry checks what can be described statically and treats the rest as Unknown, which never causes an error by itself. The tour shows the type system in short examples, and limitations says what it cannot check.

Development

Development and architecture describe the code, the test suites, and the design.

License

UPL-1.0 © Felix Andreas

About

An extremely fast R language server and code formatter, written in Rust.

Topics

Resources

Stars

21 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages