[Rcpp-devel] Resolving NativeSymbolInfos from Rcpp

Davor Cubranic cubranic at stat.ubc.ca
Fri Jun 11 01:15:47 CEST 2010


On 2010-06-09, at 12:03 PM, Dirk Eddelbuettel wrote:

> ... at a fundamental level, I am not yet sure that 'poking through' an api
> that R Core has sealed is the right idea.  
> 
> My hunch is that I would just take the code to loess_raw and stick it into a
> small utility package so that one could feed it data using Rcpp.

I may end up doing this in the end, but it would be nice not to have to duplicate loess's code.

> | It might be worth formalize that sort of things in a nice Rcpp 
> | abstraction. For example, make a Rcpp::DynamicLibrary class with member 
> | functions to pull these things conveniently.
> 
> That is certainly cool stuff just like Matt's recent blog (via R Bloggers)
> posts that did similar stuff.  I just haven't convinced myself that we should
> really advertise usage like that. 

Romain's solution looks much cleaner to me than Matt's use of 'objdump' and then grepping through its output. Romain simply uses existing advertised R mechanisms, as far as I can see.

I'll have to follow up on R-core on the reasoning why a C routine would be exposed to R, but not to other C code. (I.e., R_RegisterRoutines vs R_RegisterCCallable.) I understand why some symbols would be kept private to a package, but if we think of a layered design with native code sitting below the interpreter, then symbols available to R should also be reachable from C in other packages without tricks like this one.

Davor


More information about the Rcpp-devel mailing list