[Rd] C vs. C++ as learning and development tool for R

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jan 19 23:39:35 CET 2007

On 1/19/2007 10:04 AM, Kimpel, Mark William wrote:
> Thanks to all for your excellent suggestions. I think will I proceed
> working through the Stroustrup book. He has a section on comparing C
> with C++ and one on working with legacy C code that may prove helpful. I
> also have a "C for Dummies" (something like that, I don't have it right
> next to me) that I have also been reading. A couple of follow-up
> questions:
> 1. As I understand it, if I just wanted to distribute compiled code, I
> could use whatever extended C or C++ libraries that I wanted to use,
> however, since R is open source and people need to be able to compile
> things themselves, I imagine I would get into trouble (figuratively)
> using, say, the C++ STL. Would I need to distribute these files as well?
> For example, iostream instead of stdio.h. Or, should I just not use
> those?

The STL is available on most platforms, as far as I know.  Some more 
specialized libraries (e.g. GSL, database access, OpenGL) are more trouble.

If you want to use the more specialized ones, I'd try compiling your 
package using the standard build tools on one or two platforms, and see 
what happens.
> 2. For those of you who develop C on Windows (probably a small bunch!),
> what is your preferred development environment? I have the free Borland
> Turbo C++ and Visual C++ 6.0 (I knew enough to stay away from .NET). I
> tried to install the C++ module for Eclipse and, for me at least, it was
> a nightmare. I am not UNIX or DOS savvy and setting path variables and
> the like just made things too complicated.

R uses the MinGW gcc compiler on Windows, so you need to have it 
available to build your packages when you get to that, but it doesn't 
have a nice IDE like those others.  Some purists hate IDEs, but I think 
they are very helpful.  I've never used Turbo C++ and rarely used 
MSVC++, so I can't really recommend one over the other, but I did like 
the Borland IDE for Pascal/Delphi.

Duncan Murdoch

> 3. Lastly, is there a C or C++ community similar to R that I could
> address questions relating to those languages to? I don't want to abuse
> the R list as I learn.
> Thanks,
> Mark
> Mark W. Kimpel MD 
> (317) 490-5129 Work, & Mobile
> (317) 663-0513 Home (no voice mail please)
> 1-(317)-536-2730 FAX
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list