On the Design, Implementation, and Use of Laziness in R
Aviral Goel, Jan Vitek

TL;DR
This paper reviews the design of laziness in R, analyzes extensive package data to understand its practical use, and finds that most programmers do not rely on laziness for efficiency or infinite data handling.
Contribution
It provides a comprehensive review of R's call-by-need implementation and offers a data-driven analysis of how laziness is utilized in real-world R code.
Findings
Most R code does not rely on laziness for efficiency.
Few packages use laziness for meta-programming.
Laziness is rarely used to handle infinite data structures.
Abstract
The R programming language has been lazy for over twenty-five years. This paper presents a review of the design and implementation of call-by-need in R, and a data-driven study of how generations of programmers have put laziness to use in their code. We analyze 16,707 packages and observe the creation of 270.9 B promises. Our data suggests that there is little supporting evidence to assert that programmers use laziness to avoid unnecessary computation or to operate over infinite data structures. For the most part R code appears to have been written without reliance on, and in many cases even knowledge of, delayed argument evaluation. The only significant exception is a small number of packages which leverage call-by-need for meta-programming.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
