This paper describes an R package that allows one to read and generate a description of C and C++ source code elements. These descriptions are meta-data about that C/C++ code and can be used for several different purposes. The most obvious application is to programmatically generate bindings/wrappers which are R functions and C routines that allow R users to invoke the original C/C++ routines from within R. We discuss the mechanics of the package and briefly outline a strategy for generating the mappings between R and arbitrary C/C++ code. We also illustrate how we can create new derived C++ classes, some or all of whose methods can be implemented in R via R functions. The meta-data can also be used to generate registration information for R’s dynamic symbol resolution, identify potential re-factoring for the removal of global variables (leading towards thread-safety), and generally collect data for software metrics and analysis. The package currently provides the primitives for reading and working with the meta-data, and has support for generating bindings for most of the common C and C++ constructs. Additional facilities such as determining memory management and computing call graphs from the body of a routine can be built on top of these primitives. Versions of the package are available at http://www.omegahat.org/RGCCTranslationUnit
References in zbMATH (referenced in 3 articles , 1 standard article )
Showing results 1 to 3 of 3.
- Runnalls, Andrew R.: Aspects of CXXR internals (2011)
- Lang, Duncan Temple: A modest proposal: an approach to making the internal R system extensible (2009)
- Lang, Duncan Temple: Working with meta-data from C/C++ code in R: the RGCCTranslationUnit package (2009)