Python Strings

Darren New dnew at san.rr.com
Wed Sep 6 18:30:49 CEST 2000


Keith Ray wrote:
> What most people mean by "strongly-typed" or "staticly typed" is "there
> is compile-time checking of variable types" (and parameter-types, and
> function-return-types and expressions being assigned or passed into
> variables/parameters/etc.).
> 
> What most people mean by "weakly-typed" or "dynamically typed" is "there
> is only run-time checking of variable types" (and parameter-types, and
> function-return-types and expressions being assigned or passed into
> variables/parameters/etc.).

The problem is that these are four different terms that mean four different
things. Weakly-typed is not at all the same as dynamically typed.

C is statically typed and weakly typed. Smalltalk is dynamically strongly
typed. There are dynamically weakly-typed languages (FORTH, perhaps?) and
static strongly-typed languages (Pascal, say).

Static/dynamic refers to whether variables have types checked by the
compiler. Strong/weak refers to how easy it is to circumvent the type of
values, i.e., do inappropriate things with the bitpatterns. I'm not sure how
the normal terminology applies to type inference systems, but I'm pretty
sure it's at least strongly typed; I'm not sure if it's considered dynamic
or static or something else.

Once one straightens this out, the confusion tends to go away.

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
"No wonder it tastes funny. 
            I forgot to put the mint sauce on the tentacles."



More information about the Python-list mailing list