You might also enjoy Stefan Karpinski’s talk at JuliaCon 2019 about how multiple dispatch helps make the language more expressive (than OOP, for Eg). The unreasonable effectiveness of multiple dispatchhttps://youtu.be/kc9HwsxE1OY
It seems like such an elegant idea, I’m somewhat surprised no one seems to have run with it earlier.
The power of multiple dispatch is an eye opener for me personally when I first learned about Julia.
It's hard to get back to OOP once you're used to multiple dispatch. It's so natural and gets rid of the the question of "which class should I write this method in"?
I don't think Julia is (or has ever claimed to be) the first system to make extensive use of multiple dispatch. But it seems to be first one to have gotten attention, if not widespread adoption, from the broader community beyond its first intended audience, i.e., scientific computing.
Julia’s definitely not the first, but I don’t see too many examples where they took the idea seriously enough as a design principle to build the language around it (that’s what I meant by “run with it”). I’ve seen Dylan often credited as one of the inspirations for Julia. While many other languages might support multiple dispatch, my impression is that they’re somewhat “patched on”, thereby limiting the benefits.
Absolutely. I guess I was trying to say (not very clearly) that ScmUtils was the only other example I know of that "ran with it." Though SICM is relatively well known at this point, I suspect ScmUtils is not very widely used.
That's an interesting point worth discussing. Julia is far from the first language to have multiple dispatch. Rather, what makes julia's take on the concept unique (as far as I know) is Julia's ability to optimize and de-virtualize generic functions.
Common Lisp had multiple dispatch through the CLOS, but functions which needed to be fast were not multiple dispatch. For instance, you can't overload multiplication or additional in Common Lisp, you instead need to shadow them and replace them with generic functions, but doing so incurs a runtime performance overhead. This is (usually) not the case in Julia because it's JIT compiler was designed around multiple dispatch and it's multiple dispatch semantics were designed around it's JIT compiler (this is a big reason why static compilation in Julia has been such a hard problem to solve!).
Because Julia can have MD without additional overhead, it's use is absolutely ubiquitous throughout the ecosystem and Julia's own internals. This ubiquity is what confers most of the benefit because you can patch into the gigantic space of method combinations just about anywhere to override behaviour.
It seems like such an elegant idea, I’m somewhat surprised no one seems to have run with it earlier.