volume_mute

Languages that use dynamic type binding are usually slower

publish date2022/09/06 02:02:00 GMT+10

volume_mute
True
False

Correct Answer

True

Explanation

Languages that have dynamic type binding for variables are usually implemented using pure interpreters rather than compilers. Computers do not have instructions whose operand types are not known at compile time. Therefore, a compiler cannot build machine instructions for the expression A + B if the types of A and B are not known at compile time. Pure interpretation typically takes at least 10 times as long as it does to execute equivalent machine code. Of course, if a language is implemented with a pure interpreter, the time to do dynamic type binding is hidden by the overall time of interpretation, so it seems less costly in that environment. On the other hand, languages with static type bindings are seldom implemented by pure interpretation, because programs in these languages can be easily translated to very efficient machine code versions.

Reference

Concepts of Programming languages, 10th ed


Quizzes you can take where this question appears