I would say that while all of those technologies were certainly crucial to
making Julia fast, none of them are magic. There are projects to get other
dynamic languages using LLVM's JIT, including Python and R.

So what makes Julia fast?

Language design.

Julia was designed from the beginning to have certain features that are
necessary for high performance: type stability, pervasive type inference,
execution semantics that closely match the hardware capabilities
(pass-by-sharing, machine arithmetic), inlining, and macros.

Additionally, certain oft-requested features were not included which make
high performance much more difficult – or impossible – to achieve. These
include: pass-by-copy, first class local namespaces (aka eval in function
scope). Leaving out other features, such as making everything callable and
allowing overloading of the getfield function (a.b access), while not
essential to providing performance since they could be similarly optimized,
have not been implemented since they might detract from the performance.



On Sun, Aug 3, 2014 at 6:01 AM, Michael Smith <[email protected]> wrote:

> I've been following Julia with great interest (and a lot of respect), but
> one thing that I don't fully understand is why it is so fast.
>
> For example, let's compare it to R, which is mainly written in C (and a
> bit of Fortran). On the other hand (according to Wikipedia), Julia's core
> is implemented in C and C++ (similar to R), its parser in Scheme, and the
> LLVM compiler framework is used for just-in-time generation of machine
> code. Scheme is probably *not* the main reason why Julia is so fast, and
> whether one uses C or C++ probably does *not* matter much as well (in
> terms of speed).
>
> That leaves LLVM. So what's so special about it?
>
> If I get R to use LLVM (which is probably not easy, but let's just speak
> in hypotheticals), could I also get a speed comparable to Julia?
>
> Thanks,
> M
>

Reply via email to