4 ms·
Are there any tools to convert R to JS or Python, or... any other common language that doesn't require a 60mb runtime distribution?
by Demiurge 13y ago
Are there any tools to convert R to JS or Python, or... any other common language that doesn't require a 60mb runtime distribution?
- CJefferson 13y agoI have done some work converting R to C++ by hand. The problem, as this presentation discusses, is that a 95% automated conversion is easy, but that last 5% often involves diving deep into the weirdness of the R interpreter.
- Demiurge 13y agoI am using RCPP for interfacing, didn't see anything automatic for conversion though, it's just an interface.
- chubot 13y agoThat's a really bizarre reason not to use R. Python's distribution is about 30MB if I recall. It doesn't really make much sense to convert R to JS or Python, since the semantics are so different. If you don't want to use R, Pandas in Python provides very powerful data frames (which are likely faster for many cases). However, it depends on NumPy, matplotlib, and a few other libraries, which probably total more than 60 MB.
- neeee 13y agoPython 3's installed size is 90MB here, 2 is 60MB.
- Demiurge 13y agoGood thing is that python is pretty ubiquitous, as is virtual env :)
- Demiurge 13y agoI already use python, so having it in same codebase would be perfect. However, I have some code in R that is pretty important, so I have to include that as well with an application (model).
- long 13y agoA guy named Jony Hudson has gotten R to kind of compile to JS using emscripten. See http://r.789695.n4.nabble.com/R-in-the-browser-td4667985.html http://r.789695.n4.nabble.com/R-in-the-browser-td4667985.htm... But the JS blob ends up being like ~15mb!