R melts brains: an IR for first-class environments and lazy effectful arguments

R melts brains: an IR for first-class environments and lazy effectful arguments
复制标题

R 融化大脑:一流环境和懒惰有效论证的 IR

DOI:
10.1145/3359619.3359744
复制
发表时间:
2019
期刊:
Proceedings of the 15th ACM SIGPLAN International Symposium on Dynamic Languages
影响因子:
--
通讯作者:
J. Vitek
J. Vitek
中科院分区:
--
文献类型:
--
作者:
O. Flückiger;Guido Chari;Jan Jecmen;Ming;Jakob Hain;J. Vitek

文献摘要

被引文献

相似文献

R 编程语言结合了许多被认为难以有效分析和实现的功能:动态类型、反射、惰性求值、向量化基元类型、一流闭包以及本机代码的广泛使用。此外,变量作用域在运行时被具体化为一流环境。这些功能的组合使得大多数静态程序分析技术变得不切实际,因此基于它们的编译器优化无效。我们展示了我们在 PIR 上的工作,这是一种中间表示形式,明确支持一流环境和有效的惰性评估。我们描述了 PIR 上的两种数据流分析:第一种能够推理变量及其环境,第二种推断参数的计算位置。利用他们的结果,我们展示了如何消除环境创建和内联函数。
The R programming language combines a number of features considered hard to analyze and implement efficiently: dynamic typing, reflection, lazy evaluation, vectorized primitive types, first-class closures, and extensive use of native code. Additionally, variable scopes are reified at runtime as first-class environments. The combination of these features renders most static program analysis techniques impractical, and thus, compiler optimizations based on them ineffective. We present our work on PIR, an intermediate representation with explicit support for first-class environments and effectful lazy evaluation. We describe two dataflow analyses on PIR: the first enables reasoning about variables and their environments, and the second infers where arguments are evaluated. Leveraging their results, we show how to elide environment creation and inline functions.