Re-implementing R in Maxima



I have been using R fairly heavily for a few years now, and have been using
Maxima for about 40 years.  There are certainly things I miss in R that
Maxima has and vice versa.

> ...wouldn't it be more economical to adapt to Maxima some of the coolest
features of R?

Depends what you consider "some of the coolest features of R".

If you mean things like data frames and their handy subscripting
conventions, that would be easy... unless you wanted operations on them to
be as fast as in R.  The first step on the Maxima side would be integrating
machine arrays more cleanly into the Maxima system, as opposed to the
current situation where we have 3-4 different ways of representing numeric
vectors, each with slightly different attributes.

If you mean the enormous library of statistical software, written partly in
R and partly in lower-level languages, that would be hard unless it was done
at arms-length (e.g. call out to R in a separate process).  One problem is
that it is famously difficult to integrate two different runtime systems
which both include reference counts/garbage collection.

If you mean making R compilable by taking advantage of the Lisp compiler,
that is even harder, because R is not designed as a compilable language.
 Many functions in R do tricky things with call-by-need and environment
manipulation without distinguishing between compile-time (macro expansion)
and run-time (execution) semantics.   R often uses symbol names (strings) to
talk about symbols in ways which would be tricky to compile (though I can
certainly think of some good tricks).  Also, Lisp generally doesn't compile
subscripting as efficiently as you'd want for heavy numeric computing.

If you mean making R functionality work with symbolic objects, you would
probably have to rewrite most operations.  Sure, 'sum' is easy, but how
about 'order' or 'quantile' or 'lm'?  It would be neat to do a linear
regression where some inputs were symbolic, but none of the existing R code
could really be used to do this.

But maybe you have something much simpler in mind...?

             -s

On Thu, Oct 27, 2011 at 11:47, Christophe Pouzat <
christophe.pouzat at gmail.com> wrote:

> Hi all,
>
> As an heavy R (http://www.r-project.org, a very nice statistical package
> which is "a bit" to Scheme what Maxima is to Common Lisp) and an
> occasional Maxima user (for symbolic computations, etc) I recently came
> across a very interesting conference paper by Ross Ihaka (one of the two
> original R developers) and Duncan Temple Lang: "Back to the Future: Lisp
> as a Base for a Statistical Computing System."
> (http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf). The
> paper goes through some of the present limitations of R (not compiled,
> arguments passed by values, etc) and argues in favor of a
> reimplementation of R as an "M-expression" layer on top of Common
> Lisp. This paper triggered my interest in Common Lisp (better late than
> never!) and made me realized that I missed a lot about the capabilities
> of Maxima. But I would like the opinion of the Maxima's experts here, at
> least the ones who have time to read Ihaka and Temple Lang's paper:
> aren't they proposing to re-implement Maxima (with a strong statistical
> flavor)? If yes, wouldn't it be more economical to adapt to Maxima some
> of the coolest features of R?
>
> Christophe
>
> --
>
> Most people are not natural-born statisticians. Left to our own
> devices we are not very good at picking out patterns from a sea of
> noisy data. To put it another way, we are all too good at picking out
> non-existent patterns that happen to suit our purposes.
> Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap
>
> --
>
> Christophe Pouzat
> Laboratoire de physiologie c?r?brale
> CNRS UMR 8118
> UFR biom?dicale de l'Universit? Paris-Descartes
> 45, rue des Saints-P?res
> 75006 PARIS
> France
>
> tel: +33 (0)1 42 86 38 28
> fax: +33 (0)1 42 86 38 30
> mobile: +33 (0)6 62 94 10 34
> web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>