What We Eval in the Shadows A Large-Scale Study of Eval in R Programs

被引:1
|
作者
Goel, Aviral [1 ]
Donat-Bouillud, Pierre [2 ]
Krikava, Filip [2 ]
Kirsch, Christoph M. [2 ,3 ]
Vitek, Jan [1 ,2 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
[2] Czech Tech Univ, Prague, Czech Republic
[3] Univ Salzburg, Salzburg, Austria
来源
基金
欧洲研究理事会; 美国国家科学基金会;
关键词
eval; dynamic languages;
D O I
10.1145/3485502
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:23
相关论文
共 50 条