[squeak-dev] looking for papers/anecdotes/slide-decks on variable typing vs value typing

Ralph Johnson johnson at cs.uiuc.edu
Fri Apr 10 14:03:57 UTC 2009

> A very interesting article that anyone interested in the topic must
> read: "What To Know Before Debating Type Systems"
> http://www.pphsg.org/cdsmith/types.html

i disagree that "strong typing" doesn't mean anything.  Weak typing
means "has a type system but it is easy to get around it".  Strong
typing means "has a type system and you can't get around it easily".
Strong typing certainly does NOT mean compile-time typing.

I agree that "dynamic" (checked at run-time) vs. "static" (checked at
compile-time) is what is important.  C and Fortran have weak static
type systems.  Java has a strong static type system, but only because
casts are checked at run-time, i.e. the static type system has holes
in it but the run-time system patches those holes.  Smalltalk has a
strong dynamic type system; there is no way to run a method on an
object that it doesn't belong to.

I thought that the comments about the relative importance of testing
was interesting.  However, I find that it is just as important to do
unit testing in Java as in Smalltalk.  I disagree with the assumption
that implicit types (i.e. type inference) makes things easy.  I
haven't done any programming in ML or Hascall but I used to share an
office with a couple of ML fans and every so often they would get a
type error that took them a very long time to understand.  Type
inference is great when it works, not so great when it doesn't.

The big advantage of dynamic types over static types is that static
type system are conservative, so they will sometimes keep you from
writing programs that would work with a dynamic type system.  On the
other hand, languages keep getting more powerful type systems, so this
advantage is shrinking.

-Ralph Johnson

More information about the Squeak-dev mailing list