Live data from Hacker News

FastR: An implementation of the R language in Java [pdf]

oracle.com

11–20 of 34 posts

Re: FastR: An implementation of the R language in Java [pdf]

#12
post #3

Are there any tools to convert R to JS or Python, or... any other common language that doesn't require a 60mb runtime distribution?

I 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.

I am using RCPP for interfacing, didn't see anything automatic for conversion though, it's just an interface.

Re: FastR: An implementation of the R language in Java [pdf]

#13
post #6

The programming language analysis is pretty interesting, but you have to ask, what's the point of a brand-new Java implementation? R isn't just a programming language, but it's a software framework/ecosystem. They mentioned this in the slides, but it's problematic because R crucially relies on C and Fortran interaction (which I thought the JVM can't do efficiently, since it doesn't like giving C/Fortran raw memory ac…

Julia is quite cool, actually.

As for Java, Oracle together with AMD, are in the process of making the GPU trasparent to Java developers as part of the Sumatra project.

So this is one are where R could benefit of running on Oracle's JVM. It remains to be seen if other Java vendors would adopt such feature.

Re: FastR: An implementation of the R language in Java [pdf]

#15
post #6

The programming language analysis is pretty interesting, but you have to ask, what's the point of a brand-new Java implementation? R isn't just a programming language, but it's a software framework/ecosystem. They mentioned this in the slides, but it's problematic because R crucially relies on C and Fortran interaction (which I thought the JVM can't do efficiently, since it doesn't like giving C/Fortran raw memory ac…

> ... C and Fortran interaction (which I thought the JVM can't do efficiently, since it doesn't like giving C/Fortran raw memory access to its internals).

As of 2002 (JDK 1.4) Java has excellent integration with native memory (you can freely pass pointers from C/FORTRAN to Java and vice versa[1]).

There are numerous Java math libraries that use BLAS/LAPACK already[2]. In fact, AFAIK, most Java matrix math libraries use FORTRAN code (at least as an option).

[1]: Java side: http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer... C side: http://docs.oracle.com/javase/7/docs/technotes/guides/jni/sp...

[2]: For example, https://github.com/fommil/matrix-toolkits-java, http://mikiobraun.github.io/jblas/

Re: FastR: An implementation of the R language in Java [pdf]

#19
post #3

Are there any tools to convert R to JS or Python, or... any other common language that doesn't require a 60mb runtime distribution?

A 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.htm...

But the JS blob ends up being like ~15mb!

Re: FastR: An implementation of the R language in Java [pdf]

#20
post #15
post #6

The programming language analysis is pretty interesting, but you have to ask, what's the point of a brand-new Java implementation? R isn't just a programming language, but it's a software framework/ecosystem. They mentioned this in the slides, but it's problematic because R crucially relies on C and Fortran interaction (which I thought the JVM can't do efficiently, since it doesn't like giving C/Fortran raw memory ac…

> ... C and Fortran interaction (which I thought the JVM can't do efficiently, since it doesn't like giving C/Fortran raw memory access to its internals). As of 2002 (JDK 1.4) Java has excellent integration with native memory (you can freely pass pointers from C/FORTRAN to Java and vice versa[1]). There are numerous Java math libraries that use BLAS/LAPACK already[2]. In fact, AFAIK, most Java matrix math libraries u…

Ah, wonderful! So if I understand this correctly, this doesn't give C/Fortran access to Java-native primitive arrays; but instead, it's specific to NIO byte buffers (and then the matrix libraries have to build on top of that). But that should be fine for doing R replacements, at least in theory.

(Personally, when programming Java I find it more convenient to use primitive arrays as opposed to matrix libraries, but that might be dependent on the operations I tend to do: lots of increment/decrements and only occasional linear algebra. I guess this isn't exactly relevant to the R replacement question.)

Post reply on HN