Re:Starlight.jl – A game engine written in Julia
by adgjlsfhk1 on Tuesday June 07, 2022 @01:35AM
(#31650245)
this last point is misleading enough to be basically false. python has a library to do multiple dispatch, but the hard parts of multiple dispatch isn't the feature, it's making it fast enough to be usable. the python library only works at run time, which means ever function call using it will take at least a few microseconds. this is ok for niche use cases, but it's 1000x too slow for general use. the reason multiple dispatch in Julia is actually powerful is that the compiler can resolve almost all of the dispatches at compile time, so you don't have to pay for them at runtime.
Re:Starlight.jl – A game engine written in Julia
by JustFinishedBSG on Tuesday June 07, 2022 @05:07AM
(#31651648)
> Python is flexible enough that multiple dispatch can be done as a library without being a language feature.
So using a library to add multiple dispatch to Python is fair game but using one of the various Traits library in Julia to enforce interfaces isn't ? Why ?
Protocols. Though, yes, you can also use class inheritance.
> I suppose you know that multi-dispatch is basically strictly more generic than Class-based OOP,
Python is flexible enough that multiple dispatch can be done as a library without being a language feature.