What is Expressiveness in a Computer Language
Anton van Straaten
anton at appsolutions.com
Sat Jun 24 21:25:11 CEST 2006
> Anton van Straaten wrote:
>>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 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.
>>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.
>>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.
> That is starting to get a bit too mystical for my tastes.
It's informal, but hardly mystical. The formal semantic definitions of
dynamically-checked languages I'm referring to are the typical "untyped"
definitions, in which the language has a single static type.
This means that when you as a programmer see a function that you "know"
e.g. takes a number and returns a number, that knowledge is not
something that's captured by the language's formal semantics or static
type system. All that can be expressed in the language's static type
system is that the function takes a value and returns a value.
When you're programming in your favorite dynamically-typed language,
I'll bet that you're not thinking of functions, or other expressions, in
such a restricted way. Your experience of programming in the language
thus relies heavily on features that are not a "property of the
language", if "the language" is taken to mean its formal semantic
So in referring to a language as latently-typed, the word "language" can
be taken to mean what a programmer thinks of as the language, rather
than a formal definition that only captures a subset of what the
programmer routinely deals with.
If we don't acknowledge this distinction between the part of the
language that we can capture formally and the part that we haven't
(yet), then we'll be forever stuck without accepted terminology for the
informal bits, because such terminology can always be objected to on the
grounds that it isn't supported by formal semantics.
More information about the Python-list