Blog post: Rust vs Julia in scientific computing

I did update the blog post to address some issues.

Undefined behavior

Most importantly, I finally answer why I did use a “straw man example” as described here:

Benny had to highlight this in a very kind way:

I answer it in the following new section in the post about “Preallocation and undefined behavior”:


Correction about having to use a for loop

I did say that you have to write a for loop for maximum performance in Julia but I did mean vectorization. It was unfortunate that I did mention this without enough explanation and directly after talking about Rust’s iterators. This did lead to the confusion that I meant Julia’s iterators.

This has been a problem I did observe 2 years ago. It is also mentioned here and here. But now I did benchmark vectorized and for loop versions and it seems to be fixed? I did remove that now. Sorry.

Sorry for the incorrect benchmarking that I did publish today for some minutes until @DNF pointed out that I did benchmark two different things. I did take the whole website down until the corrected version was uploaded. I have no intention to spread wrong information. I made a mistake and apologize to the whole Julia community :heart:


You have to preallocate in Rust as in any other language and it offers many ways to do so. For example, Vec has the methods with_capacity, reserve, reserve_exact. You could also use extend which will extend from an iterator while preallocating based on the size_hint of the iterator.

Yes, you are right. This was indeed a big point in the conference. We need something similar to rayon but for the GPU.

Yes! I think we have to emphasize this more in this discussion :smiley:


@mbauman @Mason @martin.d.maas @xiaoxi @jakobnissen Thank you very much for your kind words. It means a lot to me :heart:

8 Likes