What is Expressiveness in a Computer Language
David Hopwood
david.nospam.hopwood at blueyonder.co.uk
Sun Jun 25 11:22:32 EDT 2006
Joachim Durchholz wrote:
> Andreas Rossberg schrieb:
>
>> Luca Cardelli has given the most convincing one in his seminal
>> tutorial "Type Systems", where he identifies "typed" and "safe" as two
>> orthogonal dimensions and gives the following matrix:
>>
>> | typed | untyped
>> -------+-------+----------
>> safe | ML | Lisp
>> unsafe | C | Assembler
>>
>> Now, jargon "dynamically typed" is simply untyped safe, while "weakly
>> typed" is typed unsafe.
>
> Here's a matrix how most people that I know would fill in with terminology:
>
> | Statically | Not |
> | typed | statically |
> | | typed |
> ---------+--------------+-------------+
> typesafe | "strongly | Dynamically |
> | typed" | typed |
> | (ML, Pascal) | (Lisp) |
Pascal, in most of its implementations, isn't [memory] safe; it's in the same
box as C.
> ---------+--------------+-------------+
> not | (no common | "untyped" |
> typesafe | terminology) | |
> | (C) | (Assembly) |
> ---------+--------------+-------------+
I have to say that I prefer the labels used by Cardelli.
> (Terms in quotes are challenged on a regular basis, or rarely if ever
> applied.)
>
> With the above terminology, it becomes clear that the opposite if
> "(statically) typed" isn't "statically untyped", but "not statically
> typed". "Statically typed" and "dynamically typed" aren't even
> opposites, they just don't overlap.
>
> Another observation: type safeness is more of a spectrum than a clearcut
> distinction. Even ML and Pascal have ways to circumvent the type system,
Standard ML doesn't (with just the standard basis; no external libraries,
and assuming that file I/O cannot be used to corrupt the language
implementation).
> and even C is typesafe unless you use unsafe constructs.
> IOW from a type-theoretic point of view, there is no real difference
> between their typesafe and not typesafe languages in the "statically
> typed" column; the difference is in the amount of unsafe construct usage
> in practial programs.
It is quite possible to design languages that have absolutely no unsafe
constructs, and are still useful.
--
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the Python-list
mailing list