What is Expressiveness in a Computer Language

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Fri Jun 23 21:29:26 EDT 2006


Anton van Straaten wrote:
> Andreas Rossberg wrote:
>> Rob Warnock wrote:
>>
>>> http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-4.html
>>>     1.1  Semantics
>>>     ...
>>>     Scheme has latent as opposed to manifest types. Types are assoc-
>>>     iated with values (also called objects) rather than with variables.
>>>     (Some authors refer to languages with latent types as weakly typed
>>>     or dynamically typed languages.) Other languages with latent types
>>>     are APL, Snobol, and other dialects of Lisp. Languages with manifest
>>>     types (sometimes referred to as strongly typed or statically typed
>>>     languages) include Algol 60, Pascal, and C.
>>
[...]
> 
> That text goes back at least 20 years, to R3RS in 1986, and possibly
> earlier, so part of what it represents is simply changing use of
> terminology, combined with an attempt to put Scheme in context relative
> to multiple languages and terminology usages.  The fact that we're still
> discussing this now, and haven't settled on terminology acceptable to
> all sides, illustrates the problem.
> 
> The Scheme report doesn't actually say anything about how latent types
> relate to static types, in the way that I've recently characterized the
> relationship here.  However, I thought this was a good place to explain
> how I got to where I am on this subject.
> 
> There's been a lot of work done on soft type inference in Scheme, and
> other kinds of type analysis.  The Scheme report talks about latent
> types as meaning "types are associated with values".  While this might
> cause some teeth-grinding amongst type theorists, it's meaningful enough
> when you look at simple cases: cases where the type of a term is an
> exact match for the type tags of the values that flow through that term.
> 
> When you get to more complex cases, though, most type inferencers for
> Scheme assign traditional static-style types to terms.  If you think
> about this in conjunction with the term "latent types", it's an obvious
> connection to make that what the inferencer is doing is recovering types
> that are latent in the source.

But these types are not part of the Scheme language. If you combine Scheme
with a type inferencer, you get a new language that is not R*RS Scheme,
and *that* language is typed.

Note that different inferencers will give different type assignments.
They may be similar, but they may also be quite dissimilar in some cases.
This casts considerable doubt on the assertion that the inferencer is
"recovering types latent in the source".

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>



More information about the Python-list mailing list