Is there a 1:1 mapping between static typing and static dispatch vs dynamic typing and dynamic dispatch?

138 Views Asked by At

Context: I'm learning Julia and trying to figure out multiple dispatch. I understand the conceptual leap from single dynamic dispatch to multiple dynamic dispatch, but I'm trying to pin down single dynamic dispatch.

Question: Is the following 1:1 mapping true:

  • In every language that has dynamic typing, there is dynamic dispatch
  • In every language that has static typing, there is static dispatch

I can't think of a situation in which you'd want

  • Static typing with dynamic dispatch (because the variables won't be dynamic, so why have dynamic dispatch?)
  • The opposite situation: dynamic typing with static dispatch (if a variable changes type, wouldn't you want the function to be called on the run time type?).
0

There are 0 best solutions below