weak versus dynamic, definitional origins

Russ Salsbury rcs at russellsalsbury.com
Fri May 16 21:30:52 EDT 2003


andrew cooke <andrew at acooke.org> wrote in message news:<mailman.1053102327.2952.python-list at python.org>...
> there are two different things:
> 
>  - static or dynamic typing
>  - strong and weak typing
> 
> you can have them in any combination (static+strong, static+weak,
> dynamic+string, dynamic+weak).
> 
> static/dynamic relates to whether types are defined in the source.
> 
> strong/weak relates to whether types are defined in the runtime
> system.

Actually the strong weak axis is determined by how strongly the type
system is enforced.  Types don't necessarily have to be defined at
runtime.  Pascal is a static-strongly typed language enforced mostly
at compile time.  C is less strongly typed than Pascal because there
are more loopholes, e.g. unions and pointer manipulations; very little
is enforced at runtime. Python is a strongly typed language enforced
at runtime.

Michael Scott in "Programming Language Pragmatics", p321: A language
is said to be strongly typed if it prohibits, in a way that the
language implementation can enforce, the application of any operation
to any object that is not intended to support that operation. A
language is said to be staticly typed if it is strongly typed and the
type checking can be enforced at compile time.

I guess he means that a static-weakly typed language doesn't make any
sense.  You type all those declarations and the compiler just ignores
them.

Then I thought I would get a few pithy comments from Jeffrey Ullman,
"Elements of ML Programming", just to bolster my case: "ML is a
strongly typed language, meaning all values and variables have a type
that can be determined at 'compile time'."  Good grief! What does he
know about languages? ;-)

Way at the end of the strong weak axis are untyped languages like
Bliss and assembly language, where the type information is embodied in
the opperation:
    addf  fr0,a    ; a must be float
    addi  r1,a     ; maybe it's an int

Judging from what is going on in the "passing by reference" thread
(100 articles!), we had better get quick agreement or another set of
useful concepts will be turned into mush. :-)

-- Russ




More information about the Python-list mailing list