On the Design , Implementation, and Use of Laziness in R

被引:6
作者
Goel, Aviral [1 ]
Vitek, Jan [1 ,2 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
[2] Czech Tech Univ, Prague, Czech Republic
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2019年 / 3卷 / OOPSLA期
基金
美国国家科学基金会; 欧洲研究理事会;
关键词
R language; delayed or lazy evaluation;
D O I
10.1145/3360579
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:27
相关论文
共 27 条
[1]  
Augustsson L., 1993, Journal of Functional Programming, V3, P77, DOI 10.1017/S0956796800000617
[2]   REVISED REPORT ON THE ALGORITHMIC LANGUAGE ALGOL-60 [J].
BACKUS, JW ;
BAUER, FL ;
GREEN, J ;
KATZ, C ;
MCCARTHY, J ;
PERLIS, AJ ;
RUTISHAUSER, H ;
SAMELSON, K ;
VAUQUOIS, B ;
WEGSTEIN, JH ;
VANWIJNGAARDEN, A ;
WOODGER, M .
COMMUNICATIONS OF THE ACM, 1963, 6 (01) :1-17
[3]  
Becker R.A., 1988, The new S language: a programming environment for data analysis and graphics
[4]   A Trustworthy Mechanized Formalization of R [J].
Bodin, Martin ;
Diaz, Tomas ;
Tanter, Eric .
DLS'18: PROCEEDINGS OF THE 14TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON DYNAMIC LANGUAGES, 2018, :13-24
[5]   R Melts Brains An IR for First-Class Environments and Lazy Effectful Arguments [J].
Fluckiger, Olivier ;
Chari, Guido ;
Jecmen, Jan ;
Yee, Ming-Ho ;
Hain, Jakob ;
Vitek, Jan .
PROCEEDINGS OF THE 15TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON DYNAMIC LANGUAGES (DLS '19), 2019, :55-66
[6]   Bioconductor: open software development for computational biology and bioinformatics [J].
Gentleman, RC ;
Carey, VJ ;
Bates, DM ;
Bolstad, B ;
Dettling, M ;
Dudoit, S ;
Ellis, B ;
Gautier, L ;
Ge, YC ;
Gentry, J ;
Hornik, K ;
Hothorn, T ;
Huber, W ;
Iacus, S ;
Irizarry, R ;
Leisch, F ;
Li, C ;
Maechler, M ;
Rossini, AJ ;
Sawitzki, G ;
Smith, C ;
Smyth, G ;
Tierney, L ;
Yang, JYH ;
Zhang, JH .
GENOME BIOLOGY, 2004, 5 (10)
[7]  
Hadley W., 2017, Tidyverse: easily install and load the 'tidyverse'. R package version 1.2.1
[8]  
HUDAK P, 1989, COMPUT SURV, V21, P359, DOI 10.1145/72551.72554
[9]  
Hudak P., 2007, HOPL 3, DOI [10.1145/1238844.1238856, DOI 10.1145/1238844.1238856]
[10]   WHY FUNCTIONAL PROGRAMMING MATTERS [J].
HUGHES, J .
COMPUTER JOURNAL, 1989, 32 (02) :98-107