[R] Compiling R in C / C++

Liaw, Andy andy_liaw at merck.com
Tue Nov 29 15:20:53 CET 2005


Here are just some (probably not very coherent) rambling:

It's not very clear to me what you are looking for.  Are you looking for a
tool that compile R code into a stand-alone application?  That's what the
Matlab compiler does for Matlab code, but AFAIK is _not_ what C++/Connect or
Java/Connect for S-PLUS does.  The latter two just provide means of calling
S code from those two languages (and perhaps the other way around, too, I
don't remember), if I'm not mistaken.

There has been some effort at creating a tool for compiling R code into C.
See http://hipersoft.cs.rice.edu/rcc/index.html.

If I may say so, the tone in your message seems to suggest that you're
simply asking people to do work for free.  (Are you willing to do that
yourself?)  Open Source projects like R need efforts to go both ways.  If
everyone just ask for new features and no one contribute, the project isn't
going to get very far.  If you can not contribute code that you're asking
for, perhaps at the very least you can contribute to the R Foundation.  It's
the least you could do for not paying whatever it was to get
Matlab/Mathematica/S-PLUS but get to use R instead.

Best,
Andy

From: Jordi
> 
> I am interested in being able to use R in my own libraries, 
> written in C++.
> I have seen that in the past several people have asked about this
> possibility. In the book Programming in S it is stated that 
> it is possible
> to call R functions from a C++ called from R. Also, it seems 
> it is possible
> to do something with the R D-COM port, but at least for 
> somebody with my
> limited capabilities (and time) this is not a feasible possibility.
> 
>  
> 
> I have heard in the past days that both Matlab and 
> Mathematica have modules
> that compile the whole code into C++. I think that S-PLUS 
> does something
> similar with C++/Connect. Matlab is going to do something 
> equivalent with C#
> and Java next year.
> 
>  
> 
> These modules are pretty expensive (around 3,000 euros). A 
> question to the R
> popes: wouldn't it be a good idea to do something like this for R?
> Advantages:
> 
> - Many people like the idea to use R as an extended library, 
> and not being
> tied to a given framework, GUI, . even, some things cannot be 
> done with R
> because they need to be implemented in a stand-alone basis;
> 
> - "You have to run to stay in the same place you were" 
> (Alice): if other
> frameworks like Matlab, Mathematica and S-PLUS do it, and if 
> R does not do
> it, "we" are staying behind;
> 
> - If this were implemented in R, the cost would be 0, adding 
> an advantage
> over the other computing frameworks, where the cost of C++ 
> compiling is much
> higher.
> 
>  
> 
> I guess that what I am proposing is easier said that done. I 
> imagine that
> there are many technical problems. There are many other 
> interesting things
> to develop. Time is limited. I know. I am being egoist: I 
> probably would not
> contribute, but I would reap the advantages. I know. But I think the
> proposal makes sense.
> 
>  
> 
> What do people think about it?
> 
>  
> 
> I was just thinking in posting this email in devel, but I thought the
> general forum was better.
> 
>  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list