Live data from Hacker News

R, the master troll of statistical languages (2012)

talyarkoni.org

91–100 of 154 posts

Re: R, the master troll of statistical languages (2012)

#91
post #4

The problem is people using R without trying to learn about the language itself, just assuming it works like their favourite language. For example complaining that R is slow and then writing iterative solution instead of using vectorization. When I saw the example the author gave my first thought was "sapply/lapply". Lapply is essential to the R use, and is being taught early on in every book/course on R I've ever sa…

It's been a few years since I really looked at R, but I don't think the problems with R are simply that people don't learn the language. Some languages are simply not as good as others. We can all learn more about the tools we use when programming, I know that I certainly could. But this doesn't make it our fault that a language is tricky or hard to debug or hard to understand. If we worked at it, I suppose we could all write more efficient programs by using assembler, but that doesn't mean that assembler is the best possible programming language for, say, statistical programming.

Someone, Ross Ihaka, that knows a thing or two about R wrote a short post 6 years ago and said "simply start over and build something better". Take a look:

http://www.r-bloggers.com/“simply-start-over-and-build-somet...

My hope is that Julia will eventually be adopted as a basis for a future statistical programming language.

Re: R, the master troll of statistical languages (2012)

#92
post #39

Earlier quoted context omitted.

R is, I think, an interesting language because it's heavily used by people who would not otherwise learn a programming language. If you compare R not with other programming languages, but with other ways of working with statistical data, this makes far more sense. I don't actually "know" SAS in the way I know a programming language - I know the commands I invoke to do what I want it to do. Similarly, I encounter lots…

I see this as a failure of our educational system. Speaking as an academic in CS, it's our job to teach people skills that they need for dealing with computers in the course of their career. The Math department does this for basic calculus and probability; the English department does this for literature and composition. Why don't more CS departments offer the service courses that scientists and engineers need to real…

I'm sure there could be a very strong synergy with Economics and Finance. Especially the cross-over from CS to Finance.

Re: R, the master troll of statistical languages (2012)

#93

Earlier quoted context omitted.

I've translated plenty of numerical code from (pure-ish) python to c and c++, and usually get about a 100x speedup, sometimes as high as 800x, implementing the same algorithms.

At the risk of being overly pragmatic, note that I said "fast enough" and not "as fast as possible." My comment was more on the perception that python is unworkably slow in many situations, where I can count the number of times on my hands that I've NEEDED to C-ify some hot paths. If you're writing a plasma fluid simulation to run on a HHPC cluster, yes, you probably damn well want some straight C/C++. Outside of sim…

Nit, but throughput is not the only performance constraint that could rule out Python. The last substantial amount of C I wrote was low throughput but needed to reliably receive, process and respond to packets in single-digit microseconds.

Re: R, the master troll of statistical languages (2012)

#94

Earlier quoted context omitted.

I've translated plenty of numerical code from (pure-ish) python to c and c++, and usually get about a 100x speedup, sometimes as high as 800x, implementing the same algorithms.

At the risk of being overly pragmatic, note that I said "fast enough" and not "as fast as possible." My comment was more on the perception that python is unworkably slow in many situations, where I can count the number of times on my hands that I've NEEDED to C-ify some hot paths. If you're writing a plasma fluid simulation to run on a HHPC cluster, yes, you probably damn well want some straight C/C++. Outside of sim…

But, but throughput is not the only performance constraint that could rule out Python. The last substantial amount of C I wrote was low throughput but needed to reliably receive, process and respond to packets in single-digit microseconds.

Re: R, the master troll of statistical languages (2012)

#95

Earlier quoted context omitted.

I've translated plenty of numerical code from (pure-ish) python to c and c++, and usually get about a 100x speedup, sometimes as high as 800x, implementing the same algorithms.

At the risk of being overly pragmatic, note that I said "fast enough" and not "as fast as possible." My comment was more on the perception that python is unworkably slow in many situations, where I can count the number of times on my hands that I've NEEDED to C-ify some hot paths. If you're writing a plasma fluid simulation to run on a HHPC cluster, yes, you probably damn well want some straight C/C++. Outside of sim…

But, but throughput is not the only performance constraint that could rule out Python. The last substantial amount of C I wrote was low throughput but needed to reliably receive, process and respond to packets in single-digit microseconds.

Re: R, the master troll of statistical languages (2012)

#96
R is great language but at the same time it can be a real pain.

Sometimes I imagine that some very wise guy designs a language much more consise and coherent, that could at the same time take advantage of the huge number of existing libraries written in R and C++... Maybe it's a dream but so many times I wonder if that's even be possible.

Re: R, the master troll of statistical languages (2012)

#97

Most of my university classmates' first exposure to programming is using R in a statistics class. It's awful. I wish they'd make Python or something a prerequisite, so that giant swaths of people don't get turned off of computing or start with the strange ideas it teaches.

It sounds like you are arguing for imperative programming over functional programming.

R is a fine tool, but (like Java or C) not the best window for a beginner into the joy that programming can be. The syntax is pretty weird and its semantics don't align that neatly with broadly-useful ideas for reasoning about programs.

We run 3 different intro sequences in Python (for non-majors), Scheme (for most majors), and Haskell (for those who are already strong imperative programmers). They're all great.

Re: R, the master troll of statistical languages (2012)

#98

Writing a variant of this article has become a rite of passage for all serious users of R. There are two issues that contribute to the difficulties people experience with R. First, yes, R can be confusing at times. Tal explains this really well, but only scratches the surface. There is so much more confusing and counter-intuitive stuff, for example with regards to factors that only very few people seem to understand…

I agree with everything here, including the praise for Matloff's book; it should be the very first book any serious R user picks up.

But Matloff is no longer alone: Hadley Wickham's Advanced R is now also a must-read for R programmers.

http://www.amazon.com/Advanced-Chapman-Hall-CRC-Series/dp/14...

Re: R, the master troll of statistical languages (2012)

#99
post #37

Earlier quoted context omitted.

In my experience a lot of the claims that R is slow are greatly exaggerated and made by people who don't actually use it. Kind of an echo chamber. Every time I see someone say chose Python instead because of speed, I roll my eyes.

My usual take on this: "Between R and Python, the faster language is likely whichever library author actually wrote most of their code in C or FORTRAN."

Pypy is actually much faster than both standard Python 2.7 and R in basically everything requiring the standard library.
Post reply on HN