Enhancing R with Advanced Compilation Tools and Methods
Duncan Temple Lang

TL;DR
This paper presents a method to compile R code to native machine code using LLVM, significantly improving performance without modifying R itself, and enabling new computing approaches within R.
Contribution
It introduces a package-based compilation strategy for R that leverages LLVM for cross-platform native code generation and optimization, facilitating high-level, fast, and flexible R programming.
Findings
Significant performance improvements in R code execution.
Ability to compile R idioms directly to native machine code.
Enabling R programmers to develop custom compilers and domain-specific languages.
Abstract
I describe an approach to compiling common idioms in R code directly to native machine code and illustrate it with several examples. Not only can this yield significant performance gains, but it allows us to use new approaches to computing in R. Importantly, the compilation requires no changes to R itself, but is done entirely via R packages. This allows others to experiment with different compilation strategies and even to define new domain-specific languages within R. We use the Low-Level Virtual Machine (LLVM) compiler toolkit to create the native code and perform sophisticated optimizations on the code. By adopting this widely used software within R, we leverage its ability to generate code for different platforms such as CPUs and GPUs, and will continue to benefit from its ongoing development. This approach potentially allows us to develop high-level R code that is also fast, that…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
