# Julia vs R vs Python

**URL:** <https://discourse.julialang.org/t/julia-vs-r-vs-python/4997>\
**Category:** Community\
**Tags:** performance\
**Created:** [July 21, 2017, 11:00am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997 "2017-07-21T11:00:36Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![TsurHerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tsurherman/32/1234_2.png) [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Post date:** [July 25, 2017, 7:35pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/41 "2017-07-25T19:35:18Z")

</div>

Python is great , Julia is great , Matlab is great  
give it a rest guys will ya

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [July 26, 2017, 4:29pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/42 "2017-07-26T16:29:14Z")

</div>

> [@stevengj](#):
>
> no user-defined types

Numba has some semi-recent functionality for “jit classes” to work around this limitation but as I understand it this requires more work on the user’s part, and I don’t think it’s very widely used.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 26, 2017, 5:35pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/43 "2017-07-26T17:35:10Z")

</div>

> [@tkelman](#):
>
> Numba has some semi-recent functionality for “jit classes” to work around this limitation

Even these are required to be heap-allocated, as I understand it, which prevents them from being stored efficiently in arrays etcetera; in that sense, they are analogous to `mutable struct` in Julia.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 26, 2017, 9:48pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/44 "2017-07-26T21:48:31Z")

</div>

Would be interesting to see if [https://github.com/python/performance/blob/master/performance/benchmarks/bm\_chaos.py](https://github.com/python/performance/blob/master/performance/benchmarks/bm_chaos.py) could be Numbad (and then compared to the julia version at [https://github.com/JuliaCI/BaseBenchmarks.jl/pull/92](https://github.com/JuliaCI/BaseBenchmarks.jl/pull/92)).

---

<div class="post-metadata">

**Author:** ![dave.f.kleinschmidt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dave.f.kleinschmidt/32/55_2.png) [@dave.f.kleinschmidt](https://discourse.julialang.org/u/dave.f.kleinschmidt)\
**Post date:** [July 31, 2017, 3:05pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/45 "2017-07-31T15:05:02Z")

</div>

I think these discussions are much more productive when they’re framed as “for which tasks, and by which users, and by what criteria, is language X really good”, rather than “is language X or language Y better”.

Or, perhaps equivalently, “who would benefit from using language X instead of language Y, how, and why”.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [July 31, 2017, 11:14pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/46 "2017-07-31T23:14:30Z")

</div>

> [@dave.f.kleinschmidt](#):
>
> I think these discussions are much more productive when they’re framed as “for which tasks, and by which users, and by what criteria, is language X really good”, rather than “is language X or language Y better”.

Yes, very true.  
Also, comparing languages can be productive if you ask yourself what lessons learned in other languages can be applied to the language you care about (not to say that all can be).  
That can be especially useful in Julia, since unlike most languages I’ve dealt with outside of the Lisp family, a lot of Julia’s design / evolution come from the user community, instead of a single dictator or very small core.

---

<div class="post-metadata">

**Author:** ![Marek\_Marczak](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@Marek\_Marczak](https://discourse.julialang.org/u/Marek_Marczak)\
**Post date:** [December 7, 2017, 8:54am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/47 "2017-12-07T08:54:18Z")

</div>

r3tex, I think you should compare Julia with PyPy (not CPython) because both of them uses JIT. Comparing Julia with scripting language without JIT implementation is just not fair. Julia uses JIT. It makes Julia faster, but memory consumption increases.

---

<div class="post-metadata">

**Author:** ![r3tex](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/r3tex/32/1441_2.png) [@r3tex](https://discourse.julialang.org/u/r3tex)\
**Post date:** [December 7, 2017, 9:24am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/48 "2017-12-07T09:24:09Z")

</div>

You know, I would if PyPy were a drop-in replacement for CPython… but it’s not, and even with numba the runtime crashes because vectorization exhausts memory. But that’s not the point. You can jump through hoops in any language to get speedups, but the best part about Julia is that you can take pseudocode for some algorithm, copy it, and almost always get good performance.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 7, 2017, 9:33am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/49 "2017-12-07T09:33:07Z")

</div>

> [@r3tex](#):
>
> best part about Julia is that you can take pseudocode for some algorithm, copy it, and almost always get good performance.

… and if not, you can do the optimization in Julia, [solving the two-language problem](https://www.youtube.com/watch?v=QTbPtKxDquc) [video].

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [December 8, 2017, 9:34am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/50 "2017-12-08T09:34:19Z")

</div>

I think Julia is more AOT than JIT, isn’t it?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [December 8, 2017, 10:45am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/51 "2017-12-08T10:45:07Z")

</div>

Probably Just In Time AOT.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 8, 2017, 10:53am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/52 "2017-12-08T10:53:33Z")

</div>

😄 I think that Julia’s model is an innovation (and thus an outlier) among programming languages, and it will take a while for terminology to catch up.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [December 8, 2017, 11:11am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/53 "2017-12-08T11:11:04Z")

</div>

I’m aware it’s off topic, but I think we should pick one acronym 🙂

Personally, I really like Just Ahead Of Time. There even is a blog post explaining why [Just Ahead Of Time is much better than Just In Time](http://changeyourideas.com/2015/05/a-world-of-difference-just-in-time-vs-just-ahead-of-time/), though it doesn’t seem to be about compilers.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [December 8, 2017, 11:44am UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/54 "2017-12-08T11:44:51Z")

</div>

I think that’s awesome.

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [December 8, 2017, 5:33pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/55 "2017-12-08T17:33:32Z")

</div>

Yes! There is real marketing value here in grounding people’s priors to be different than expecting a typical JIT.

While I was at first irritated by long compilation times in Julia, I realized that if you think of what is really going on behind the scenes, the correct comparison is to compiling C++ with heavy template meta-programming. Under that comparison, Julia looks pretty good.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 8, 2017, 5:39pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/56 "2017-12-08T17:39:02Z")

</div>

> [@jlperla](#):
>
> Yes! There is real marketing value here in grounding people’s priors to be different than expecting a typical JIT.
> 
> While I was at first irritated by long compilation times in Julia, I realized that if you think of what is really going on behind the scenes, the correct comparison is to compiling C++ with heavy template meta-programming. Under that comparison, Julia looks pretty good.

Yeah. I think that, once I realized that in many cases I was getting faster than C++ code, I started thinking about it as though I’m programming in easy C, instead of fast Python. In that sense, “easy C++”'s productivity is pretty amazing 😄.

I know we want to appeal to Python users because that’s a much bigger pool, but for people who would be writing big scientific computing simulations in C or Fortran, Julia is just… the future. It’s a huge difference.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 8, 2017, 5:41pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/57 "2017-12-08T17:41:47Z")

</div>

> [@jlperla](#):
>
> the correct comparison is to compiling C++ with heavy template meta-programming. Under that comparison, Julia looks pretty good

Also, good luck understanding seriously template-heavy metaprogramming in C++ when reading the code 3 months later 😄

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [January 1, 2018, 6:40pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/58 "2018-01-01T18:40:22Z")

</div>

In R if you want speed you should use data.table.

---

<div class="post-metadata">

**Author:** ![r3tex](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/r3tex/32/1441_2.png) [@r3tex](https://discourse.julialang.org/u/r3tex)\
**Post date:** [January 1, 2018, 8:41pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/59 "2018-01-01T20:41:19Z")

</div>

I definitely want speed, and I’d be very interested if you could provide an example of how the algorithm might be implemented using data.table. At first glance the syntax seems very counterintuitive and restrictive.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [January 1, 2018, 9:50pm UTC](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997/60 "2018-01-01T21:50:53Z")

</div>

Actually data.table “broke” the whole design of R’s copy-on-modify by providing “inplace” assignment and reassignment of columns without replacing the whole data.frame. At first its syntax is confusing but you can get used to it. Also you can use dtplyr to apply dplyr syntax on top…

I realise this is a Julia forum. Anyway I have even more respect for the data.table crew now that I have tried to write data algorithms in Julia that tries to match and/or beat them in performance. They have generally the fastest algorithm in the r/python/Julia-verse. Even though Julia is meant to be faster some of their C implementations are hard to beat.

[Previous page](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997.md?page=2)

[Next page](https://discourse.julialang.org/t/julia-vs-r-vs-python/4997.md?page=4)
