Re: [Rd] inline C/C++ in R: question and suggestion

From: Oleg Sklyar <>
Date: Wed, 23 May 2007 11:11:21 +0100

> 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 using it.

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.

Oleg mailing list Received on Wed 23 May 2007 - 10:39:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 12:33:41 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.