Hacker News new | ask | show | jobs
by blast 2170 days ago
Doesn't CLOS count? That was a lot earlier.
2 comments

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.