3 ms·
You don't need to sell me on Clojure being a nicer foundation than Python in most respects, but the thing I keep running afoul of when doing data science on any
by mumblemumble 7y ago
You don't need to sell me on Clojure being a nicer foundation than Python in most respects, but the thing I keep running afoul of when doing data science on any JVM language the performance hit from all the copying it takes to pump data back and forth across JNI.
The showdown that's more interesting to me is Clojure vs Julia, which is very nearly an acceptable Lisp, and also has a nicer interface to C libraries. And, IIRC, also the ability to interface directly with C++ libraries, without having to first wrap them in a C-compatible interface.
- dragandj 7y agoThere is no copying back and forth across JNI, thus no particular performance hit there (in Uncomplicate libraries).
- mumblemumble 7y agoWell, there wouldn't be once data is already copied into Uncomplicate data structures. But surely you can't just pass a pointer to the guts of a Java array, and do have to copy data back and forth to get it into Uncomplicate data structures in the first place, don't you? Otherwise, how does the C/Fortran/whatever code deal with the fact that the JVM's garbage collector reserves the right to move data around?
- dragandj 7y agoWhy would you pass a pointer (or the contents it points to) to the guts of a Java array? Neanderhal does not require Java arrays (although it supports transfer to/from arrays for convenience). Please try Neanderthal; there are lots of getting starting resources. You can benchmark it yourself (very easy to do in Clojure) and see... I assure you that the only copy you would need is the same one you need in C, C++, or any language: the one from the source of your data (IO such as database, network, scv string etc). And even this is not required if you initialize the vectors randomly (which is often the case).