Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsfeed.cit.cornell.edu!newsstand.cit.cornell.edu!news.kei.com!newsfeed.internetmci.com!chi-news.cic.net!news.luc.edu!uchinews!vixen.cso.uiuc.edu!sdd.hp.com!hplabs!hplextra!hplb!cdollin!kers
From: kers@hplb.hpl.hp.com (Chris Dollin)
Subject: Re: Types, types: static vs. dynamic -- classification
Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
Message-ID: <KERS.95Nov1153815@cdollin.hpl.hp.com>
In-Reply-To: Simon Kinahan's message of Wed, 1 Nov 1995 13:25:52 GMT
Date: Wed, 1 Nov 1995 22:38:15 GMT
References: <46b6vu$g72@watnews2.watson.ibm.com>
	<46h9g7$45s@news4.digex.net>	<46ihua$23p@outlaw.zfe.siemens.de>
	<vwj68hgx9lv.fsf@osfb.aber.ac.uk>	<46jrjp$h0k@watnews2.watson.ibm.com>
	<vwjd9ble2fm.fsf@osfb.aber.ac.uk> <DHD9B5.13J@Cadence.COM>
Nntp-Posting-Host: cdollin.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Lines: 54
Xref: glinda.oz.cs.cmu.edu comp.object:40124 comp.lang.smalltalk:30116 comp.lang.c++:157573 comp.lang.misc:23610

In article <DHD9B5.13J@Cadence.COM> Simon Kinahan <simonk> writes:

   pcg@aber.ac.uk (Piercarlo Grandi) wrote:

   >In most languages used in the past twenty years values are *implemented*
   >as untyped bitstrings, but that's just the *compiler's* business: the
   >*language* defines values as typed entities (save for modest exceptions
   >like the ability to do bitwise operations on integral types in C).

   Beep. Sorry, this is wrong. C defines the integer and character types as
   being bit strings, and programmers assume even more than is actually defined,
   and this is normally considered a reasonable practice. It applies much
   less to C++, but to do lots of things in C you *need* to know how the
   basic types are implemented, as 32, 16 and 8 bit bit strings. 

C and C++ are not ``most languages''; they are at most 2 languages.

   >Perhaps you should really revise your Smalltalk, for in no way in
   >Smalltalk "data describes itself" and "types were unneccessary baggage
   >from the past". For in Smalltalk data are described by classes (which
   >implement/are types) not by themselves, and Smalltalk is a strongly (if
   >latently) typed language. Again you seem to have forgotten the small
   >detail of the 'class' method of the Object class, which returns the,
   >ahem, "type" of a data object.

   Smalltalk objects certainly do carry a 'tag' stating their class, all
   objects have this and it is always right. However to call this a type
   and to say Smalltalk is 'strongly typed' is to use a very unusual
   definition of type.

It doesn't seem unusual to *me*; not necessarily *right*, but defensible.

   To say that a language is typed, as I see it, it must perform some
   checks on types, either at run time or at compile time.  To call a 
   language strongly typed it must perform these checks at compile
   time 

Terminology wars: that's *static* typing, not *strong* typing.

   in order to remove the possibility of some kind of error
   arising at run-time (modern C and C++ ensure that values are not
   unwittingly treated as being the wrong type, Standard ML ensures that
   no operation is ever performed on a value of the wrong type. etc). 

   Smalltalk does none of this, unless you count 'message not understood'
   as a limited form of dynamic type checking.

Whis is exactly what it is; ``you wanted to this to that, but you can't,
so there'', rather than ``you want to do this to that? fine ... *I* won't
be responsible for the consequences''.
--

Regards,    | ``"I can't suit myself," said Weinbaum, a little petulantly.
Kers.       | "I work for the Government".'' - Blish, "The Quincunx of Time".
