skip to main content
research-article

A fast abstract syntax tree interpreter for R

Published:01 March 2014Publication History
Skip Abstract Section

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Chambers and D. Ungar. Making pure object oriented languages practical. In Proceedings of Object-Oriented Programming Systems, Languages and Applications (OOPSLA), 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Chirokoff, C. Consel, and R. Marlet. Combining program and data specialization. Higher-Order and Symbolic Computation, 12 (4), 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Eddelbuettel and C. Sanderson. RcppArmadillo: accelerating R with high-performance C++ linear algebra. Computational Statistics & Data Analysis, 71, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Fulgham and D. Bagley. The computer language benchmarks game. http://benchmarksgame.alioth.debian.org, 2013.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Ihaka and R. Gentleman. R: A language for data analysis and graphics. Journal of Computational and Graphical Statistics, 5 (3), 1996.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Osvald. R shootout. http://r.cs.purdue.edu/hg/r-shootout, 2012.Google ScholarGoogle Scholar
  12. R Development Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, 2008. http://www.r-project.org.Google ScholarGoogle Scholar
  13. D. Smith. The R ecosystem. In R User Conference (UseR), 2011.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. L. Tierney. A Byte Code Compiler for R. University of Iowa, 2012. http://homepage.stat.uiowa.edu/ luke/R/compiler/compiler.pdf.Google ScholarGoogle Scholar
  16. S. Urbanek. R benchmark 2.5. http://r.research.att.com/benchmarks, 2008.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A fast abstract syntax tree interpreter for R

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 49, Issue 7
        VEE '14
        July 2014
        222 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2674025
        Issue’s Table of Contents
        • 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

        Copyright © 2014 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 March 2014

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!