Andrew Lentvorski wrote:
In addition, you can lose optimization opportunities when faced with weak typing. If I know that 100% of the time I have integers as arguments to a function, I can throw away the time wasted to check that I have integers rather than doubles. Weak typing can't do that.
Actually, with weak typing, you don't have to care about what the actual type of the objects is so you can optimize away, but I am guessing you were simply referring to dynamic typing.

Anyway, you'd be wrong to assume that you can't do those kind of optimizations. Check out StrongTalk for a specific example of how it can be done. It just requires a more clever runtime.
Languages exist in which typing is dynamic and strong. Common Lisp is further toward the strong side and can use optimization directives to take advantage of that. I believe that Haskell and OCaML are also dynamic and strong in terms of typing.
Haskell and OCaml both use static typing, but they are both strongly typed.

I think your terminology is not consistent with standard terminology. Can you explain what you mean by strong vs. weak and static vs. dynamic?

--Chris

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to