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
期刊:
影响因子:
--
通讯作者:
J. Vitek
中科院分区:
文献类型:
--
作者:
O. Flückiger;Guido Chari;Jan Jecmen;Ming;Jakob Hain;J. Vitek
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.