So I work in either C or R depending on how intense the need for computation vs the need for being able to actually work with your objects is, but never really tried to interface the two. About two weeks ago, however, I decided to give it the C/R interface a whirl as I was working on a package to do some sampling and a function I wanted was just a slight modification of existing C code that interfaced with R. So I tried doing that and it worked, but it was horribly, horribly painful. I barely survived. Anyway, then I spun that package off and put it on CRAN (the big repository of R packages that is guarded by cranky-pants troglodytes), because I wanted to also see how that process was and I felt that I might as well have something to show for my battles with C. After all, if I wanted this thing done quickly, somebody else might as well. So, I now have a package with a lot of C in it on CRAN.
Anyway, so last week one of my colleagues presented a quick intro to Rcpp so I started giving that a whirl for another part of a package I'm developing that I spun the C nonsense off of. It is remarkably less painful, though I don't know C++ at all. I program C++ like a C programmer, but that's fine for getting some brute efficiency going. I'm sure if I actually took advantage of templates and vectorization and all that shiny C++ stuff they have lying around it'd be even better, but since I program R like a C programmer (and C like and R coder), this just makes everything fly. They really do make things easy. I had one simple thing that sped up 30x from a naive R implementation.
Other stuff: my grandfather (the last of my grandparents) turned 90 this weekend. His own father lived to 87.
More: I've got to finish up my work. I'm behind. I've got to get out of here by the summer regardless.
|< I'm a complete banker|