3 ms·
> If you know the function to jump to at compile time and not wait to runtime to decide where to jump Well, I don’t know about more dynamic languages, but sing
by kaba0 4y ago
> If you know the function to jump to at compile time and not wait to runtime to decide where to jump
Well, I don’t know about more dynamic languages, but single dispatch can be very well optimized away, Java for example can determine how many possible implementation of a given method is loaded, and simply JIT compile or even inline the function if there is only a single implementation. Later, it can deoptimize that call, e.g. when a new class is loaded at runtime that also implements that method. This is one area where JIT is definitely in a better position than AOT compilers.