4 ms·
I would say Julia's target is much wider than R. R is actually a nice language (also with multiple dispatch!), but it's basically useless for any actual numeri
by tenfingers 12y ago
I would say Julia's target is much wider than R.
R is actually a nice language (also with multiple dispatch!), but it's basically useless for any actual numerical work. Too slow. There have been efforts in the past to introduce a JIT compiler, but nothing has become mainline yet. The GC is also very poor.
The actual base system in R is also very small. The built-in vector types helped the language mitigate the issue due to the fact that it's very easy to build a C extension that does the actual computation by just taking the underlying memory pointer (it's actually easier to do than python and it maps much better). But it stops there. If it wasn't for the large swath of statistical packages, R wouldn't have much traction. Not to mention that the code quality of the typical CRAN package is quite low, coming from people with a background in statistics and very little CS knowledge.
The hope with Julia is being able to actually develop methods in Julia itself. I personally looking forward to replace python&c++ with Julia&Rust in the future.
- bachmeier 12y ago> There have been efforts in the past to introduce a JIT compiler, but nothing has become mainline yet It's been included in the default install of R since version 2.14. You can compile any function you want, and in some cases you can get a speedup of several times. Sure, you're not getting the speed of C, but it's there, it works, and in the future it will lead to much larger speedups. Some info and timings are here: http://www.rinfinance.com/agenda/2014/talk/LukeTierney.pdf http://www.rinfinance.com/agenda/2014/talk/LukeTierney.pdf The experimental version of the compiler can achieve speedups in the neighborhood of 20x.
- grayclhn 12y agoAre you sure you're referring to JIT as opposed to byte-compilation?
- tenfingers 12y agoI have R 3.1.x and I never noticed (it's in "compiler"). It's off by default... pretty sad.
- jghn 12y agoIt can, but it often doesn't, at least not a year or so ago (perhaps it got much better). I've seen the examples with great speedups but every time I've tried it on real code I never saw anything. You're much better off just using Rcpp for those sorts of cases.
- lottin 12y agoWell, it's true, it is included in the default install. After unsuccessfully trying to locate the elusive 'compiler' package at CRAN, I came to the conclusion that the R compiler was an urban legend. Now I realise it was already installed all along from the start and all I had to do is 'library(compiler)'. Silly me.
- bachmeier 12y ago> Silly me. Not really. That's an example of one R's rough edges. I did the same thing.
- edraferi 12y agoIf it wasn't for the large swath of statistical packages, R wouldn't have much traction. I agree, but Community & Ecosystem are critical to any language's success. R's community is great and getting better [1]. You could make very similar criticisms about JavaScript, which is a lousy language that has accomplished amazing things thanks to third-party extensions and a very active development community. [1] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
- minthd 12y agoWhy rust ? can't Julia offer enough speed?
- sixbrx 12y agoIn my experience Julia is quick with low level array oriented programming which doesn't allocate ("C in Julia"), but if the garbage collector is needed within loops or you use anonymous functions there then you'll suffer greatly.
- tenfingers 12y agoRust covers the lower-level much better. In Julia for example you currently don't have a nice way to modify C-like structs. You can offset memory directly, but it's a pointless exercise. Even if a record-like syntax is added, the dynamic nature of Julia might incur in different latencies, you have the GC (not optional), and the runtime is quite big. Rust is filling the same niche I'm using c/c++ for, where I need absolute control of every detail: not necessarily for performance.