Skip to content

[Rcpp-devel] Rcpp Attributes vs Rcpp Modules

3 messages · Fg Nu, Dirk Eddelbuettel, Dale Smith

#
I recently asked a question about Rcpp Attributes subsuming the
functionality of the inline package here:
http://stackoverflow.com/questions/27744383/is-the-inline-package-redundant-yet-for-rcpp
Dirk confirmed that Rcpp Attributes are fully functional vis-a-vis the
inline package.

As a follow on question, I wanted to know when, if ever, Rcpp
Attributes can fully replace the use of Rcpp Modules. I am aware that
Rcpp Attributes can be used to export standalone functions, but as
mentioned in the Rcpp Modules vignette
(http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf):

"[...] but read on for Rcpp modules which contains to provide features
not covered by Rcpp attributes, particularly when it comes to binding
entire C++ classes and more."

it cannot export entire class definitions. Is this planned
functionality? What are the challenges to implementing this using
Attributes? What are some of the other things that Modules can do that
Attributes cannot?

Thanks.
#
On 3 January 2015 at 21:22, Fg Nu wrote:
| I recently asked a question about Rcpp Attributes subsuming the
| functionality of the inline package here:
| http://stackoverflow.com/questions/27744383/is-the-inline-package-redundant-yet-for-rcpp
| Dirk confirmed that Rcpp Attributes are fully functional vis-a-vis the
| inline package.

That may not be exactly what I said.  The gist of it is: "Use Attributes".
There is no good reason to use inline, besides re-running older examples.  

[ It so happened that the book went to press when Attributes had just emerged
and is therefore still full of inline examples. Everything else we did for
documentation since then -- notably the Rcpp Gallery is full of use case for
Attributes, as it should be. ]
 
| As a follow on question, I wanted to know when, if ever, Rcpp
| Attributes can fully replace the use of Rcpp Modules. I am aware that
| Rcpp Attributes can be used to export standalone functions, but as
| mentioned in the Rcpp Modules vignette
| (http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf):
| 
| "[...] but read on for Rcpp modules which contains to provide features
| not covered by Rcpp attributes, particularly when it comes to binding
| entire C++ classes and more."
| 
| it cannot export entire class definitions. Is this planned
| functionality? What are the challenges to implementing this using
| Attributes? What are some of the other things that Modules can do that
| Attributes cannot?

Attributes can be used with Modules.  Just place your Modules code in a file
and sourceCpp() it.

Will Attributes and inline overlap, Modules is a little different and can be
used with either.

Dirk
#
All,

I was laid off from Fiserv on December 2nd. I found a job with an Atlanta company which does voice recognition. My title will be the grab-bag of Data Scientist. Look for me to subscribe and be active from January 6th onward.

Nexidia is a heavy user of R and Matlab, so my growing Rcpp skills will come in handy, as well as the machine learning courses I?ve taken via Coursera.

I?m not leaving finance permanently, but am broadening my background with R, machine learning, and high performance computing.

Dale Smith