What is Expressiveness in a Computer Language
rossberg at ps.uni-sb.de
Tue Jun 20 15:53:29 CEST 2006
Rob Thorpe wrote:
>>>No, that isn't what I said. What I said was:
>>>"A language is latently typed if a value has a property - called it's
>>>type - attached to it, and given it's type it can only represent values
>>>defined by a certain class."
>>"it [= a value] [...] can [...] represent values"?
I just quoted, in condensed form, what you said above: namely, that a
value represents values - which I find a strange and circular definition.
>>A (static) type system assigns types to (all) *expressions*.
> That's right most of the time yes, I probably should have said
> expressions. Though I can think of static typed languages where the
> resulting type of an expression depends on the type of the variable it
> is being assigned to.
Yes, but that's no contradiction. A type system does not necessarily
assign *unique* types to individual expressions (consider overloading,
subtyping, polymorphism, etc).
> Well I haven't programmed in any statically typed language where values
> have types themselves.
They all have - the whole purpose of a type system is to ensure that any
expression of type T always evaluates to a value of type T. So when you
look at type systems formally then you certainly have to assign types to
values, otherwise you couldn't prove any useful property about those
systems (esp. soundness).
More information about the Python-list