3 ms·
Because 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
by junke 11y ago
Because 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.