3 ms·
As if "strong" and "weak" weren't overridden enough when it comes to type systems, many people will use "stronger" and "weaker" when talking about the relative
by steveklabnik 10y ago
As if "strong" and "weak" weren't overridden enough when it comes to type systems, many people will use "stronger" and "weaker" when talking about the relative amount of guarantees a static type system can give you. "C has a fairly weak static type system, and Haskell has a very strong static type system."
Since the "strong" vs "weak" axis of type systems is already not extremely useful, as very few languages are truly weakly typed, it's usually fine.
- phamilton 10y agoSigh. You're right. There's also a matter of how you use the language. One can make C a lot stronger by using structs as ADTs. Just have the struct include only one field (example, a minutes struct that's only one int). That gives you a lot of compile time guarantees (you can't add minutes and seconds without using a function designed to do so).
- catnaroek 10y agoOkay, then let me define a new axis: useful vs. useless type systems. A type system is useful to the extent types rule out implementation errors and/or miscommunication between the implementer and the user of an abstraction: (0) Algebraic data types, pattern matching and exhaustiveness checking rule out forgetting to handle all the qualitatively different possible outcomes of an operation. (1) Statically typed effects rule out sneaking effects into computations without making them knowable to the user. (2) Substructural type systems rule out resource leaks and uses after free. (3) Rust's borrow checker rules out concurrent modifications of the same object in memory. How usefully typed are C and Java?