What is Expressiveness in a Computer Language

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Sat Jun 24 18:39:23 EDT 2006


Anton van Straaten wrote:
> David Hopwood wrote:
> 
>> I can accept that dynamic tagging provides some support for latent typing
>> performed "in the programmer's head". But that still does not mean that
>> dynamic tagging is the same thing as latent typing
> 
> No, I'm not saying it is, although I am saying that the former supports
> the latter.

But since the relevant feature that the languages in question possess is
dynamic tagging, it is more precise and accurate to use that term to
describe them.

Also, dynamic tagging is only a minor help in this respect, as evidenced
by the fact that explicit tag tests are quite rarely used by most programs,
if I'm not mistaken. IMHO, the support does not go far enough for it to be
considered a defining characteristic of these languages.

When tag tests are used implicitly by other language features such as
pattern matching and dynamic dispatch, they are used for purposes that are
equally applicable to statically typed and non-(statically-typed) languages.

>> or that languages
>> that use dynamic tagging are "latently typed". This simply is not a
>> property of the language (as you've already conceded).
> 
> Right.  I see at least two issues here: one is that as a matter of
> shorthand, compressing "language which supports latent typing" to
> "latently-typed language" ought to be fine, as long as the term's
> meaning is understood.

If, for the sake of argument, "language which supports latent typing" is
to be compressed to "latently-typed language", then statically typed
languages must be considered also latently typed.

After all, statically typed languages support expression and
verification of the "types in the programmer's head" at least as well
as non-(statically-typed) languages do. In particular, most recent
statically typed OO languages use dynamic tagging and are memory safe.
And they support comments ;-)

This is not, quite obviously, what most people mean when they say
that a particular *language* is "latently typed". They almost always
mean that the language is dynamically tagged, *not* statically typed,
and memory safe. That is how this term is used in R5RS, for example.

> But beyond that, there's an issue here about the definition of "the
> language".  When programming in a latently-typed language, a lot of
> action goes on outside the language - reasoning about static properties
> of programs that are not captured by the semantics of the language.

This is true of programming in any language.

> This means that there's a sense in which the language that the
> programmer programs in is not the same language that has a formal
> semantic definition.  As I mentioned in another post, programmers are
> essentially mentally programming in a richer language - a language which
> has informal (static) types - but the code they write down elides this
> type information, or else puts it in comments.

If you consider stuff that might be in the programmer's head as part
of the program, where do you stop? When I maintain a program written
by someone I've never met, I have no idea what was in that programmer's
head. All I have is comments, which may be (and frequently are,
unfortunately) inaccurate.

(Actually, it's worse than that -- if I come back to a program 5 years
later, I probably have little idea what was in my head at the time I
wrote it.)

> We have to accept, then, that the formal semantic definitions of
> dynamically-checked languages are incomplete in some important ways.
> Referring to those semantic definitions as "the language", as though
> that's all there is to the language in a broader sense, is misleading.

Bah, humbug. The language is just the language.

> In this context, the term "latently-typed language" refers to the
> language that a programmer experiences, not to the subset of that
> language which is all that we're typically able to formally define.

I'm with Marshall -- this is way too mystical for me.

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



More information about the Python-list mailing list