skip to main content
10.1145/2576195.2576205acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedingsconference-collections
research-article

A fast abstract syntax tree interpreter for R

Published: 01 March 2014 Publication History

Abstract

Dynamic languages have been gaining popularity to the point that their performance is starting to matter. The effort required to develop a production-quality, high-performance runtime is, however, staggering and the expertise required to do so is often out of reach of the community maintaining a particular language. Many domain specific languages remain stuck with naive implementations, as they are easy to write and simple to maintain for domain scientists. In this paper, we try to see how far one can push a naive implementation while remaining portable and not requiring expertise in compilers and runtime systems. We choose the R language, a dynamic language used in statistics, as the target of our experiment and adopt the simplest possible implementation strategy, one based on evaluation of abstract syntax trees. We build our interpreter on top of a Java virtual machine and use only facilities available to all Java programmers. We compare our results to other implementations of R.

References

[1]
P. S. Abrams. An APL machine. Ph.D. thesis, Stanford University, 1970.
[2]
R. A. Becker, J. M. Chambers, and A. R. Wilks. The new S language: a programming environment for data analysis and graphics. Wadsworth and Brooks/Cole Advanced Books & Software, 1988.
[3]
C. Chambers and D. Ungar. Making pure object oriented languages practical. In Proceedings of Object-Oriented Programming Systems, Languages and Applications (OOPSLA), 1991.
[4]
S. Chirokoff, C. Consel, and R. Marlet. Combining program and data specialization. Higher-Order and Symbolic Computation, 12 (4), 1999.
[5]
D. Eddelbuettel and C. Sanderson. RcppArmadillo: accelerating R with high-performance C++ linear algebra. Computational Statistics & Data Analysis, 71, 2014.
[6]
B. Fulgham and D. Bagley. The computer language benchmarks game. http://benchmarksgame.alioth.debian.org, 2013.
[7]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of Programming Language Design and Implementation (PLDI), 2009. http://doi.acm.org/10.1145/1542476.1542528.
[8]
R. Ihaka and R. Gentleman. R: A language for data analysis and graphics. Journal of Computational and Graphical Statistics, 5 (3), 1996.
[9]
D. McNamee, J. Walpole, C. Pu, C. Cowan, C. Krasic, A. Goel, P. Wagle, C. Consel, G. Muller, and R. Marlet. Specialization tools and techniques for systematic optimization of system software. ACM Transactions on Computer Systems, 19 (2), 2001.
[10]
F. Morandat, B. Hill, L. Osvald, and J. Vitek. Evaluating the design of the R language. In Proceedings of European Conference on Object-Oriented Programming (ECOOP), 2012.
[11]
L. Osvald. R shootout. http://r.cs.purdue.edu/hg/r-shootout, 2012.
[12]
R Development Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, 2008. http://www.r-project.org.
[13]
D. Smith. The R ecosystem. In R User Conference (UseR), 2011.
[14]
J. Talbot, Z. DeVito, and P. Hanrahan. Riposte: a trace-driven compiler and parallel VM for vector code in R. In Proceedings of Parallel Architectures and Compilation Techniques (PACT), 2012.
[15]
L. Tierney. A Byte Code Compiler for R. University of Iowa, 2012. http://homepage.stat.uiowa.edu/ luke/R/compiler/compiler.pdf.
[16]
S. Urbanek. R benchmark 2.5. http://r.research.att.com/benchmarks, 2008.
[17]
Würthinger, Wimmer, Wöß, Stadler, Duboscq, Humer, Richards, Simon, and Wolczko}Truf13T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, the ACM Symposium on New Ideas in Programming and Reflections on Software, 2013.

Cited By

View all
  • (2023)Reusing Just-in-Time Compiled CodeProceedings of the ACM on Programming Languages10.1145/36228397:OOPSLA2(1176-1197)Online publication date: 16-Oct-2023
  • (2023)AST vs. Bytecode: Interpreters in the Age of Meta-CompilationProceedings of the ACM on Programming Languages10.1145/36228087:OOPSLA2(318-346)Online publication date: 16-Oct-2023
  • (2022)A fast in-place interpreter for WebAssemblyProceedings of the ACM on Programming Languages10.1145/35633116:OOPSLA2(646-672)Online publication date: 31-Oct-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
VEE '14: Proceedings of the 10th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments
March 2014
236 pages
ISBN:9781450327640
DOI:10.1145/2576195
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 March 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. lazy evaluation
  2. r language
  3. specialization

Qualifiers

  • Research-article

Conference

VEE '14

Acceptance Rates

VEE '14 Paper Acceptance Rate 18 of 56 submissions, 32%;
Overall Acceptance Rate 80 of 235 submissions, 34%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)36
  • Downloads (Last 6 weeks)6
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Reusing Just-in-Time Compiled CodeProceedings of the ACM on Programming Languages10.1145/36228397:OOPSLA2(1176-1197)Online publication date: 16-Oct-2023
  • (2023)AST vs. Bytecode: Interpreters in the Age of Meta-CompilationProceedings of the ACM on Programming Languages10.1145/36228087:OOPSLA2(318-346)Online publication date: 16-Oct-2023
  • (2022)A fast in-place interpreter for WebAssemblyProceedings of the ACM on Programming Languages10.1145/35633116:OOPSLA2(646-672)Online publication date: 31-Oct-2022
  • (2020)Contextual dispatch for function specializationProceedings of the ACM on Programming Languages10.1145/34282884:OOPSLA(1-24)Online publication date: 13-Nov-2020
  • (2020)A trustworthy mechanized formalization of RACM SIGPLAN Notices10.1145/3393673.327694653:8(13-24)Online publication date: 6-Apr-2020
  • (2019)Generating precise error specifications for C: a zero shot learning approachProceedings of the ACM on Programming Languages10.1145/33605863:OOPSLA(1-30)Online publication date: 10-Oct-2019
  • (2019)Casting about in the dark: an empirical study of cast operations in Java programsProceedings of the ACM on Programming Languages10.1145/33605843:OOPSLA(1-31)Online publication date: 10-Oct-2019
  • (2019)DProf: distributed profiler with strong guaranteesProceedings of the ACM on Programming Languages10.1145/33605823:OOPSLA(1-24)Online publication date: 10-Oct-2019
  • (2019)Compiler fuzzing: how much does it matter?Proceedings of the ACM on Programming Languages10.1145/33605813:OOPSLA(1-29)Online publication date: 10-Oct-2019
  • (2019)Mergeable replicated data typesProceedings of the ACM on Programming Languages10.1145/33605803:OOPSLA(1-29)Online publication date: 10-Oct-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media