What is Expressiveness in a Computer Language

Rob Thorpe robert.thorpe at antenova.com
Fri Jun 23 13:20:39 EDT 2006


Andreas Rossberg wrote:
> Rob Thorpe wrote:
> >
> > Its easy to create a reasonable framework.
>
> 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.

Consider a langauge something like BCPL or a fancy assembler, but with
not quite a 1:1 mapping with machine langauge.

It differs in one key regard: it has a variable declaration command.
This command allows the programmer to allocate a block of memory to a
variable.  If the programmer attempts to index a variable outside the
block of memory allocated to it an error will occur.  Similarly if the
programmer attempts to copy a larger block into a smaller block an
error would occur.

Such a language would be truly untyped and "safe", that is safe
according to many peoples use of the word including, I think, yours.

But it differs from latently typed languages like python, perl or lisp.
 In such a language there is no information about the type the variable
stores.  The programmer cannot write code to test it, and so can't
write functions that issue errors if given arguments of the wrong type.
 The programmer must use his or her memory to substitute for that
facility.  As far as I can see this is a significant distinction and
warrants a further category for latently typed languages.


As a sidenote: the programmer may also create a tagging system to allow
the types to be tracked.  But this is not the same as saying the
language supports types, it is akin to the writing of OO programs in C
using structs.




More information about the Python-list mailing list