Skip to main content

Aspects of CXXR Internals

Runnalls, Andrew R. (2010) Aspects of CXXR Internals. Computational Statistics, 26 (3). pp. 182-196. ISSN 0943-4062. (doi:10.1007/s00180-010-0218-0) (The full text of this publication is not currently available from this repository. You may be able to access a copy if URLs are provided)

The full text of this publication is not currently available from this repository. You may be able to access a copy if URLs are provided. (Contact us about this Publication)
Official URL


CXXR is a project to refactor (reengineer) the interpreter of the R language, currently written for the most part in C, into C++. It is hoped that by reorganising the code along object-oriented lines, by deploying the tighter code encapsulation that is possible in C++, and by improving the internal documentation, the project will make it easier for researchers to develop experimental versions of the R interpreter. The design of CXXR endeavours to reconcile three objectives: (a) Above all, to be functionally consistent with standard R, both at the R language level, and at the C/Fortran package interface level. (b) For the core of the interpreter to be written in idiomatic, standards-conforming C++, making best use of the C++ standard library, and providing a well documented C++ API on which C++ package writers can build. (c) To provide a reasonably simple mechanism for CXXR to be upgraded to parallel the continuing evolution of standard R. Development of CXXR started in May 2007, then shadowing R 2.5.1; at the time of this abstract it reflects the functionality of R 2.8.1. An offshoot project is underway to introduce provenance-tracking facilities into CXXR, so that for any R data object it will be possible to determine exactly which original data files it was derived from, and exactly which sequence of operations was used to produce it: in other words, an enhanced version of the old S AUDIT facility. The primary purpose of the proposed paper is to articulate the design philosophy underlying CXXR, and to illustrate it by describing ways in which the internal engineering of CXXR differs substantially from that of standard R, in particular in the following aspects: 1. The mechanisms for memory allocation and garbage collection (currently undergoing a second round of major refactorisation). 2. The CXXR::RObject C++ class hierarchy, which replaces the SEXPREC union. The paper will illustrate the benefits that this offers to package writers, by enabling them to extend this hierarchy with additional C++ classes, and consider to what extent this circumvents the drawbacks that Bates (2001) identified in combining C++ with standard R. 3. The implementation of environments, based around an abstract C++ class CXXR::Frame, and its relation to the RObjectTables package (Temple Lang, 2001). The paper will assume some familiarity with the R language, and with either C++ or Java: aspects of C++ that differ substantially from Java will be explained as required.

Item Type: Article
DOI/Identification number: 10.1007/s00180-010-0218-0
Additional information: Based on a paper delivered at the Directions in Statistical Computing conference (DSC2009), Copenhagen, 2009.
Uncontrolled keywords: determinacy analysis, Craig interpolants
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Faculties > Sciences > School of Computing > Programming Languages and Systems Group
Depositing User: Andrew Runnalls
Date Deposited: 21 Sep 2012 09:49 UTC
Last Modified: 29 May 2019 09:18 UTC
Resource URI: (The current URI for this page, for reference purposes)
  • Depositors only (login required):