4 ms·
"weak typing" usually means a type system (static or dynamic) where there are many implicit coercions going on. "strong typing" requires these casts to be writt
by klibertp 12y ago
"weak typing" usually means a type system (static or dynamic) where there are many implicit coercions going on. "strong typing" requires these casts to be written explicitly.
The only languages I know which would fit your definition of "weak typing" are Forth and Assembly (no implicit casts ever, no type checking at all). Maybe TCL, but I'm not sure. Anyway, using your definition, every other language would become "strongly typed". And this wouldn't be very practical, I think, because then we'd have no way of distinguishing type systems of for example PERL and Python.
- cbd1984 12y ago> "weak typing" usually means a type system (static or dynamic) where there are many implicit coercions going on. "strong typing" requires these casts to be written explicitly. This makes no sense, because both of those definitions assume the runtime and/or compiler has the same amount of type information available to it, and the only difference is what the runtime and/or compiler chooses to do with it. Weakly typed languages have less type information, either because they never had it or because they allowed the programmer to throw it away. Casts and conversions are not the same thing: A cast throws away type information so the same data can be used in a different way, a conversion uses the type information to change the data (or prove no change is needed) in order to use it in a different way. C has casts, Javascript has conversions. C is weakly typed, Javascript is strongly dynamically typed.
- kyllo 12y agoI think the appropriate term for languages like FORTH and assembly is "untyped."