Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can’t you solve this particular issue with extension methods the way Kotlin and C# do?


Extension methods rely on overloading, they don't use dynamic dispatch.


Yeah, but typically in these languages operators don’t really need dynamic dispatch. (Although, I agree this causes surprising results).


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).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: