From jtalbot at cs.stanford.edu  Sat Mar 10 16:39:44 2012
From: jtalbot at cs.stanford.edu (Justin Talbot)
Date: Sat, 10 Mar 2012 07:39:44 -0800
Subject: [Rd] On R performance
In-Reply-To: <CADUbQ5iN7V78+Eo1fQRRPGeoAFt991sDjdM590U3xtr-PF7YdA@mail.gmail.com>
References: <CALLn38PjixLnWw=uBwB-5QYDEa=tLNahuSnap_A_oQQ_=qS4TA@mail.gmail.com>
	<CADUbQ5jZEM1bV+xBdjgF8HxOTM7SGy3zkvefZZ4nKWQGVwQNtw@mail.gmail.com>
	<CALLn38Pmn8ZTYCc17R0QVjjLsQzo0jJOLinjZFzkhRhvDRVWwg@mail.gmail.com>
	<CADUbQ5iN7V78+Eo1fQRRPGeoAFt991sDjdM590U3xtr-PF7YdA@mail.gmail.com>
Message-ID: <CALLn38OEgxTYvzuiPw=9D+1t9rKu26MKdBv2F5jBzpuAYC+tVQ@mail.gmail.com>

>
> Thanks for the clarification Justin. What about the S4 classes
> and methods? The design resembles CLOS, and currently this
> is interpreted R code. Have you addressed performance issues
> associated with this? What relative impact does this have compared
> with other optimizations like vectorization?
>

Sorry for the delay in my response. My posts keep getting stuck in moderation.

I'll be honest that I haven't looked at S4 performance yet. That's the
big part of R's semantics that I haven't implemented yet. I chose to
delay this part largely because the language still feels very unstable
around the object systems.

I know R takes a lot of flak for having multiple incompatible object
systems. It's frustrating that that one object system hasn't come
dominate--they all have their pluses and minuses. However, one
response is to point out that Javascript is in the same situation, but
has still been very successful. There are lots of different OO
libraries for Javascript, each one taking a slightly different tack
(see this review from my office mate
https://github.com/njoubert/inheritance.js/blob/master/INHERITANCE.md
(caution some strong language)). I think part of the reason this has
worked out for Javascript is that none of the object systems are
considered part of the core language, leaving both the language
implementers and the OO library designers flexibility to experiment
without blocking each other.

R has taken the opposite approach...incorporating multiple object
systems into the core language, with the associated maintenance load
on R-Core...and I'm not sure that it's been as profitable. Perhaps
there are good reasons for this though. I'll admit that I haven't
thought through this area much.

Justin



[Rd] On R performance
Justin Talbot