vix.ing · top · new · best · stats · spec

Enhancing R with Advanced Compilation Tools and Methods

2014/05/01 by Duncan Temple Lang · 1 citation
Computer Science · Decision Sciences · Mathematics · #Advanced Data Storage Technologies #Artificial intelligence #Code (set theory) #Code generation #Compiler #Computer science #Distributed and Parallel Computing Systems #Domain-specific language #Dynamic compilation #Just-in-time compilation #Key (lock) #Leverage (statistics) #Machine code #Operating system #Parallel computing #Programming language #Scientific Computing and Data Management #Set (abstract data type) #Software #cs.MS #cs.PL #stat.CO

paper · pdf · doi:10.1214/13-sts462

published as Statistical Science 2014, Vol. 29, No. 2, 181-200 · Published in at http://dx.doi.org/10.1214/13-STS462 the Statistical Science (http://www.imstat.org/sts/) by the Institute of Mathematical Statistics (http://www.imstat.org)

openalex publication_date 2014/05/01 · arxiv created 2014/09/09 · arxiv updated 2014/09/12 · openalex created_date 2025/10/10 · openalex updated_date 2026/08/05

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 can be compiled to work with different data representations and sources, and that could even be run outside of R. The approach aims to both provide a compiler for a limited subset of the R language and also to enable R programmers to write other compilers. This is another approach to help us write high-level descriptions of what we want to compute, not how.

Cited by