Newsgroups: comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!portc02.blue.aol.com!newsjunkie.ans.net!newsfeeds.ans.net!news-w.ans.net!newsfeeds.ans.net!news.aloha.net!svr1.pdx.gstis.net!news-chi-8.sprintlink.net!news.sprintlink.net!news-hub.sprintlink.net!news.sprintlink.net!news-peer.sprintlink.net!hunter.premier.net!feed1.news.erols.com!howland.erols.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!pacbell.com!ames!taligent!uunet!in2.uu.net!uucp6.uu.net!world!bobduff
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Static vs. Dynamic typing again (was Re: OO, C++, and something much better!)
Message-ID: <E4t2ML.IqG@world.std.com>
Organization: The World Public Access UNIX, Brookline, MA
References: <JSA.97Jan16141937@alexandria> <01bc0a1e$faed8ce0$c318b993@jarvisb> <E4L15n.GnC@world.std.com> <5covaj$l0@boursy.news.erols.com>
Date: Thu, 30 Jan 1997 05:15:57 GMT
Lines: 40
Xref: glinda.oz.cs.cmu.edu comp.lang.smalltalk:50499 comp.lang.eiffel:18004 comp.lang.ada:56881 comp.object:60596

In article <5covaj$l0@boursy.news.erols.com>,
Damon Feldman <feldmand@erols.com> wrote:
>Statically typed means that types are *determined* at compile time.
>Dynamically typed means types are *determined* at runtime.
>
>Static type *checking* means checking done at compile time.
>Dynamic type *checking* means checking at run time, I suppose.

OK.

>"Checking" catches errors, "determining" types determines what class a 
>variable is (and therefore how it handles messages and what data it has access 
>to).

OK.

>But dynamically typed languages just generate errors rather than explicitly do 
>dynamic type-checking.  (This is a bit of a simplification, but that's the 
>idea.) 

Heh?  Smalltalk does a type check on the *target* of the message.  It
does not do a type check on the (other) parameters of the message.

>So Smalltalk is dynamically typed because objects can get different types at 
>runtime depending on execution,

This is true of Ada tagged types, and Eiffel types, too.

>... even though it is not type checked 
>explicitly beyond generating an error or automatically expanding collection 
>sizes, etc.

My point was that the difference between Ada/C/C++/Eiffel and Smalltalk
is not merely *when* the checks are done (compile-time vs. run-time),
but that Smalltalk does fewer checks.  In particular, it does not check
the type of each parameter of a message (not at run time, not at compile
time).  So, it's wrong to view the difference between these languages as
compile-time-type-checks vs. run-time-type-checks.

- Bob
