What we eval in the shadows: a large-scale study of eval in R programs
Aviral Goel, Pierre Donat-Bouillud, Filip Krikava, Christoph M. Kirsch, Jan Vitek
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 3ad31e1f-e1b8-4204-a17f-6b2424f8c849Cited by top-tier papers2
- A study of inline assembly in solidity smart contractsStefanos Chaliasos, Arthur Gervais, Benjamin LivshitsOOPSLA 2022 · 22 citations
- An Empirical Study of WebAssembly Usage in Node.jsMichelle Thalakottur, Maxwell Bernstein, Daniel Lehmann, Michael Pradel et al.ICSE 2026
Builds on1
Related papers
- Designing types for R, empiricallyAlexi Turcotte, Aviral Goel, Filip Krikava, Jan VitekOOPSLA 2020 · 9 citations
- Statically Analyzing the Dataflow of R ProgramsFlorian Sihler, Matthias TichyOOPSLA 2025 · 3 citations
- Promises are made to be broken: migrating R to strict semanticsAviral Goel, Jan Jecmen, Sebastián Krynski, Olivier Flückiger et al.OOPSLA 2021 · 2 citations
- Subtle Bugs Everywhere: Generating Documentation for Data Wrangling CodeChenyang Yang, Shurui Zhou, Jin L. C. Guo, Christian KästnerASE 2021 · 25 citations
- Demystifying Compiler Unstable Feature Usage and Impacts in the Rust EcosystemChenghao Li, Yifei Wu, Wenbo Shen, Zichen Zhao et al.ICSE 2024 · 6 citations
