[Rd] inline C/C++ in R: question and suggestion
osklyar at ebi.ac.uk
Wed May 23 12:11:21 CEST 2007
> That is actually a (rare) case that can be completely vectorized:
Thanks for the vectorization solution.
> I really like the idea! Except for the fact that it's forcing the use of
> C++ which adds unnecessary overhead :P
I can make it optional. I was just thinking that C++ would be more
general than C. I was also asked to create a .C interface, which to me
has the only difference that one needs to preallocate the result. But
the same is easy to implement by pre-allocating an R variable and
passing it as an argument with NULL return.
> I'd like a configurable extension
> [including .m] and the ability to prepend functions as code. What would
> be very useful now is a set of tools that would allow you to construct
> the source with R commands, so that you could compute on it, edit it
:) It would be nice, but I doubt it is feasible at all and if yes, the
overhead will be enormous, especially weighted by the number of people
However, what I would consider reasonable is to have such an inline
interface to more than just C and C++. There is something for Ruby I
think, but one could think of generalizing it somehow.
More information about the R-devel