4 ms·
“Strong enough for what I want” is fine. But the author's point is unclear. Strong compared to what? Did the author mean “strong compared to Smalltalk”? Did the
by halosghost 11y ago
“Strong enough for what I want” is fine. But the author's point is unclear. Strong compared to what? Did the author mean “strong compared to Smalltalk”? Did the author mean “Go and Swift are Equally Strong”?
“Strong” and “Weak” don't mean anything in discussions of typing without a reference-point.
- catnaroek 11y ago“Strong” vs. “weak” doesn't mean anything at all. Let's stick to distinctions that actually make sense: (0) Statically typed [e.g., Java] vs. not statically typed [e.g., Python]. (1) Dynamically typed [e.g., Java] vs. not dynamically typed [e.g., Haskell]. Yes, Java is both statically and dynamically typed. (2) Safe for arbitrary resources [e.g., Rust] vs. only memory-safe [e.g., Python] vs. totally unsafe [e.g., Objective-C]. (3) Typeful [e.g., Haskell] vs. not typeful [e.g., Objective-C]. (4) Global [e.g., Standard ML] vs. local [e.g., Scala] vs. no type inference at all [e.g., Java]. (5) Reflective [e.g., Common Lisp] vs. not reflective [e.g. Rust]. (6) Fixed [e.g., Standard ML] vs. extensible on top of a fixed core [e.g., C++] vs. extensible and modifiable [e.g., Common Lisp].
- dllthomas 11y agoThis is a very good list. With respect to Haskell and dynamic typing, I am curious whether you had considered Typeable and Data.Dynamic in your analysis (and, in general, your thoughts on how they relate to the distinction being made).
- catnaroek 11y agoIf I understand correctly, and I might be wrong, `Typeable` and `Data.Dynamic` require dedicated support from GHC, and couldn't possibly be implemented entirely as user libraries. This makes them core language features in my book. So the language specified in the Haskell Report isn't dynamically typed, but the GHC Haskell dialect is dynamically typed.
- dllthomas 11y agoAh, yes, report vs ghc is sometimes a very important distinction. Your assessment sounds correct.
- tome 11y agoI believe the situation is that Dynamic only requires Typeable, and Typeable only requires unsafeCoerce plus the trust that bad instances are never created.
- catnaroek 11y ago> unsafeCoerce GHC-specific implementation detail. > the trust that bad instances are never created The only way I can trust it is if the compiler enforces it, at which point it isn't “just a library feature”.