4 ms·
Even better, reimplement the interpreter with modern data structures...
by jergosh 15y ago
Even better, reimplement the interpreter with modern data structures...
- TalGalili 15y agoGo ahead... :)
- ahi 15y agoDidn't they try that once? And instead of fixing things they ended up with two sets of broken data structures? I could be mistaken.
- MaxMorlock 15y agoWould you please be so kind and explain in some more detail what you mean? Thank you!
- jergosh 15y agoWell, as far as I remember lists (which are used like hash tables, as they associate variables with names, see http://cran.r-project.org/doc/manuals/R-lang.html#List-objects http://cran.r-project.org/doc/manuals/R-lang.html#List-objec...), implement indexing as an O(n) operation. Only after they reach a certain size are they converted to a hash table. Everything is pass by value with some cases being marked as 'safe', i. e. if you know beforehand the variable won't be changed it's not copied to save time. The reason for this is that the project was designed by people who were primarily statisticians, and the most glaring performance problems were later fixed by hacks and 'special cases'. Disclaimer: Most of this I know second hand from a coworker who's an author of many R packages. I worked with R's interface to C and it wasn't a pleasant experience.
- mjw 15y agoGlad I'm not the only one bugged by this. Next time I think I might try the http://rubyforge.org/projects/rsruby/ http://rubyforge.org/projects/rsruby/ bindings instead.
- jergosh 15y agoI would recommend http://rpy.sourceforge.net/rpy2.html http://rpy.sourceforge.net/rpy2.html (I'm biased, though ;))
- klipt 15y agoEven better, write a statistical module for scipy that's competitive with R.