From osklyar at ebi.ac.uk  Wed May 23 12:11:21 2007
From: osklyar at ebi.ac.uk (Oleg Sklyar)
Date: Wed, 23 May 2007 11:11:21 +0100
Subject: [Rd] inline C/C++ in R: question and suggestion
In-Reply-To: <81DA0149-0F04-4315-BDFD-D3A9284D200E@r-project.org>
References: <46532F64.9030203@ebi.ac.uk>
	<81DA0149-0F04-4315-BDFD-D3A9284D200E@r-project.org>
Message-ID: <46541349.6030907@ebi.ac.uk>

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

Best,
Oleg



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