Newsgroups: comp.object,comp.lang.c++,comp.lang.ada,comp.lang.clos,comp.software-eng
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!gatech!swrinde!cs.utexas.edu!math.ohio-state.edu!newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
From: shang@corp.mot.com (David L. Shang)
Subject: Re: Static typing, modularity, flexibility (was: C++ not OOP?)
Reply-To: shang@corp.mot.com
Organization: MOTOROLA 
Date: Thu, 1 Jun 1995 20:21:52 GMT
Message-ID: <1995Jun1.202152.26900@schbbs.mot.com>
References: <3qkr8t$p7o@hardcopy.ny.jpmorgan.com>
Sender: news@schbbs.mot.com (SCHBBS News Account)
Nntp-Posting-Host: 129.188.128.126
Lines: 76
Xref: glinda.oz.cs.cmu.edu comp.object:31904 comp.lang.c++:131207 comp.lang.ada:30757 comp.lang.clos:3087 comp.software-eng:33300

In article <3qkr8t$p7o@hardcopy.ny.jpmorgan.com> Alexandre Odoux  
<odoux_alexandre@jpmorgan.com> writes:
> Dynamic typing is associated with dynamic binding; messages are really 
> messages sent to instances and require a run-time system, i.e. Objective C
> in Nextstep/Openstep.
> 
Since it is relivant, I'd like repost my opinion into this thread.

We have words -- static/dynamic, strong/weak and safe/unsafe -- to
describe a type system. Let's forget about those words for the
time being and consider type systems themselves: how many kinds of
type systems we have. Then we can decide a name for each type system.

We have:

(1) How types are defined

(1.1)	Types can only be defined statically (in program);
(1.2)	Types can be created at run-time. However, types are constant,
	i.e. once a type is created, its state can not be changed
	during its life time;
(1.3)	Types can be created at run-time and their states can be
	modified after they are created;

(2) How declared names are typed

(2.1)	Names are untyped;
(2.2)	Names are typed exactly;
(2.3)	Names are typed polymorphically;

(3) When a type is checked ( A type check is to check the type of a
    value to see if the type of the value conforms to the declared
    type of the name which is going to be bound. )

(3.1)	Binding a value to a name is not type checked at all
(3.2)	Binding a value to a name is checked at compile-time only
(3.3)	Binding a value to a name is checked at run-time only
(3.4)	Binding a value to a name is checked at either at
	compile-time or at run-time

(4) When a type error is reported ( A type error is a binding of a value
    to a name in which the type of the value voilates the declared
    type of the name. )

(4.1)	Not all type errors are detected at any time
(4.2)	All type errors are detected at compile-time
(4.3)	All type errors are detected at run-time
(4.4)	All type errors are detected either at compile-time or
	at run-time

Note that (1) =/ (2) =/ (3) =/ (4).

Particularly, (3) is not equivalent to (4). For example, using
types witch statement, a compiler can reject programs which may
havve type errors at run-time. The actual type check is performed
at run-time, however, once the program passed by the compiler,
it is guaranteed free of run-time type error.

Now, please give each word for each type system. I would like to
have:

Static/dynamic typing for (1);
		  ^^^
Untyped/statically-typed/dynamically-typed for (2);
		      ^^		^^
Static/dynamic type checking for (3);

Unsafe/statically-safe/dynamically-safe for (4);

How should we use the words "weak" and "strong"? If they are
controversial or ambiguous, let's forget them.

David Shang



