rnabioco / valr

Genome Interval Arithmetic in R
http://rnabioco.github.io/valr/
Other
88 stars 25 forks source link

Drop Rcpp #362

Closed jayhesselberth closed 3 years ago

jayhesselberth commented 4 years ago

@kriemo do you have a sense for how much work this would be? Several tidyverse packages have recently dropped Rcpp in favor of native C code.

kriemo commented 4 years ago

I don't have much experience with C, so it would be a lot of work as most of our C++ uses the STL. Maybe 2-3 weeks of full time work? I am not sure however if any performance gains would outweigh the additional costs associated with managing and maintaining a larger C code base.

I also haven't found any issues with using Rcpp and have benefitted from the Rcpp community/documentation to fall back on for help. Overall I would advocate for staying with Rcpp unless there are some very clear examples of how using native C would significantly increase performance.

jayhesselberth commented 4 years ago

We wouldn't have to re-write any of the C++ logic, only the return types.

This was done systematically for the xml2 package, see this commit and other "convert" commits.

At a minimum, it might be a useful exercise to dig into the guts of the C interaface to R.

kriemo commented 4 years ago

I see, that makes sense, thanks for linking the xml2 examples. I agree that it would be useful to understand the C interface in more detail and wouldn't mind experimenting with dropping Rcpp.

Should we assign ourselves to individual functions to get started?

jayhesselberth commented 4 years ago

I had a go at this and don't this it's worth it.