Skip to content

Hidden Meaning inside APL

Vector 19:4, page 11

language design

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 11

An application programmer usually bears in mind the meaning of the data inserted in the APL structures he is using: a vector of prices, a table of names and surnames, the nested array representing the tree of summarisation groups, and so on.

But the structures also have an inner meaning of their own.

Let us consider for example a vector of numbers. It is not just a simple collection of numbers. It has an implicit order.

Between the original meaning attributed to a vector and the vector itself there is another "semantic" layer, which is directly provided by the language.

This appears to be the case whenever a natural or formal language is used.

The use of a language to represent something meaningful "pollutes" the original meaning by adding some further meaning to it or even introducing a bias into it.

What happens is that, not only the exchange of information through a language (natural or formal) produces a kind of entropy, but also that the use of a language modifies the signification. The structure of the language is never neutral and the use of a particular language originates different views regarding the intrinsic meaning of what we (or a formal language) are talking about.

For example: the diversity of the Greek and Latin languages gave rise to different theological interpretations in the eastern and western churches of Christianity in the first millennium of our era and similarly the use of national languages by the countries ruled by the Roman law contributed to the diversification of national legislations.

The data structures of APL (and other parallel languages) sometimes engender the attribution of further strong meaning to the information lodged by the application programmer inside the data.

When a programmer defines a vector like:

girls ← 'Mary' 'Lucy' 'Anne' 'Rose'

perhaps one just wants to use a tool for pointing – by means of a single noun – at those four girls.

When one defines a vector of survivorship group like:

L ← 99890 99835 99802 ....

one wants to tell APL that – from an initial number of 100,000 – at age 1 the number of survivors is 99890, at age 2 is 99835 .. and so on.

In both cases APL adds automatically another meaning to those vectors: Mary is the first, Lucy the second …99890 is the first, 99835 the second …

but the meaning added by APL to girls is arbitrary: Mary is the eldest or the shortest or the cutest?

On the contrary 99890 is the actual number of survivors at the first anniversary, 99835 at second anniversary, and so on.

The vectors of APL implicitly contain an idea of ordering, which may or may not correspond to the programmer’s will.

Another clear instance in which the designers of APL implicitly thought that a vector has a more complex native structure is to be found in the behaviour of the primitive function "index of" (dyadic iota).

Let us consider:

girls ⍳ ⊂'Emma' ←→ ⎕IO + ⍴girls

The result should be DOMAIN error, because Emma is not in our set called "girls".

Why is Emma the fifth? My answer is: because the vector "girls" looks like having an extra element at its right end. This extra element is not defined elsewhere in APL and I would call it:

"something matching everything".

Only this extra semantic meaning can explain the result that Emma is the fifth girl of the group.

Some say that, when the right argument is out of domain, the result of the primitive function "index of" is the best possible result because it is the most useful for practical programming activities.

May be it is so, but we should be aware that coherence is not to be found everywhere in APL and that sometimes it would be better to work around APL’s constraints.

I have given a few examples about vectors; in a similar manner we can also expect the other data structures (arrays or nested arrays) to engender some implicit relationships inside the data.

In general we can pose these questions:

Is the programmer using a language (whatever it is) really able to attribute an unambiguous meaning to the data inserted in the structures he has created?

Should the best language have the fewest hidden meanings?

But the most important question for APL is the following:

Do parallel languages have a heavier hidden semantic overload ?

I do not know the answer. Can anybody help?