hacker news Hacker News
  1. new
  2. show
  3. ask
  4. jobs
TypR is a statically typed language written in Rust that compiles down to plain R code using S3 classes. The goal is to bring type safety to R without leaving the ecosystem — the generated output is idiomatic R you can drop into any existing project.

The compiler uses monomorphization to resolve generic types at compile time, so there's no runtime overhead. The type system supports structural typing, interfaces, and generics. It's still in alpha, but here's what's available so far:

GitHub: https://github.com/we-data-ch/typr

Binaries (Windows/Mac/Linux): https://github.com/we-data-ch/typr/releases

Online playground: https://we-data-ch.github.io/typr-playground.github.io/

VS Code extension with LSP: https://marketplace.visualstudio.com/items?itemName=wedata-c...

Docs (WIP): https://we-data-ch.github.io/typr.github.io/

Known limitations: the standard library is minimal so the user need to type some existing functions/variables with signatures, error messages need work, and the LSP is basic. Positron and Neovim support are in progress.

Would appreciate feedback on the type system design or ideas for use cases that would make this useful in practice.

loading...