types of types (was: Common Smalltalk VM Summit)

Jecel Assumpcao Jr jecel at merlintec.com
Fri Oct 6 18:58:10 UTC 2006


J J wrote:
> I'm confused.  I thought type-feedback wasn't going to give and speed 
> improvements.  If not, then what does it buy?

Michael Haupt and David Griswold already gave you very good answers so I
would just like to list the various terms associated with "type" so any
future discussions can make sense.

- Strong types vs weak types vs untyped systems:

Systems with strong types strictly enforce the association between a
given object and the operations on it. In practice there are always
situations where you have to weaken the type system to get things done,
which can be through explicit casts (to use the C term), implicit casts
or through unions (C's term for variable records). In a system like
Forth or assembly language the data is just bits and you can do any
operations on them, so these are the only systems that are actually
untyped.

- Dynamic types vs static types:

Dynamic types are checked at run time and so imply that there is some
information stored in the data itself that the system can look at.
Static types are declared in the source code and the compiler makes sure
that the generated code does the right thing with no run time checks.

- Concrete types vs abstract types:

Concrete types define such details as the memory layout of information
and actual machine instructions needed to implement its operations. In
principal this should be of interest only to the compiler. Abstract
types define the set of source level operations that are understood by
the objects and are what the programmer thinks in terms of.

Taking just the latter two axis, let me give you examples of the four
possible combinations:

Dynamic concrete types - Strongtalk's run time feedback system
Static concrete types - long/int/short in C, any PL/I declaration,
Java's primitives
Dynamic abstract types - type inference application in an image based
system
Static abstract types - Strongtalk's optional declarations

-- Jecel



More information about the Squeak-dev mailing list