I don't understand why people would want to do mathematics in imperative languages. (Yes, I understand imperative languages are faster, but why not just keep the imperative parts for the "inner loops", nicely isolated, and a functional core for everything else?)
R is, at its core, a functional language with a bunch of largely optional imperative bits bolted on.
Show HN: New IDE and GUI for R language
61–70 of 72 posts
Re: Show HN: New IDE and GUI for R language
#62I don't understand why people would want to do mathematics in imperative languages. (Yes, I understand imperative languages are faster, but why not just keep the imperative parts for the "inner loops", nicely isolated, and a functional core for everything else?)
R isn't exactly what I'd call your typical imperative language. It's more like the love child of APL and Scheme, with random bits thrown in by a bunch of statisticians.
Loops are almost never used in R, since pretty much everything is a vector (or some sort of data structure made of vectors), you simply apply functions to vectors and it maps over the whole thing.
Of course, the C, C++ and Fortran bits are 'imperative', which is kind of the structure you describe anyway (functional, vectorized R language which calls down to a bunch of C/Fortran functions).
Re: Show HN: New IDE and GUI for R language
#63I don't understand why people would want to do mathematics in imperative languages. (Yes, I understand imperative languages are faster, but why not just keep the imperative parts for the "inner loops", nicely isolated, and a functional core for everything else?)
Unfortunately, the R language isn't fast, especially not the imperative features (loops). A language like Julia is a better bet in that respect. The drawcard of R is the breadth of specialised statistical packages. (Often with inner loops written in C for performance.)
Julia as a language is faster, but I'm not sure it's actually faster than R to process data if you're using R as most people do...
Re: Show HN: New IDE and GUI for R language
#64Earlier quoted context omitted.
Term newbies in R was what the poster before stated. Personally I would NOT want to have anyone use R with a spreadsheet program. 1) I want manipulated data that is clear to replicate 2) I want my output to be plots and reports not another spreadsheet
> 2) I want my output to be plots and reports not another spreadsheet Knitr for the win! Seriously great package (and integrated nicely into R Studio), I use it for all my reports, presentations, etc...
- Works with just about any language you can imagine, not just R or the few other hypothetically supported languages
- Allows me to write in a lightweight Markdown-comparable, LaTeX-augmentable syntax, except org-mode supports internal references.
- Lets you do truly obscene things like pass values from bash, to python, to julia, to R
As Emacs begins to move more and more to Guile, I hope that the org-* functionality can be instrumented as embeddable libraries. I understand that Emacs isn't for everyone, and thus I wish org-mode (the format) and org-babel were available to the rest of the world. I was surprised to find how few edge-cases aren't better handled by org-* than knitr / RMarkdown.
Re: Show HN: New IDE and GUI for R language
#65Earlier quoted context omitted.
R is, at its core, a functional language with a bunch of largely optional imperative bits bolted on.
One of R's great current evangelists, Hadley Wickham, is taking it back to its functional roots[1]( http://cran.rstudio.com/web/packages/dplyr/vignettes/introdu... ) as well.
Re: Show HN: New IDE and GUI for R language
#66What happens when you just download FasteR? Does it work for a limited period and then stop working, will it ask me for a license each time I start it? Also, why would I pay €399 for FasteR while its main competitor is more mature and completely free? Aside from Excel add-in, the two other reasons I've found are in the comments here: "graphical user interface for selected packages/functions, support for multiple moni…
Re: Show HN: New IDE and GUI for R language
#67What happens when you just download FasteR? Does it work for a limited period and then stop working, will it ask me for a license each time I start it? Also, why would I pay €399 for FasteR while its main competitor is more mature and completely free? Aside from Excel add-in, the two other reasons I've found are in the comments here: "graphical user interface for selected packages/functions, support for multiple moni…
Re: Show HN: New IDE and GUI for R language
#68Earlier quoted context omitted.
in R loops are generally frown upon due to this issue. BUT R is not slow when it comes to parallel processing or using Revolution Anayltics also has speed ups if you need it. R also has dplyr is speedy and the data.tables is even faster. I think the original Julia speed claims were a little biased to Julia and well there is plenty of awesome things about R, but "slow" isn't a far statement. There is a reason why R ha…
"R is slow" refers to the main implementation of the language --- to code written in R --- and is completely fair. The packages you're talking about are mostly written in C or C++ with nice R interfaces. So R as a statistical package or R from a user's perspective is often quite fast, but that's because it is relatively easy to interface with C and C++. (This comes up often, and I'm not sure why I'm compelled to repl…
Re: Show HN: New IDE and GUI for R language
#69Re: Show HN: New IDE and GUI for R language
#70Earlier quoted context omitted.
"R is slow" refers to the main implementation of the language --- to code written in R --- and is completely fair. The packages you're talking about are mostly written in C or C++ with nice R interfaces. So R as a statistical package or R from a user's perspective is often quite fast, but that's because it is relatively easy to interface with C and C++. (This comes up often, and I'm not sure why I'm compelled to repl…
But MANY programming languages work this way. I would say that coding in R it doesn't matter if it is C or Fortan why say programming in R is slow even though in practice it really isn't with some new solutions?
As for why this can matter: a big part of my job is designing and prototyping new statistical estimators. "Prototyping" means running them through lots of simulations to explore their properties in small samples. My two options in R are:
1. Program up the estimator in pure R, in which case the simulations can take days to weeks to complete.
2. Program up the estimator in C and write an R interface, in which case the simulations will run 10 to 100 times faster. (Depending on the exact operations used.) The code will take much longer to adjust if I need to change the estimator, which happens frequently, and debugging will take longer.
3. Program up the estimator and simulations in pure C, making it still faster but much more brittle.
This is a fairly iterative process -- I'll typically discover errors in the math as I run the simulations or after I've run them, or the simulations will reveal unappealing properties that need to be fixed. But once I have "good" estimator and "good" simulations, I write it up in a paper and am done with it. (Gross simplification of my actual job, but accurate enough.)
So the distinction between "R's speed" and "C's speed" very much matters, and if R were actually as fast as C it would make my life much easier.
Of course, for people who are "coding in R" by running data analysis in a script the distinction doesn't matter. But I already said that in the comment you're replying to.