4 ms·
> These terms do not mean the same thing What do they mean?
by igouy 8y ago
> These terms do not mean the same thing
What do they mean?
- kazinator 8y ago"Weakly typed" means that the type system doesn't detect and prevent all situations whereby a datum is misused as if it were of a different type. Programs may misbehave due to type confusion, running off with incorrect results. "Dynamic typing" means that run-time values carry type information. Dynamic typing that checks that type information everywhere and diagnoses misuses can be called strongly typed. Static and dynamic situations can be weakly or strongly typed. Ada is more strongly typed than C. Common Lisp is more strongly typed than someone's one-weekend project whose car function cheerfully accepts an integer-typed value and uses it as a cons cell.
- igouy 8y ago"Type safety is the property that no primitive operation ever applies to values of the wrong type." page 263 "Programming Languages: Application and Interpretation" Shriram Krishnamurthi 2003 ---- "Historically, people have sometimes used the phrase strong typing to reflect the kind of type-checking that ML and Java use, and weak typing for the other kinds. However, these phrases are at best poorly defined. … Indeed, the phrases are not only poorly defined, they are also wrong, because the problem is not with the “strength” of the type checker but rather with the nature of the run-time system that backs them. The phrases are even more wrong because they fail to account for whether or not a theorem backs the type system." https://papl.cs.brown.edu/2018/safety-soundness.html#%28part._.Types_.Versus_.Safety%29 https://papl.cs.brown.edu/2018/safety-soundness.html#%28part...
- deleted 8y ago[deleted]
- kazinator 8y agoAlso, there has been a use of "strongly typed" to denote the idea that alias names for types such as integers are incompatible. In this sense, Pascal family languages were called "strongly typed", whereas C isn't, because a typedef int user_id_t; isn't a new type, but just a name for int that can be passed everywhere an int can be passed. C character handling is also "weakly typed": characters are just kinds of integers: we don't need ord(ch) to get a character's code, or chr(n) to produce a character. C implicit arithmetic conversion behaviors are also weakly typed in this sense.
- igouy 8y agoIt's been used to mean this, it's been used to mean that -- now it means we always have to ask what someone actually means.