3 ms·
It'd be pretty neat if there was an R[1] interpreter written in RPython, give any R scripts a free speed boost; that said, R has a pretty hairy grammar, so it m
by dbaupp 14y ago
It'd be pretty neat if there was an R[1] interpreter written in RPython, give any R scripts a free speed boost; that said, R has a pretty hairy grammar, so it might end up being easier to just switch to (for example) Julia.
[1]: http://www.r-project.org/ http://www.r-project.org/
- disgruntledphd2 14y agoI dunno, the grammar you use in R is pretty weird, but it can all be expressed in simple function calls. For example "["(x, 2) is equivalent to the more typical x[2]. I've actually been thinking about re-implementing R, and PyPy does sound like the best way (I was also thinking of that Clojure implementation in C, given that R started out as a scheme interpreter. It would be a lot of work, but the rewards are massive. Reimplementing R the language is a lot less work than reimplementing the entire set of libraries.
- dbaupp 14y agoThe function call transformation is good, but one still has to parse the code to be able to do this. I remember reading an article a while ago that described the hoops the author had to go through to get a proper R parser working, though I can't find it now.
- disgruntledphd2 14y agoPlease submit it if you ever do, I'd love to read it.
- dbaupp 14y agoFound it: http://news.ycombinator.com/item?id=4254598 http://news.ycombinator.com/item?id=4254598 (Direct link: http://shape-of-code.coding-guidelines.com/2012/02/29/parsing-r-code-freedom-of-expression-is-not-always-a-good-idea/ http://shape-of-code.coding-guidelines.com/2012/02/29/parsin...)