What is “static typing”, and how is it similar/dissimilar to Smalltalk?
Static typing says the compiler checks the type-safety of every operation STATICALLY (at compile-time), rather than to generate code which will check things at run-time. For example, with static typing, the signature matching of fn arguments is checked, and an improper match is flagged as an error by the COMPILER, not at run-time. In OO code, the most common “typing mismatch” is invoking a member function against an object which isn’t prepared to handle the operation. E.g., if class “Fred” has member fn “f()” but not “g()”, and “fred” is an instance of class “Fred”, then “fred.f()” is legal and “fred.g()” is illegal. C++ (statically typed) catches the error at compile time, and Smalltalk (dynamically typed) catches the error at run-time. (Technically speaking, C++ is like Pascal–PSEUDO statically typed– since ptr casts and unions can be used to violate the typing system; which reminds me: only use ptr casts and unions as often as you use “goto”s).
Static typing says the compiler checks the type safety of every operation statically (at compile-time), rather than to generate code which will check things at run-time. For example, with static typing, the signature matching for function arguments is checked at compile time, not at run-time. An improper match is flagged as an error by the compiler, not by the run-time system. In OO code, the most common “typing mismatch” is invoking a member function against an object which isn’t prepared to handle the operation. E.g., if class Fred has member function f() but not g(), and fred is an instance of class Fred, then fred.f() is legal and fred.g() is illegal. C++ (statically typed) catches the error at compile time, and Smalltalk (dynamically typed) catches the error at run-time. (Technically speaking, C++ is like Pascal pseudo statically typed since pointer casts and unions can be used to violate the typing system; which reminds me: only use pointer casts and unions as often as you use go