Home About Subscribe Search Member Area

Humanist Discussion Group


< Back to Volume 34

Humanist Archives: May 20, 2020, 8:27 a.m. Humanist 34.37 - punctuation in the assignment statement

                  Humanist Discussion Group, Vol. 34, No. 37.
            Department of Digital Humanities, King's College London
                   Hosted by King's Digital Lab
                       www.dhhumanist.org
                Submit to: humanist@dhhumanist.org


    [1]    From: Dr. Herbert Wender 
           Subject: Re: [Humanist] 34.31: punctuation in the assignment statement (22)

    [2]    From: Tim Smithers 
           Subject: Re: [Humanist] 34.27: punctuation in the assignment statement (228)


--[1]------------------------------------------------------------------------
        Date: 2020-05-19 19:34:37+00:00
        From: Dr. Herbert Wender 
        Subject: Re: [Humanist] 34.31: punctuation in the assignment statement

Robert Delius Royar wrote (Humanist 34.31):

"I believe the simpler interpretation is that the available character set
influenced the choice more than did the designer's sense of the hermeneutic
implicature of the ':'."

Similarly, Henry Schaffner pointed to the restrictions of the ASCII code table,
and surely that is an undeniable precondition for the evolving practice in
programming notations, and in compartion with some kinde of smiley one cam see
in the ":=" a double-lined arrow directed to the left.

Though I would take a look in the history of notations in math and logic. The
colon was introduced by Leibniz as division sign, and lexicographers used the
colon conventionally between definiendum and definiens. In the latter tradition,
it seems to me, can be seen the conventional use of ":=" and "=:" in the domain
of set theory, and the colon marks the side of the definiens. I would suspect
that the answer to Willards question is to be found in this line of tradition.

Regards, Herbert




--[2]------------------------------------------------------------------------
        Date: 2020-05-19 18:37:37+00:00
        From: Tim Smithers 
        Subject: Re: [Humanist] 34.27: punctuation in the assignment statement

Dear Willard,

I don't think the ':' in the Algol value assignment symbol,
':=', has much to do with the the colon as a punctuation mark.

But, my story on this is anecdotal, and thus perhaps mistaken
or mythical.  Others here may be able to clarify this.

In 1975 I spent nine months at a [UK] Ministry of Defense
(MoD) Research Establishment doing a second period of
Industrial Training as part of my (Sandwich) degree in
Aeronautical Engineering, at Kingston Polytechnic (as it then
was).

At this MoD establishment people worked either on solid fuel
rocket motors, or on liquid fuel rocket motors, never both, I
was given to understand.  The solid fuel people used Fortran.
This is where I worked.  The liquid fuel people used Algol,
and analogue computers!  Lunch breaks allowed some
conversations with people in the liquid fuel group.  Otherwise
such fraternisation was frowned upon.  But, curious to know
about "this Algol language" I asked the person who was treated
as the guru on Algol in the liquid fuel group.

What I remember from this is that the assignment symbol in
Algol, the ':=' symbol, was derived from the Backus notation
(after John Backus) used to specify Algol 58.  This soon
became known as the Backus-Naur Form, and often referred to as
BNF [which Peter Naur said stood for Backus-Normal Form, but
Donald Knuth said should stand for Backus-Naur Form].

BNF is a metalanguage John Backus designed to specify new
programming languages in a precise and unambiguous way, and
was used to specify the new Algol language that was then being
developed.  BNF is a notation for Chomsky-type context-free
grammars.  (Backus apparently knew about Chomsky's work on
these.)

The basic idea of BNF is to use it to specify a programming
language as a set of metalinguistic formulae (not equations!),
using the basic form

      ::= __expression_ _

where the '::=' symbol here indicates that the left side must
be replaced by the right side, whenever it occurs.  (Some say
the '::=' means "is defined by," but this is, I think,
misleading, since context free grammars don't define things,
they specify re-write rules, or productions, as they are
sometimes called.)

Now, in Backus' original version of BNF, the '::=' symbols was
composed of ':' followed by a three horizontal line symbol
(which I can't produce here) but which is like the
mathematical symbol used to denote an equivalence
relationship.  This original three line symbol was hard to
produce on typewriters, so it was changed to the easier to
produce form '::=' we are more familiar with today.

What I was told, by my Algol guru, was that this BNF symbol
for the re-write operation was modified to be ':=' to use as
the value assignment symbol in Algol, since assignment is
similar to, but not the same as, re-write.

It's worth pointing out too, I think, that Algol uses the '='
symbol to denote equality (as it should, I would say).  This
is used in the condition part of 'If' constructions, for
example.  So, value assignment could not be the '=' symbol.
(Fortran, if I remember well, uses '==' for this instead.)

I'm not sure this answers much since it begs the question, why
did John Backus use ': and three parallel lines' and then
'::=' to denote re-write?

To see if I could find an answer I went back to my old copy of

   Richard L Wexelblat (Ed), 1981.  History of Programming
   Languages, Academic Press

which is the proceedings of the ACM SIGPLAN History of
Programming Languages (HOPL) conference held in Los Angeles,
California, in June, 1978.

This contains sections on the origins and early development of
Fortran and Algol, but, alas, I didn't find anything that
helps here.

However, diverting the subject some, what I did (re)find was
Grace Murray Hopper's Key Note speech at this conference.
This does not address the Algol value assignment symbol
question, but it is an immensely interesting and informative,
and sometime hilarious, read, for those interested in the
human side of early computer coding and programming language
developments.  I'd forgotten about this, and so am grateful
that your question about ':=' led me to re-discover it.

Best regards,

Tim


PS: My preferred way of doing value assignment in programming
follows the Cobol and Lisp tradition.  I mostly program in
Logo these days, an old AI language mostly known for it's
Turtle Graphics, but which is also a fully blown list
processing language.  In Logo we write

   Make "x 2.71828

for example, or

   Make "x :someOtherVariable

but I'll leave you, and others here, to ponder on what the '"'
and ':' symbols mean.  Like in Lisp, variables in Logo have
property lists and a place to carry a value.




> On 18 May 2020, at 12:26, Humanist  wrote:
>
>                  Humanist Discussion Group, Vol. 34, No. 27.
>            Department of Digital Humanities, King's College London
>                   Hosted by King's Digital Lab
>                       www.dhhumanist.org
>                Submit to: humanist@dhhumanist.org
>
>
>
>
>        Date: 2020-05-18 10:19:33+00:00
>        From: Willard McCarty 
>        Subject: punctuation in the assignment statement
>
> Here follows a rather lengthy prelude to a question in the history and
> psychology of programming. Help, please!
>
> Anyone who has read David Crystal's Making a Point: The Pernickety Story
> of English Punctuation (2015) will know that many have attempted to fix
> the semantics of punctuation in English but none succeeded, though
> Lindley Murray's English Grammar (1795) established a long-lasting
> convention that has survived well beyond the Oxford English Dictionary.
> My specific interest in punctuation is in the colon as it is used in
> programming when combined with the equals-sign. This occurs in what are
> known as assignment statements, e.g. in ALGOL and other languages
> influenced by it, thus:
>
> X := Y + Z
>
> In FORTRAN, as you may know, the equivalent is written (disturbingly to
> some mathematicians) thus:
>
> X = Y + Z
>
> This looks like algebra but isn't truly algebraic because it is an
> imperative statement ('set the value of X equal to the sum of Y and Z')
> rather than a declarative one ('the value of X is equal to the sum of Y
> and Z'), as in algebra. Many have objected for very good reasons, mostly
> on the grounds that students who come to programming with a background
> in maths tend to become confused.
>
> Now for the historical bit. Within the first decade of digital computing
> it became obvious that programmers would fold under the burden of
> writing machine instructions. As Grace Hopper remarked, machines were
> getting faster but programmers weren't. One of the differences in how to
> design a standard high(er)-level programming language that would make
> programming easier and quicker centred on the assignment statement,
> specifically how to write it. Alan Perlis roughly sums up the story:
>
>> …Americans, following the FORTRAN approach, had the variable being
>> assigned to on the left. The Europeans had it on the right. The
>> Americans used an equals sign for the assignment, thus hiding the
>> fact that there is a direction to the assignment; the Europeans used
>> a directed arrow pointing to the right. When ALGOL 58 came out,
>> neither equals nor directed arrow was used, but a colon-equal and it
>> pointed to the left. (Wexelblat, History of Programming Languages, 1981:
>> 142)
>
> Hence X := Y + Z!
>
> My question is this: why the colon? What was this mark of punctuation
> meant to suggest, or better, what would it have suggested and what does
> it continue to suggest? The OED note on the colon as a mark of
> punctuation (rather than as a part of our anatomy) is a succinct
> statement of the conventional sense that would have been nigh universal
> in English usage in the mid 20th Century:
>
>> Its best defined use is to separate clauses which are grammatically
>> independent and discontinuous, but between which there is an
>> apposition or similar relation of sense. Thus it may introduce an
>> antithetic statement, an illustration, extract, etc.
>
> I suppose, then, that in the ALGOL lingo the colon functions as an
> appositional qualifier, a cognitive pause and a warning as to how the
> equals-sign is to be read. (I am getting here into the psychology of
> programming, into how on some level we read and write ALGOL and similar
> languages.) So I translate "X is to be MADE equal to the sum of Y and
> Z". Or, we might say, "Warning: this is NOT an algebraic statement!" Or,
> better, I think: "Here we must stretch our understanding of mathematics
> to include something new."
>
> Is there any supporting historical evidence for my supposition?
>
> Many thanks for any pointers.
>
> Yours,
> WM
> -----
> P.S. Perlis' reference to "the Europeans" should have been more specific
> to give credit to Heinz Rutishauser, who in his foundational paper
> Automatische Rechenplanfertigung bei programmgesteuerten Rechenmaschinen
> (1951, published 1952) introduced what he called the "Ergibtzeichen",
> which looks to me like a right-pointing arrow superimposed on an
> equal-sign. Clarity! If only...
> For the source materials see:
>
>
http://www.softwarepreservation.org/projects/ALGOL/standards/?searchterm=Proceed
> ings%20of
>
>
> --
> Willard McCarty (www.mccarty.org.uk/),
> Professor emeritus, Department of Digital Humanities, King's College
> London; Editor, Interdisciplinary Science Reviews
> (www.tandfonline.com/loi/yisr20) and Humanist (www.dhhumanist.org)



_______________________________________________
Unsubscribe at: http://dhhumanist.org/Restricted
List posts to: humanist@dhhumanist.org
List info and archives at at: http://dhhumanist.org
Listmember interface at: http://dhhumanist.org/Restricted/
Subscribe at: http://dhhumanist.org/membership_form.php


Editor: Willard McCarty (King's College London, U.K.; Western Sydney University, Australia)
Software designer: Malgosia Askanas (Mind-Crafts)

This site is maintained under a service level agreement by King's Digital Lab.