3 ms·
1. It is more a philosophical disagreement than a problem, and whatever the semantics you want, the JVM does not limit you. The disagreement revolves around the
by pron 13y ago
1. It is more a philosophical disagreement than a problem, and whatever the semantics you want, the JVM does not limit you. The disagreement revolves around the Java compiler and language semantics, not the JVM.
2. The math in FastR, if I understand the presentation correctly, is performed by FORTRAN libraries anyway. Using battle tested FORTRAN libraries for matrix computations is common practice in C, Java, Julia, Matlab and most other environments. They basically all share the same underlying matrix math code.
- StefanKarpinski 13y agoI do think that Kahan's objections to Java's floating-point support were more than just philosophical, although it's unclear to me at this point how many of them still apply. The biggest issue that seems to still remain is that you can't change rounding modes or check flags, both of which are essential for verifying numerical stability and correctness. Far worse than any floating-point issues on the JVM is that your indices and integers are 32-bit, so you're limited to 2GB arrays before you have to take bizarre measures to access larger amounts of data. Although it is standard in high-level systems to call out to a BLAS library [1], for some inexplicable reason it seems that both R and NumPy use the reference BLAS by default, which is quite slow – around 4x slower than better BLASes. Matlab ships with Intel's proprietary MKL, which includes a very fast BLAS implementation, while Julia ships with OpenBLAS, which is a similarly fast open source BLAS implementation derived from the legendary GotoBLAS [2]. Since all BLAS implementations share a common Fortran ABI, it's easy to swap them out, but it's not quite true that all of these systems are using the exact same Fortran code. [1] https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprogra... [2] https://en.wikipedia.org/wiki/GotoBLAS https://en.wikipedia.org/wiki/GotoBLAS
- pron 13y agoThere is a lot of work going into designing java arrays "2.0", including support for "long" arrays, immutable arrays, and arrays of structs.