1. 15
  1.  

  2. 4

    Loop fusion here means using a single loop when adding together multiple vectors; you can also apply elementwise-squaring to one of the vectors before addition without breaking single-loop guarantee, etc. «Syntactic» means that you can guarantee that the loop fusion occurs without checking types (which could be inferred), although if the types make the addition itself expensive, loop fusion cannot win that much speed.

    This overview of functionality coming in the next (0.6) release also contains some discussion of applying the same approach to other languages.

    1. 3

      This is a really detailed and interesting post, thanks. It’s an announcement of a new feature in Julia, yes, but also essentially a survey paper of alternative approaches in other languages, pros and cons of different approaches, implications for the rest of the language, and all written in a style that expects relatively little background knowledge in these areas.

      1. 2

        It’s been really exciting to watch all of this stuff come together. It’s been several years worth of work involving lots of moving parts during which the Julia developers have had to hold out against some users wanting them to “just make it work like it does in [R/Python/MATLAB/whatever]” (i.e. keep adding more manually specialized vectorized functions or introduce complicated and brittle compiler optimizations). Hats off to them for sticking to their guns and eventually arriving at the happy intersection of clean design, extensibility, and fast performance.