Typescript equivalent for R


So, the javascript community (actually Microsoft) developed typescript as an (optionally) typed language that compiles to plain javascript and is a superset of javascript itself. The idea there is that for large projects destined to production it is most helpful to have type checking at compile time so as to fail early and loudly. Since I started studying javascript/typescript I have been wondering whether it would not be helpful to have a similar project for R, i.e., to have a superset language of R that compiles to plain R and allows for type checking at compile time. I think it might be useful in a production context to avoid all the usual pitfalls of dynamic typing and type conversions in R. Any opinions on the feasibility/usefulness of this?


I for one am a huge fan of TypeScript, and am intrigued by the idea for R. R definitely feels like a significantly different animal to me than JavaScript, but I don’t know enough about the underlying architecture to really comment on the feasibility. I will be curious to see what others’ thoughts are.

A related idea that might fit the bill for the present is Hadley’s strict package: designed to make R a little stricter and deal with some related problems up front.