A typed superset of R — static type checking, modules, sum types and interfaces, compiled to idiomatic, readable R.
TypR is not a new runtime. It is a static verification and desugaring layer that
compiles entirely to conventional R before execution — every generated R/*.R
file stays readable and runs on a stock R installation. It targets the step
beyond exploratory scripting: package production, maintenance, and code that has
to survive in production.
type Shape <- .Circle(num) | .Square(num);
let area <- fn(s: Shape): num {
match s {
.Circle(r) => 3.14159 * r * r,
.Square(side) => side * side,
}
};
# UFCS, pipes and plain calls are all equivalent
(3.0) |> .Circle() |> area() |> print();
| Channel | Command |
|---|---|
| Cargo | cargo install typr |
| Binaries | latest release — Linux, macOS, Windows (x86_64 + aarch64) |
| Docker | docker run --rm -it fabricehategekimana/typr:latest |
| RStudio / Positron | typr.runner_*.tar.gz from the latest release |
| VS Code / Positron | search TypR in the Marketplace |
All channels are published from the same tag and carry the same version number. See RELEASING.md.
typr new my_package # scaffold a project
typr check # type-check without emitting
typr build # transpile to R/
typr run # build and run
typr test # run testthat suites
typr document # generate .Rd documentation
typr pkgdown # build a documentation website
typr repl # interactive session
typr lsp # language server (used by the editor extensions)crates/typr-core type checking and transpilation
crates/typr-cli command-line interface
crates/typr-lsp language server
crates/typr-wasm WASM build powering the playground
editors/vscode VS Code / Positron extension
editors/rstudio RStudio addins (typr.runner)
docker/ container image
cases/ reproducible bug catalog (`typr case`)
cases/ holds a numbered, reproducible catalog of past bugs with golden
outputs — the best entry point for understanding a behaviour is usually the case
that pinned it down. cargo test --workspace runs the suite.
Apache-2.0