Julia Vs C++


This is a general question on Juila.

“…Julia uses multiple dispatch as a paradigm…”

Please let me know the meaning of multiple dispatch in this context.

I’m a C++ guy. Having said that Julia is designed for high performance, how do you compare Julia with C++.


1 Like

This stackoverflow post deals with your question directly. The wikipedia page is also useful. However, in this context a key difference between Julia and C++ is that while emulation of multiple dispatch in C++ involves some kind of virtual function/runtime dispatch, in Julia the dispatch is generally handled at compile time. In such cases, Julia will be more performant than C++ would be with a similar programming paradigm.

However, if you write more conventional C++, then Julia’s and C++'s performance should be quite similar. There are cases where limitations in one give an advantage to the other, but for many tasks they are pretty equivalent.


I think Julia’s multiple dispatch is more similar to overloaded non-member functions in C++, rather than virtual methods defined in a class or struct.


There is a bit of a comparison here in the material Keno and I presented at C++Now 2018:

The original notebook is here

Also, there’s a video of the talk: