Orthogonal

Meaning

Adriaan van Wijngaarden championed the notion of orthogonal programming language and applied the notion in all its strength in the design of Algol 68. An orthogonal programming language is one such that it comprises a number of primitive independent concepts which are then applied in an orthogonal way. This makes the language very expressive, reduces the number of arbitrary rules (which the programmer has to remember) and avoids redundancy.

There are many examples of orthogonality in Algol 68. In fact, what is seldom found are arbitrary rules! One nice example is: take the notions of the comma separator , (in the Report that symbol is known as the and also token), collateral clauses, parallel clauses, declarations, multiple sub-scripting, actual argument passing, row display and structure display. These concepts are all independent. Now let’s establish a rule: the comma separator implies collateral elaboration. Then let’s apply this rule “orthogonally” by combining the concepts above.

Starting with the most obvious example, the units in the following collateral clause are elaborated collaterally, no surprise there:

(x * 2, y / 2)

If the following parallel clause there is still collateral elaboration, and it would be expected:

par begin generate data (), consume data () end

But then the indexes in the following multiple subscripting are also elaborated collaterally:

play voice ((monster at[get x (current map), get y (current map)]))

The actual parameters in the following procedure call are elaborated... collaterally!:

encrypt buffer (str, get random (seed))

The following contracted identity declarations are elaborated, surprise surprise, collaterally:

[]real randoms1 = get random (seed), randoms2 = get random (seed)

The field positions in the following structure display are also elaborated collaterally:

maintainer maint = (default name,
                    default url,
                    get last package (packages))

You get the point: there is no Algol 68 code where a comma separator doesn’t imply collateral elaboration. Out of strings, comments and pragmats that’s it. The programmer is only required to remember a number of N+M concepts (like the ones enumerated above) instead of the effect of combining them in N*M different combinations.

Algol 68 is not absolutely orthogonal, it has rules that introduce exceptions. An example is: “sizety modifiers can be applied to int real, complex, bits, bytes modes, but not to structured or rowed modes”.

Usage

See Also