I wonder if static typing advocates really look at the world this way (or if they do that they find this picture funny, I know I do):

Found via Steve Yegge’s excellent follow-up to his now classic Bad Agile blog post.
I wonder if static typing advocates really look at the world this way (or if they do that they find this picture funny, I know I do):

Found via Steve Yegge’s excellent follow-up to his now classic Bad Agile blog post.
6 archived reader comments
John Lam (2006/10/08)
But a language like Ruby is a type-safe dynamic language (otherwise known as a strong-dynamic typed language). I think what you mean is that we get some measure of type-safety at compile time vs. run-time (perhaps via optional type annotations like what Python’s considering doing?) Now if this is the case, do you want this for the compile time type checking ability, or for performance? If the latter, the folks in the Smalltalk world have already discovered that optional type annotations are actually ignored in their quest to get higher performance - see Avi Bryant’s writeup of the Strongtalk VM here: http://smallthought.com/avi/?p=16. In the case of the former, if people program ‘static style’ then I think this will help catch the same class of bugs that we catch in C# today. However, if people program ‘dynamic style’ with liberal use of eval and method_missing, then many of the benefits of optional type annotations would be lost. Or is there some third scenario that you’re looking for?
Rob (2006/10/08)
I think the key (as Tomas mentions) is the "non-inferencing" modifier he uses. Staticly typed languages with powerful type inference are nearly as unlabeled as dynamic languages with the added bonus of at least some compile-time checking. I’m still very new to dynamic languages in general (if you don’t count javascript web programming stuff), so I know I’m not making a fair comparison, it’s just that when I think of strongly staticly typed I think of SML and how if my programs compiled, they basically worked, whereas when I think of dynamic I think of javascript and how I’d get goofy results because internally something was doing a string compare instead of a numeric one. By the same token, I love the method_missing and metaprogramming stuff in Ruby, so I guess I’m damned either way.
Bertrand (2006/10/10)
I meant it for type checking. Perf is a strange beast and all the Joels of the world should be careful about definitive assertions about perf, perfectly agreed. I value the eval and missing method features, as well as the ability to build an object field by field and extend it as needed, these are to me the essence of dynamic languages. My point is that those can be orthogonal to type safety. I really think that the benefits of type safety (which come from most methods being built to accept objects that have at least some expected behavior, which you can call a type, and anything else is an error) can be brought to dynamic languages without perverting them, and that the essence of dynamic languages can be brought to type-safe languages (which you can see a beginning for in C#3.0 for example). Another point is that type safety, although ideally enforced during compile-time, can also be enforced at runtime if no compile time exists. We’re doing that in Atlas for JavaScript, only in debug mode (so that in release you keep perf reasonable). It makes debugging a lot less painful and removes the pain of having to write the most repetitive unit tests: the only unit tests you need to write are the ones that ensure the semantics of your objects, not the ones that do the job of the compiler. And it’s declared through annotations.
Rob
I think the key (as Tomas mentions) is the “non-inferencing” modifier he uses. Staticly typed languages with powerful type inference are nearly as unlabeled as dynamic languages with the added bonus of at least some compile-time checking.
I’m still very new to dynamic languages in general (if you don’t count javascript web programming stuff), so I know I’m not making a fair comparison, it’s just that when I think of strongly staticly typed I think of SML and how if my programs compiled, they basically worked, whereas when I think of dynamic I think of javascript and how I’d get goofy results because internally something was doing a string compare instead of a numeric one.
By the same token, I love the
method_missingand metaprogramming stuff in Ruby, so I guess I’m damned either way.Bertrand
:) Good one, like about everything in the Far Side and the comparison with statically typed languages feels eerily right. On the other hand, “hi, can you quack, please? Good, you’re a duck then.” can also seem quite absurd. Seriously, I love dynamic languages, but I also love type safety. How about a type-safe dynamic language?
Tomas
LOL, Good one! (anyway, statically typed languages supporting type inferrence don’t need the signs ;-))