@Datseris asked if there’s a formally citable reference with the points, examples and concepts presented by @StefanKarpinski on The Unreasonable Effectiveness of Multiple Dispatch.
In the slack discussion linked above, they suggested a 3 page write-up with appropriate citations. Stefan responded that this write-up should have empirical evidence in contrast with the anecdotal evidence he presented in his talk.
This thread may or may not be useful for the composition of such a write-up, but I thought it useful to open it as a community-curated list of examples where multiple dispatch has been leveraged to great efficiency and effectiveness. I would imagine this thread could be a useful link for people curious about why we rave on about multiple dispatch.
Some ideas on what might be informative and enlightening to share:
- Package interoperability examples.
- Your specific experiences at work.
- Links to other resources on the same topic (maybe with your TL; DR), including other threads in this Discourse on the same topic.
Note that this thread is not motivated on asking “how” multiple dispatch works, but demonstrations on what it has been used for, and how it has benefited you/us. The hope is that this thread will contribute to a nice, referenceable publication specifically on multiple dispatch.
Without further ado, what are your favourite examples of multiple dispatch?
Edit 1: There are many arguments re composability and comparisons between languages. To help with the scope of this thread, keep it positive to examples where Julia’s multiple dispatch design did help. We can worry about the arguments later, or in another post (see my first response in this thread).
Edit 2: That said, @Datseris has an awesome example of composability he wrote up, and links to below.