|
|
|
|
|
by dlreeves
3779 days ago
|
|
Doing the type checking increases the minimum cost of evaluating a block of code. For instance consider this simple function. function int_id(x: int): int {
return x;
} If this code is executed with no run time checks then the body will do no work and return x. However if we are forced to perform run time type checks to enforce soundness then the body will look something like. function int_id(x: int): int {
assert(x is int);
return x;
} |
|