4 ms·
R is really LISP with syntactic sugar and bindings to well respected high-performance FORTRAN matrix and math optimization codes. http://librestats.com/2011/08
by pollitos 10y ago
R is really LISP with syntactic sugar and bindings to well respected high-performance FORTRAN matrix and math optimization codes.
http://librestats.com/2011/08/27/how-much-of-r-is-written-in-r/ http://librestats.com/2011/08/27/how-much-of-r-is-written-in...
It's great for bleeding edge scientific research. The results of many languages don't always match for advanced algorithms, but the open source nature of R, makes it easier to identify the problem areas.
The R-core interpreter does have a number of deficiencies. (R is based on S-language specification that left wiggle room from the 70s.) General purpose programming and data wrangling/engineering is best handled in other programming idioms.
- jhbadger 10y agoPeople say that, but I'd prefer the actual LISP syntax then (being a fan of xlispstat back in the day). I'm surprised nobody has created a "Lisp-flavored R" analogous to Erlang's LFE or Python's Hy.
- hadley 10y agoMost R users aren't programmers, and a LISP-y interface, while powerful, tends to be intimidating.
- cwyers 10y agoI'd prefer something more like TypeScript for R, where you can gradually move over but you get better tooling. I'd also ask for a new standard library but I think Hadley is basically doing that.
- hadley 10y agoI would love to know what you mean by data wrangling because I think R has a lot of good tools for it.
- pollitos 10y agoFor example, reshaping JSON to the format an intricate R function expects. Appreciate the great work with (d)plyr and similar packages, but it's still work and overhead. Combined with some inefficiencies/quirks in base r functions (does ifelse() still evaluate twice?) it's easier to go with a widely used and respected package in a general purpose language; Nokogiri for example. For data engineering, consider there is not a maintaned R package for a web-client, and asynchronous programming is weak.
- hadley 10y agoJSON is often a pain because it's so hierarchical and un-dataframe like. I have a few notes on working with it here: http://r4ds.had.co.nz/hierarchy.html http://r4ds.had.co.nz/hierarchy.html. `ifelse()` is a nightmare of a function but I don't think double-evaluation is ever a problem. There are two maintained web-clients: curl (low-level) and httr (high-level). And I think rvest does everything that nokogiri does.
- pollitos 10y agoThanks for the link on JSON and your packages, great work as always. I should clarify when I said we-client, I meant websockets client to consume feed. The last time I tried, the only R package (r-websockets) just crashed my Linux box and not maintained for several years. httr doesn't do websockets, as I understand. Seems likely a fundamental way to engineer/wrangle data into R.
- hadley 10y agoYou can do it with httpuv, but it might a bit clunky. I think better websockets support, and better async generally, is on the roadmap for the next year.
- pollitos 10y agoFor httpuv, author Joe Cheng advised cannot do a websocket-client. https://stackoverflow.com/questions/28120307/how-to-interact-with-websocket-from-within-r https://stackoverflow.com/questions/28120307/how-to-interact... Looking forward to the improvements. Appreciate all your work in the field.
- deleted 10y ago[deleted]