Re:Ovld – Efficient and featureful multiple dispatch for Python
by rahulprasath on Sunday June 01, 2025 @03:57AM
(#44149340)
Why don’t mainstream languages like Python just support multimethods directly?
[ Parent
| on HN ]
Re:Ovld – Efficient and featureful multiple dispatch for Python
by RadiozRadioz on Sunday June 01, 2025 @05:02AM
(#44149573)
Many of them do, e.g. Java. Why don't _some_ mainstream languages like Python not support it? Entirely design preference, usually because they want to have less emphasis on the type system.
Re:Ovld – Efficient and featureful multiple dispatch for Python
by pdhborges on Sunday June 01, 2025 @06:26AM
(#44149855)
Java supports it? Are you conflating method overload (which is statically determined) with multimethods?
Re:Ovld – Efficient and featureful multiple dispatch for Python
by perlgeek on Sunday June 01, 2025 @06:11AM
(#44149808)
Probably because typing in Python is optional and kinda bolted-on after the fact, and you really need a good type system to get the most out of multimethods.
In particular, type declarations, as they were first introduced in python, did not have a run-time effect, and they very much have a run-time effect with multi methods.
(Dataclasses are kind of an exception to this rule, but one that feels far less fundamental than multi dispatch would).