3 ms·
>It would report the error in foo() when foo() is invoked That's "dynamic typing". >Only code paths that actually get executed are dynamically checked. This c
by MustardTiger 11y ago
>It would report the error in foo() when foo() is invoked
That's "dynamic typing".
>Only code paths that actually get executed are dynamically checked. This checks all code paths in the method.
Ok, so it is extended dynamic typing. Why on earth is it being described as having anything to do with static typing?
- junke 11y agoBecause it uses static analysis techniques, that's all. You type variables and consider all execution paths at once, instead of executing code and checking the types of values. In particular, the code that was generated won't get executed if it can be proved beforehand that there is a type error. I agree that in effect you won't get an error message until execution, but that does not mean that this is dynamic typing. Execution time and compile time are generally interleaved with metaprogramming so it can make sense to consider static-analysis for code at runtime. What I found strange is the fact that it happens "Just-In-Time", which for me means at the last possible moment. This is counter-intuitive with what static typing aims to do. I would prefer "ASAP static-typing" (the code could be analyzed long before it is run). That's why I still find the COMPILE approach of Lisp better, since we have precise control over when analysis is done.