# The Unreasonable Efficiency and Effectiveness of Multiple Dispatch: Your Favourite Examples

**URL:** <https://discourse.julialang.org/t/the-unreasonable-efficiency-and-effectiveness-of-multiple-dispatch-your-favourite-examples/119477>\
**Category:** General Usage\
**Tags:** question, multiple-dispatch\
**Created:** [September 17, 2024, 3:07am UTC](https://discourse.julialang.org/t/the-unreasonable-efficiency-and-effectiveness-of-multiple-dispatch-your-favourite-examples/119477 "2024-09-17T03:07:25Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [September 17, 2024, 9:52am UTC](https://discourse.julialang.org/t/the-unreasonable-efficiency-and-effectiveness-of-multiple-dispatch-your-favourite-examples/119477/6 "2024-09-17T09:52:01Z")

</div>

> [@kapple](#):
>
> Stefan responded that this write-up should have empirical evidence in contrast with the anecdotal evidence he presented in his talk.

I don’t agree with this statement, in the sense that I don’t agree that the evidence is purely anecdotal. As I mentioned in the slack discussion, the majority of the cited YouTube talk is factual.

I created a short self-contained example to showcase Julia’s composability. It composes reals, duals, symbolics, diffeq, monte-carlo measurements, matrices, and trigonometrics. I created this based on other people’s work (Stefan’s talk, Kristoffer and Fredrerik’s presentation, Frames’ blogpost, and other resources). It is the first section of this notebook:

> <https://github.com/Datseris/Zero2Hero-JuliaWorkshop/blob/a690065177745bb6074623e496b53de8caad6a2a/2-MultipleDispatch.ipynb>

I am very happy with this example, because it is purely factual, and very much up to date, and even includes symbolic stuff which is currently cutting edge in Julia.

As I discussed at the end of the first section of that notebook, this absolutely crazy composability example is simply, and factually, impossible in Python, because there is no single `sin` function. There is `numpy.sin, sympy.sin`, etc. etc.. Any Python developer would have to write glue code to create in Python what is possible in Julia out-of-the-box.

Let me also say, anecdotally ( 😉 ) that one day I saw my wife’s code (Python user) and my eye glanced over a statement `import jax.numpy`, which made me start laughing because I realized that JAX had to re-implement (at least partially) `numpy`, which is arguably Python’s largest library.

---

_[View the full topic](https://discourse.julialang.org/t/the-unreasonable-efficiency-and-effectiveness-of-multiple-dispatch-your-favourite-examples/119477)._
