Hacker News new | past | comments | ask | show | jobs | submit login

I wonder - could R in theory be rewritten as a Python library? If not, why not? Is there any special syntax of R that makes it more amenable to statistical analysis than Python? Performance concerns?

It's just a shame to see a whole language popping out of something that could just be a library.




[caveat: I am a numpy/scipy developer]

The idea of rewriting a large body of code in a different language does not make much sense.

Also, being a niche language has some nice consequences:

  * R has been there for a long time through its predecessor S
  * R is a specialized language: little chance to see it being screwed up by some library which wants to change everything, as it happens too often in python
  * Because it is a niche language, its behavior is consistent across platforms (it is just easier to do with R than with python, or other "real" languages).
Note how being a "real" language goes against those advantages. Also, most researchers are very lousy programmers. Often, their software is super smart, but the code quality is awful and write-only. A less powerful language may mitigate those issues


Would love to know why you think R isn't a "real" language.


I've called out to R libraries before using rpy/rpy2. These have made it pretty easy. Then I can work with my data in Python, but when I need to use a stat function, I can just call out to R.


There are a few issues. For me two of the most basic are 1) the lack of a ubiquitous NA across all data types and 2) lack of 754 floating point behavior. The lack of custom infix operators is also a bit painful, especially if you view matlab as a competitor. The unquoted formula type is also nice, although you could get some of that by parsing strings.


R is an implementation of S. According to http://en.wikipedia.org/wiki/S_%28programming_language%29 it has its origins in 1975.


Something like that exists for clojure. http://incanter.org/ "Incanter is a Clojure-based, R-like platform for statistical computing and graphics."


You mean like numpy/scipy/matplot lib?


Yes, on top of these


scikits.statsmodels, pandas, rpy2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: