I very rarely see impolite or unfriendly answers on this forum, even when OP really deserved some. I personally think we are quite good at that. I do, however, occasionally see unsympathetic or unhelpful answers, which are IMO the topic of this thread.
As inappropriate a reaction it may be given the topic of this thread, that link did give a good chuckle :')
??? (just to avoid being rude)
In my experience, people here are extremely helpful and nice. However, thereâs often a product manager approach to answering some types of questions, which I find unhelpful.
In particular, sometimes people come in with real issues (not âJulia is not exactly how I want it to beâ) and peopleâs answers are more âyou shouldnât be doing thatâ or âwhy would you want to do thatâ instead of âyeah, that is a limitationâ.
I donât want to point fingers, so I wonât link to any posts. Iâll just say there are numerous topics asking for help in compiling Julia code to a small .exe and lots of answers try to convince the OP that open source is the only way to go and users should be able to modify code, instead of acknowledging this is indeed a limitation and that itâs fine if itâs a deal breaker. Same goes for time to first plot, where people often try to convince others this is not a problem or talk about how much it improved, instead of going straight to acknowledging the limitation and suggesting the well known workarounds (while acknowledging their imperfect nature).
So it seems to me people are quite defensive.
But again, very friendly and helpful as a community. Iâve been helped numerous times here.
While multiple dispatch and static overloading are different, I cannot say how important that difference is for everyday work.
I realize that I could not really answer to these kind of comments at the time, but now a comment seen elsewhere helps me a lot:
Dynamic dispatch is slow in Julia â slower than C++ virtual methods, because C++ method dispatch only depends on a single object type (this) and hence can use vtable lookup. High-performance code in Julia always relies on devirtualizing critical code. This also means that you canât easily write performant geometry code in Julia by having an array of geometric objects of different types and relying on dynamic dispatch to execute different methods (determined at runtime) for different objects ââŚ
This is a (probably much more technically soundâŚ) rewording of the issue behind the âmarketing paradoxâ I was trying to communicate:
-
There are many discussions where both static overloading and single dispatch are completely dismissed as valid alternatives to multiple dispatch, see e.g.
-
https://www.youtube.com/watch?v=kc9HwsxE1OY, where both alternatives are strongly stated as inferior.
-
Claim (false): Julia isn't multiple dispatch but overloading, where you find a veeeery long technical debate about how much âno matter what practically happens in the JIT processâ Juliaâs multiple dispatch cannot be regarded as equivalent to static overloading (to be clear I agree, semantics-wise, but sometimes one has to be practicalâŚ).
It is even suggested, in both sources, that C++ templating is just syntactic sugar to static overloading, hence less powerful than multiple dispatch. Well, here I want to explicitly answer to @DNF: this is why I think my definition of dynamism matches more to what the community has strongly pushed as the branding of Julia⌠the whole point made âagainstâ templates is that they have the same semantics of static overloading, hence not capable of dynamism. But in my understanding templates/generics are a first class technology for generic programming and polymorphism, the only thing lacking being runtime behavior, which is why I got that dynamism itself is âa good part of what the Julia hype is aboutâ. Otherwise multiple dispatch would just be (and be marketed as) a respectable alternative to other languagesâ solution for generic programming (which is what I think it really is, at this point).
-
-
As I said many times, but Steven is able to convey way better, whenever performance is relevant you should totally avoid (let me add here a âtrueâ) runtime semantics and stick to devirtualization. As Steven as clarified to me elsewhere this does not really âdowngradeâ multiple dispatch to static overloading, but still rules out what I was calling âuninferrable dynamismâ.
-
In the original post Steven was replying to, you have a real-world example of why there may be a âneed to reduce dynamismâ, for performance reasons. I still do not really get the technical difference between devirtualization and âcall site inferenceâ so I cannot really comment on the power of the mechanism you apparently usually rely into. Maybe thatâs the true point generating my concern.
avoid (let me add here a âtrueâ) runtime semantics and stick to devirtualization
Devirtualized dispatch still uses runtime semantics. It still avoids the expression problem (you can add new virtual methods to existing types, and new types to existing virtual methods, and use both in type-generic code).
Exploiting the devirtualization optimization mainly means that you want to avoid highly heterogeneous containers in critical inner loops (besides some fairly superficial coding-style constraints like type stability). This seems to be only rarely a burden in practice.
Well, the occasional references to the expression problem are another source of confusion for me about this âdynamic vs staticâ thing:
As formulated on Wikipedia, the expression problem concerns statically typed languages and requires static semantics (yes I know you donât do casts in Julia⌠itâs just that your core-language semantics lie somehow outside all of this pre-existent formalizations I guess). You may have found the definitive solution, or you may be a little cavalier about these kind of statements. I donât really know.
Well itâs 100 comments in, but I think maybe the biggest problem is simply that we LOVE Julia and love is a strong emotion. We know the flaws as well as anyone. We pay for the pain points in blood, but we believe, we hope and try not to hope too much but itâs just SO GREAT when you get some crucial code down to 0 allocations. When haters hate on your team you canât always be super rational. I just want to say that coding is something I spend a lot of time doing, and Iâd rather feel the love and excitement and be a little irrational with the haters than play it cool and code in C++. Ideally weâd feel the love and keep the cool, and I think we usually do. Extreme value statistics on the distribution of humans comprising a community drive a lot of perceived irregularities.