[Rcpp-devel] RFC: Rcpp modules vs. RefClass
Dirk Eddelbuettel
edd at debian.org
Tue Nov 29 20:38:56 CET 2016
On 29 November 2016 at 11:12, Hao Ye wrote:
| (I guess one downside of Rcpp modules is the use of external pointers,
| which implies they do not serialize / deserialize well?)
|
|
| I think not at all, unless you can force the same memory location for a new R
| session and everything it loads. This is documented in the Rcpp-modules
| vignette -- I tried it anyway, and it crashed my R session. :)
Right.
And as I recall it is not so much the use of XPtr but rather that it points
to some content in memory for which we don't have a serialization mechanism.
Now, if memory serves, the good folks of the Stan project did in fact build
something related in order to preserve compilation via inline (or a variant)
across sessions so it is not impossible. But it hasn't been done here.
And the bigger point, as Kevin noted, is that Modules is not exactly under
active development.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel
mailing list