Re:Wren is a small, fast, class-based concurrent scripting l...
by sirwhinesalot on Monday August 29, 2022 @04:22AM
(#32635882)
Extension methods rely on overloading, they don't use dynamic dispatch.
[ Parent
| on HN ]
Re:Wren is a small, fast, class-based concurrent scripting l...
by fiddlerwoaroof on Monday August 29, 2022 @03:04PM
(#32642153)
Yeah, but typically in these languages operators don’t really need dynamic dispatch. (Although, I agree this causes surprising results).
Re:Wren is a small, fast, class-based concurrent scripting l...
by sirwhinesalot on Monday August 29, 2022 @04:44PM
(#32643317)
C# and friends dispatch operators through overloading on static types. Extension methods rely on the same mechanism.
A dynamic language like Wren cannot use such a mechanism. The author already pointed out the options: the current OO-style dispatch, Python-style "if the operator is missing, try the reverse direction", or multimethods like Julia (which are quite complex and heavyweight).