It's not "his classification", just his example.
The classification is established terminology in Computer Science.
>Since both will likely be represented by strings, it will return garbage, "weak" in your definition.
It's not his definition, and it's not weak in this case. Weak is not about getting garbage or not, it's about the semantics of a behavior. It could be that the result of the weak behavior is exactly what one wanted (e.g. to add a string to an SQL statement -- I might be adding together SQL statements and text about them to produce a book on SQL with my script).
In any case, the SQL statement is a string in Python, not its own type, so the result will not be weakly checked, it will be strongly checked as what it is (a string) -- Python will do what it should.
No. It is terminology used by the dynamic language communities, not by academics.
For example:
http://www.lucacardelli.name/Papers/TypefulProg.pdf
https://dl.acm.org/citation.cfm?id=97964
https://www.usenix.org/legacy/event/sec09/tech/full_papers/r...
https://dl.acm.org/citation.cfm?id=382281
https://ieeexplore.ieee.org/abstract/document/660187/?reload...
https://dl.acm.org/citation.cfm?id=38823
https://patents.google.com/patent/US7086041B2/en
https://link.springer.com/chapter/10.1007/978-3-642-03359-9_...
https://ieeexplore.ieee.org/abstract/document/4085614/
https://ieeexplore.ieee.org/abstract/document/287604/
You said academics don't use the terms - you were given examples that do so.
None of them need to define it - if you're interested, you can do that research.
Those terms don't have definitions in type theory and that's ok. Systems defined in the type theory deal with very explicit, theoretical analysis that usually maps well only to static-strong implementations.
from pathlib import Path
p = Path(".")
print("some random string" + p)
If you store typed data as generic strings, of course, it’ll work but no language has an AI which will prevent you from being lazy about that.
What the language provides matters. For code like "1"+1 you have 4 main options:
- strong static - doesn't compile/start due to type error
- weak static - returns "11" and expression is known to result in a string at compile time
- strong dynamic - crash/exception at runtime
- weak dynamic - returns "11" at runtime, but the type is attached to the value, not the original expression