First, let’s cover what is normally used and why. The normal things employed for statistical operation include R, STATA, SPSS, and recently there has been increased interest in Python. There always seem to come and go smaller apps, languages, and libraries as well every few years, but those are the big ones. Why is that the case?
- Code Base – R has a ton of plug-and-play code that does exactly what statisticians need. Proprietary systems like STATA and SPSS have plugins and so on as well.
- Network Effect – A large code base is only a tiny subset of the overall network effect. These systems have loads of people already using them, liquid professionals markets, and network incentives for continued development, stability, and growth. Tons of documentation, classes are available for all of them, they have name identification and generally favorable reputations, and so on.
- Ease of Use – I dare to argue that R is not easy to use. STATA used to be terrible but it has gotten much better with many functions in drop down menus instead of needing to use a command line ish type of thing. SPSS, however, and other app vendors, have a reputation for being very easy to use which has driven some of thise demand.
- Vectorization – This bro points to it as a key need in stats which makes JS look bad and R and others look good. I think he means mathematical vectorization, not graphical SVG stuff which I will cover seperately.
- Visualization – Traditional data visualization can be done but it is static and generally low quality. Visualization is important for understanding and communicating the importance or meaning of data, and it can also be just fun to do and create an incentive for interaction.
- Server Side or Local Processing – Server side or local processing power is generally larger than browser side processing power, at least when we are talking about servers that process big data. Average Joe’s computer will take much longer to process the same set, or in many cases just not be able to process the set period. Adding the browser layer can make this issue bigger.
- Hardware Accelerated Processing – Being able to accelerate via GPU or whatever gives a big performance boost.
- Parallel Processing – Being able to execute parallel processing gives a big big performance boost.
- Large File Size, Chunking, Timing Out, Resuming, Failing, and So On – Being able to resume process execution from an automatic save point is great because processing large data can take time and sometimes power, network, processing, or other interruptions occur. It’s useful to be able to turn your computer back on and resume. This is also related to the idea of chunking and large file sizes. Large file sizes take longer to process, but also sometimes the file is so large it can’t be loaded into memory all at once. In other words, it can’t be processed for reasons other than time. Chunking lets you break a big file up and stream it a piece at a time so you can handle bigger data.
- Open Source – SPSS and STATA are closed source. We should ditch them now. R is nice and open, but it is seen as difficult and exotic. Also, it’s open nature is only as valuable as its network and code base which are type-matched to stats but small.
JS Does These Things
I’m not going to claim JS does all of this better. Quite opposite. There are spots I am well aware JS is inferior, but I do think JS can do all of these things at least sufficiently. I also think JS is better at some of these things.
In fact, my core argument is that I think JS is sufficiently better at a sufficient number of things that we as individuals, and indeed the global computation community, would be net better off in the productivity and utilitarian senses to focus on JS for stats.
In the same order:
- Code Base – JS has a far bigger code base. Although JS is better for gathering and visualizing data, it’s not clear that it is better or worse for processing data compared to R. However, the JS community is very big and if it focuses on stats for even a short time this should easily cure any issues.
- Ease of Use – I would argue JS is much easier to use and learn than R. JS is an introductory programming skill. Many people who learn R would end up learning JS anyway. Many people who learn JS and never get into data science will still find it useful for other reasons.
- Vectorization – Call me crazy but I think this is something very easy to do in JS. I have done column-to-row transposition and written algorithms to flatten or inflate complex or multidimensional arrays and objects. While I rolled my own without a library, there seem to be libraries for this functionality including Sylvester and others. Admittedly I haven’t used them. Maybe that bro’s article which criticized JS is just not up to date or maybe he knew about them and they just aren’t that good. In principle, however, I see no reason for this to be done in JS. It’s at worst an underdeveloped code base issue imho.
- Visualization – D3.JS. Game over. But really, JS wins all over on visualization including dynamic, real-time, mass sharable, reactive visualizations.
- Server Side Processing – Server-side JS didn’t exist a long time ago. A little bit ago it was a new thing. Now it’s common. Node, Backbone, Meteor, and many others show that it is powerful and not going anywhere.
- Hardware Accelerated Processing – We now have support for hardware acceleration of browsers and browser processed languages.
- Parallel Processing – JS now has support for parallel processing. Eg.
- Large File Size, Chunking, Timing Out, Resuming, Failing, and So On – JS streaming and chunking has made the previously serious issue of timing out and breaking a thing of the past. Eg.
- Open Source – JS wins the open source game hands-down. Also, the ability for cross-implementation of stats in JS-based open source is larger because the JS open source community is so big.
EDIT: I also just came across this thing. It turns out even R knows how slow R is because vectorization in R dramatically speeds everything up by essentially converting to C according to this guy.