TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How much of R is written in R?

56 点作者 g-garron超过 13 年前

8 条评论

etrain超过 13 年前
I think both lines of code and number of files are terrible metrics to use to compare sizes of code base across three very different languages. I don't have any experience with Fortran, but as a seasoned R and C hacker, I don't think the two languages could be much more different.<p>Well written R code tends to be incredibly compact, because the functions available in base R are plentiful and the language is both heavily functional and vector-oriented. The amount of manual memory management and explicit looping required by C easily inflates the lines of code.<p>A better metric, perhaps, would be to count the number of functions written in each language. Of course, there are issues of style there, but I think that would lead to a more comparable estimate. I don't know of a tool that does that for C - anyone know of one - or should I go the parser route?
rgovostes超过 13 年前
R is a pretty terrible language for many reasons, and it always surprises me when it rises to the top on HN.<p>But in terms of code quality within R itself, I was surprised to find that a number of its .c files are actually machine-translated Fortran, so I'm guessing the author's statistics are not far off.<p>I discovered this when I decided to confirm my suspicions that my (the?) most frequently used function, t(), which computes the transpose of the matrix, was implemented about as naively as possible. If R developers were really concerned with speed, this is probably the first place to start optimizing.
评论 #2932305 未加载
joblessjunkie超过 13 年前
<a href="http://www.ohloh.net/p/rproject/analyses/latest" rel="nofollow">http://www.ohloh.net/p/rproject/analyses/latest</a>
评论 #2932141 未加载
rubergly超过 13 年前
The HN title's typo is very confusing...
zeratul超过 13 年前
How R competes with other data mining environments:<p><a href="http://www.kdnuggets.com/2011/08/poll-languages-for-data-mining-analytics.html" rel="nofollow">http://www.kdnuggets.com/2011/08/poll-languages-for-data-min...</a>
cschmidt超过 13 年前
It is certainly a good thing (for speed) that the majority of lines of R are written in C. I used to work in a shop that did much of our development in R. We always used to joke "R is really fast if you write it in C".
评论 #2931667 未加载
swah超过 13 年前
Why didn't he use cloc ?
评论 #2931560 未加载
spp超过 13 年前
How well R competes with SPSS?
评论 #2932642 未加载