Comment by randomswede
5 years ago
I don't really care about the static/dynamic typing spectrum, I care about the strong/weak typing spectrum.
At any point, will the code interpret a data item according to the type it was created with?
A prime example of "weakly typed" is when you can add "12" and 34 to get either "1234" or 46.
This is an interesting distinction. I confess that I frequently interchange the pairs.
I mean, to some respect, "dynamic typing" is "type the data" and "static typing" is "type the variable".
In both cases, there's the possibility for doing type propagation. But, if you somehow manage to pass in two floats to an addition that a C compiler thinks is an integer addition, you WILL have a bad day. Whereas in Common Lisp, the actual passed-in values are typed (for floats, usually boxed, for integers, if they're fixnums, usually tagged and having a few bits less than you would expect).