What we eval in the shadows: a large-scale study of eval in R programs
Open Access
- 15 October 2021
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 5 (OOPSLA) , 1-23
Abstract
Most dynamic languages allow users to turn text into code using various functions, often named eval, with language-dependent semantics. The widespread use of these reflective functions hinders static analysis and prevents compilers from performing optimizations. This paper aims to provide a better sense of why programmers use eval. Understanding why eval is used in practice is key to finding ways to mitigate its negative impact. We have reasons to believe that reflective feature usage is language and application domain-specific; we focus on data science code written in R and compare our results to previous work that analyzed web programming in JavaScript. We analyze 49,296,059 calls to eval from 240,327 scripts extracted from 15,401 R packages. We find that eval is indeed in widespread use; R’s eval is more pervasive and arguably dangerous than what was previously reported for JavaScript.Keywords
Funding Information
- Ministerstvo ðkolství, Mládeðe a Tðlovðchovy (CZ.02.1.01/0.0/0.0/15_003/0000421)
- NSF (1759736, 1544542, 1925644, 1910850)
- H2020 European Research Council (695412)
This publication has 21 references indexed in Scilit:
- An empirical study on the impact of Python dynamic features on change-proneness2015
- In defense of soundinessCommunications of the ACM, 2015
- Eval begone!2012
- How (and why) developers use the dynamic features of programming languages: the case of smalltalkEmpirical Software Engineering, 2012
- Evaluating the Design of the R Language2012
- The Eval That Men Do2011
- An analysis of the dynamic behavior of JavaScript programsACM SIGPLAN Notices, 2010
- Precise Analysis of String Expressions2003
- R: A Language for Data Analysis and GraphicsJournal of Computational and Graphical Statistics, 1996
- History of LISPACM SIGPLAN Notices, 1978