Automating the interface between R and C/C++ code Duncan Temple Lang We regularly integrate functionality from C/C++ libraries into interactive, interpreted languages such as R, S-Plus, Matlab, etc. This gives us flexibility to call routines in different ways and order than in stand-alone applications and to manipulate the resulting input and output data structures. And this allows us to use both the interpreted language and native code somewhat seamlessly. Unfortunately, creating the code that defines the interface between, e.g., R and the library is time consuming, error prone and requires non-trivial knowledge of both the library and also of the internal data structures of the interpeted system. I'll discuss an approach to automating the creation of the basic details of such interfaces using what is currently called the RGCCTranslationUnit package (www.omegahat.org). This gives the R programmer access to rich descriptions of C/C++ code and provides facilities for creating the R and C/C++ wrappers to interface to arbitrary native libraries. One can extend C++ classes with R functions acting as methods. And one can use R to customize the code generation to provide library-specific knowledge. The approach also however allows for analyzing code programmatically to find details such as in/out variables, memory management regimes and so on. I'll discuss how this compares with tools such as SWIG (www.swig.org).