devectorizing is a terrible step back in expressiveness. It shouldn't be hard to make a compiler that can compute the example without a bunch of temporary arrays. I would be shocked if heavy duty packages like Matlab make all those temporary arrays.
On the other hand, I've seen (and written) plenty of code that went through contortions to use vector operations in IDL (http://en.wikipedia.org/wiki/IDL_(programming_language)). It would be great to have a language where for loops and vector expressions are fast.
Matlab does in fact make all those temporary arrays. So does R. See my comment above [1] – the idea is not that you should devectorize everything, but that you can if you need to. Automatic devectorization of general purpose code is not something anyone knows how to do – even in Haskell, which is the best candidate language for such things – see moomin's comment below [2].
In many cases, our vectorized code is as fast as Matlab or R. In some cases, we need to optimize the way our memory allocation and GC works to reduce the memory pressure created by temporaries. With that, julia should be as good as anything out there on vectorized codes.
On the other hand, I've seen (and written) plenty of code that went through contortions to use vector operations in IDL (http://en.wikipedia.org/wiki/IDL_(programming_language)). It would be great to have a language where for loops and vector expressions are fast.