4 ms·
1 + 'hello' resulting in a seg fault would be a "type related error" 1 + 'hello' resulting in an Exception would be a product of dynamic type checking. A lang
by bendbro 9y ago
1 + 'hello' resulting in a seg fault would be a "type related error"
1 + 'hello' resulting in an Exception would be a product of dynamic type checking.
A language would not be able to explicitly throw a type related error unless it had some information regarding the type of the data.
Most resources show little confusion on this, I think you are wrong. https://stackoverflow.com/questions/1347691/static-vs-dynamic-type-checking-in-c https://stackoverflow.com/questions/1347691/static-vs-dynami...
- KirinDave 9y ago> 1 + 'hello' resulting in an Exception would be a product of dynamic type checking. Incorrect. It might be the product of a run time type check. It is not inherently so. You ca't even be sure you actually had a type error when you get a TypeError. But even then, this is using "type check" in the most vacuous and equivocal way possible. It's not the concept most people are referring to. > A language would not be able to explicitly throw a type related error unless it had some information regarding the type of the data. You (and this resource to some extent) are confusing strong vs weak typing with static vs dynamic typing. A + method might have a type check embedded (esp python since + is magical), but it's actually quite rare of that a.foo(b) is anything other than an assertion that the object A's vtable-analogue has an entry. This is sort of dynamic typing, in the sense that I can think of formalisms that model this (named extensible row types come to mind), but this is a profoundly useless defintion of "type." I'm not sure why we'd tolerate redefining type checking to a worthless concept and then using that divergent definition to imply that it's unhelpful. It's 2017, functional languages are fully baked. Powerful static type systems exist even for the Javascript environment and they are taking over that ecosystem rapidly.
- bendbro 9y agoIt seems python itself also confuses these topics then. https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic...
- blain_the_train 9y agoI find it amusing that the first look Google gives me on strong vs weak typing says there like static vs dynamic typing. Then wiki says there is no strong definition for either term. Maybe it would be easier to drop those terms and go one level deeper?
- KirinDave 9y agoThere isn't too much confusion, but people bend over backwards to avoid having their type system called "Weak."