3 ms·
> But if checks are built in there is no way to remove them Sure there is: you have a compiler which recognizes uses library functions and makes code generatio
by kazinator 5y ago
> But if checks are built in there is no way to remove them
Sure there is: you have a compiler which recognizes uses library functions and makes code generation decisions based on whatever information is available at the call site.
And this is easier to do for built-in functions, whose definition you can assume from the spec.
The simplest example is constant folding. If isEven is part of the language, a compiler can constant-fold isEven(0) to true even if no inline definition of it is visible.
- sesm 5y agoThat’s interesting. How does compiler know that some piece of code is a removable check?