It looks like singledispatch is still relatively new, so it feels like that might not yet be representative either?
But the bigger distinction would be that Julia uses multiple dispatch, not just single, so the argument order does not dictate the dispatch capabilities. And it is little things like that which may sound trivial[1], but add up to be less effort to use (since there isn’t any other kind of function), which then also translated into being easier to optimize and run fast.
It may be hard to show this feature advantage in a single demo, as the advantage to this is better composability of multiple nouns and verbs in the language, particularly when pulling from multiple sources. Thus, Julia doesn’t need a different sin and np.sin function, for example, as the one function is already prepared to work for either caller.
[1] compare also len vs __len__ and __radd__ vs __ladd__ vs +, a hidden property distinction which doesn’t need to exist in Julia
I definitely agree that multiple dispatch is a lot harder :). But most of the examples in the article didn't need it, and it would have been appropriate I think to show equivalent code in Python. All that article did was make me think the author didn't know Python very well.
Python's single dispatch just means that if I do `foo.bar()`, the meaning of bar depends on the type of `foo`. So that is not recent, but a core part of the language.
Another difference to Python is that you can't add new methods post-hoc to types in Python. That's a big problem, but this has nothing to do with single/multiple dispatch. E.g. Rust has single dispatch but allows post-hoc methods.
But the bigger distinction would be that Julia uses multiple dispatch, not just single, so the argument order does not dictate the dispatch capabilities. And it is little things like that which may sound trivial[1], but add up to be less effort to use (since there isn’t any other kind of function), which then also translated into being easier to optimize and run fast.
It may be hard to show this feature advantage in a single demo, as the advantage to this is better composability of multiple nouns and verbs in the language, particularly when pulling from multiple sources. Thus, Julia doesn’t need a different sin and np.sin function, for example, as the one function is already prepared to work for either caller.
[1] compare also len vs __len__ and __radd__ vs __ladd__ vs +, a hidden property distinction which doesn’t need to exist in Julia
Disclaimer: I work on Julia’s compiler team