# Julia Vs C++

**URL:** <https://discourse.julialang.org/t/julia-vs-c/16572>\
**Category:** New to Julia\
**Created:** [October 20, 2018, 3:17pm UTC](https://discourse.julialang.org/t/julia-vs-c/16572 "2018-10-20T15:17:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeno](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Jeno](https://discourse.julialang.org/u/Jeno)\
**Post date:** [October 20, 2018, 3:17pm UTC](https://discourse.julialang.org/t/julia-vs-c/16572/1 "2018-10-20T15:17:23Z")

</div>

Dears

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++.

Thanks,  
Jeno

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 20, 2018, 3:34pm UTC](https://discourse.julialang.org/t/julia-vs-c/16572/2 "2018-10-20T15:34:09Z")

</div>

[This stackoverflow post](https://stackoverflow.com/questions/1749534/multiple-dispatch-in-c) deals with your question directly. The [wikipedia page](https://en.wikipedia.org/wiki/Multiple_dispatch#C++) 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.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 20, 2018, 4:32pm UTC](https://discourse.julialang.org/t/julia-vs-c/16572/3 "2018-10-20T16:32:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [October 21, 2018, 12:10pm UTC](https://discourse.julialang.org/t/julia-vs-c/16572/4 "2018-10-21T12:10:19Z")

</div>

> [@Jeno](#):
>
> I’m a C++ guy. Having said that Julia is designed for high performance, how do you compare Julia with C++.

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

> <https://github.com/boostcon/cppnow_presentations_2018/blob/master/05-08-2018_tuesday/the_julia_language_and_cpp __bart_janssens__ cppnow__05082018.pdf>

The original notebook is [here](https://github.com/barche/cppnow2018-julia/blob/master/cppnow2018-julia.ipynb)

Also, there’s a video of the talk:

[![](https://global.discourse-cdn.com/julialang/original/3X/1/f/1f3be3943ab3f5bd314b41bcf77e8b92af1a26d8.jpeg "C++Now 2018: Keno Fischer & Bart Janssens “The Julia Language and C++: The Perfect Marriage?”") ](https://www.youtube.com/watch?v=hvnxY3NjHQ4)
