What is Expressiveness in a Computer Language

Joachim Durchholz jo at durchholz.org
Sun Jun 25 08:59:33 EDT 2006


Marshall schrieb:
> It seems we have languages:
> with or without static analysis
> with or without runtime type information (RTTI or "tags")
> with or without (runtime) safety
> with or without explicit type annotations
> with or without type inference
> 
> Wow. And I don't think that's a complete list, either.
> 
> I would be happy to abandon "strong/weak" as terminology
> because I can't pin those terms down. (It's not clear what
> they would add anyway.)

Indeed.

>> Programmers infer and reason about these latent types while they're
>> writing or reading programs.  Latent types become manifest when a
>> programmer reasons about them, or documents them e.g. in comments.
> 
> Uh, oh, a new term, "manifest." Should I worry about that?

I think that was OED usage of the term.

> Well, darn. It strikes me that that's just a decision the language
> designers
> made, *not* to record complete RTTI. (Is it going to be claimed that
> there is an *advantage* to having only incomplete RTTI? It is a
> serious question.)

In most cases, it's probably "we don't have to invent or look up 
efficient algorithms that we can't think of right now".
One could consider this a sorry excuse or a wise decision to stick with 
available resources, both views have their merits IMHO ;-)

>> But "function" is not a useful type.  Why not?  Because if all you know
>> is that timestwo is a function, then you have no idea what an expression
>> like "timestwo(foo)" means.  You couldn't write working programs, or
>> read them, if all you knew about functions was that they were functions.
>>   As a type, "function" is incomplete.
> 
> Yes, function is a parameterized type, and they've left out the
> parameter values.

Well, in JavaScript, the explicit type system as laid down in the 
run-time type information is unparameterized.
You can criticize this as unsound, or inadequate, or whatever you wish, 
and I'd like agree with that ;-), but the type of timestwo is indeed 
just "function".

*Your mental model* is far more detailed, of course.

> Question: if a language *does* record complete RTTI, and the
> languages does *not* have subtyping, could we then say that
> the runtime type information *is* the same as the static type?

Only if the two actually use the same type system.

In practice, I'd say that this is what most designers intend but what 
implementors may not have gotten right ;-p

Regards,
Jo



More information about the Python-list mailing list