Designing Types for R, Empirically
summary
A function annotation language and runtime contract checker are built and evaluated: Typetracer is a dynamic tracer on a modified R VM that infers types from package tests and examples, and contractr installs those inferred types as runtime contracts. The corpus covers ~400 well‑tested packages and ~8,000 reverse dependencies; Typetracer records ~90 million assertions with only 2% violations (≈80% of failures involve classes). Results show 33% scalars, 3% NA‑ful types, and ~50% of common manual assertions can be replaced by contracts.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:54Errors in R can go undetected
- 1:42Some folks care about types
- 2:40We built a function type annotation and contract checking framework...
- 3:02R has six vectorized primitive types
- 3:21R users care about scalars
- 4:02R vectors are homogeneous
- 4:32R has values for missing data
- 5:32R is very reflective
- 5:57R also has classes
- 6:36Contract Putting types in the hands of programmers
- 7:15We have ... ... a type language and contract checking framework!
- 7:56Data Collection and Exploration Experimental Design
- 9:40Findings: Expressiveness
- 12:29Findings: Robustness Did client code respect the types?
- 13:42Findings: Usefulness How many existing checks can we elide?
- 14:58Takeaways
related talks
15mStatically Analyzing the Dataflow of R Programs
08mPrevalence of Expression Types in Legislative Text
46mElegant R: Tips from a Software Developer
30mTowards a High Level Linter for Data Science
29mMy Leap from R to F#
47mWhat Makes a Good Function
35mBetter Research Planning Through Simulation
43mInteroperability between R Language & other Languages
