R Melts Brains -- An IR for First-Class Environments and Lazy Effectful Arguments

07/11/2019
by   Olivier Flückiger, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/18/2020

Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments

Programmers often add meaningful information about program semantics whe...
research
11/08/2017

Correctness of Speculative Optimizations with Dynamic Deoptimization

High-performance dynamic language implementations make heavy use of spec...
research
03/22/2023

Practical compilation of fexprs using partial evaluation: Fexprs can performantly replace macros in purely-functional Lisp

Macros are a common part of Lisp languages, and one of their most lauded...
research
09/10/2020

JCoffee: Using Compiler Feedback to Make Partial Code Snippets Compilable

Static program analysis tools are often required to work with only a sma...
research
12/15/2022

On (the Lack of) Code Confidentiality in Trusted Execution Environments

Trusted Execution Environments (TEEs) have been proposed as a solution t...
research
07/23/2020

Dataflow Analysis With Prophecy and History Variables

Leveraging concepts from state machine refinement proofs, we use prophec...
research
08/31/2023

Comparing Rapid Type Analysis with Points-To Analysis in GraalVM Native Image

Whole-program analysis is an essential technique that enables advanced c...

Please sign up or login with your details

Forgot password? Click here to reset