Joachim Durchholz <[EMAIL PROTECTED]> wrote: > Assume a language that > a) defines that a program is "type-correct" iff HM inference establishes > that there are no type errors > b) compiles a type-incorrect program anyway, with an establishes > rigorous semantics for such programs (e.g. by throwing exceptions as > appropriate).
So the compiler now attempts to prove theorems about the program, but once it has done so it uses the results merely to optimize its runtime behavior and then throws the results away. I'd call that not a statically typed language, then. The type-checking behavior is actually rather irrelevant both to the set of valid programs of the language, and to the language semantics (since the same could be accomplished without the type checking). It is only relevant to performance. Obviously, the language probably qualifies as dynamically typed for most common definitions of that term, but I'm not ready to accept one definition and claim to understand it, yet, so I'll be cautious about classsifying the language. > The compiler might actually refuse to compile type-incorrect programs, > depending on compiler flags and/or declarations in the code. Then those compiler flags would cause the compiler to accept a different language, and that different language would be a statically typed language (by which I don't mean to exclude the possibility of its also being dynamically typed). > Typed ("strongly typed") it is, but is it statically typed or > dynamically typed? So my answer is that it's not statically typed in the first case, and is statically typed in the second case, and it intuitively appears to be dynamically typed at least in the first, and possibly in the second as well. -- Chris Smith - Lead Software Developer / Technical Trainer MindIQ Corporation -- http://mail.python.org/mailman/listinfo/python-list