Question about Julia's goals

Instead of concentrating on Julia OOP systems, native support type-stable function types decoupling from the function identifiers might count more.

We might not need OOP, but virtual methods can be useful for many scenarios without non-intensive computation – it’s a bit hard for Julia to manipulate containers of abstract types without runtime-compiled dynamic dispatch, while virtual tables compiles statically.

4 Likes

I’d love to get some deeper insight on this point, if you’re willing to explain further. My understanding was that vtables are usually attached to object instances, but with multiple dispatch it wouldn’t be clear which value to attach to since there isn’t a designated receiver object like with single dispatch? Additionally, I would imagine dynamic addition of methods in Julia would require updating vtables for every type said method might cover? (non-)Specialization might make the above points better or worse too.

Another argument I’ve seen made in the devdocs and elsewhere is that the method lookup part of dynamic dispatch mechanism can be pretty fast if the dispatch pattern is basically single dispatch. Have you found that to be not the case? It would be great to get some insight into what the bottlenecks are here.