[Rd] R as a scripting engine
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sun Jan 11 21:18:33 CET 2009
Those of you tracking R development will have noticed that we are
moving towards using R as a scripting engine. (It is often overlooked
as such.) Thus far INSTALL, REMOVE, SHLIB and massage-examples have
been moved to R.
Reasons:
- it is platform-independent and needs no other tools installed.
No need to worry about strange 'sh' variants (as on AIX and in the
past on Mac OS X) or to track Perl version changes and miniumun
requirements.
- it is fast. Shell scripts are notoriously slow[*] on Windows as
launching a new process there is relatively much slower than on a
Unix-alike, to the extent that we have had to use Perl scripts on
Windows. The actual script of INSTALL in R runs twice as fast as the
shell script on Unix or the Perl script on Windows. (In part this
comes about because R scripts can be pre-parsed if put in a package:
the 1150 lines of INSTALL was taking a couple of seconds to parse.)
- it is much easier to maintain. We only need one version, and any R
user should be able to folllow it (and any member of R-core to
maintain it). And one version means only one set of the
documentation and automatically keeping things in step.
- R has lots of useful features, including automatic support of
(for files) different line endings and encodings.
Of course there is the one-time cost of doing the conversion, which
has been triggered here by the need for new functionality. It also
means that there are minor changes to merge the Unix and Windows
versions. (Some of you will be hearing from Uwe Ligges about use of
undocumented variables in Windows configure/Makevars.win, for
example.)
In due course we see phasing out the use of Perl, at least at run time
(and that might even be for 2.9.0).
[*] Running configure under Cygwin took over an hour on a fairly
laoded Windows box earlier in the week.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-devel
mailing list