Working with meta-data from C/C++ code in R: the RGCCTranslationUnit package | Computational Statistics Skip to main content
Log in

Working with meta-data from C/C++ code in R: the RGCCTranslationUnit package

  • Original Paper
  • Published:
Computational Statistics Aims and scope Submit manuscript

Abstract

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 one 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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
¥17,985 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (Japan)

Instant access to the full article PDF.

Similar content being viewed by others

References

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Duncan Temple Lang.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Temple Lang, D. Working with meta-data from C/C++ code in R: the RGCCTranslationUnit package. Comput Stat 24, 283–293 (2009). https://doi.org/10.1007/s00180-008-0128-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00180-008-0128-6

Keywords