C's syntax

Alex Martelli aleaxit at yahoo.com
Wed Oct 25 09:09:29 EDT 2000


<jurgen.defurne at philips.com> wrote in message
news:mailman.972471621.14727.python-list at python.org...
> Historically, two languages have been defined by people who were probably
> more mathematicians. The first one is COBOL, the second one Pascal.
> Since mathematically '=' means 'is equal to', they found it more
appropriate
> to use '=' for it's real meaning, and create new operators for assignment:

Wirth and Hopper were "probably more mathematicians" than Backus?  This
is news to me.  Anyway, Pascal just took its ':=' from Algol (as did other
languages, such as BCPL; C [its immediate predecessor B, actually] used
'=' for assignment [rather than the ':=' of BCPL, the language it was mostly
following] specifically because of PL/I influence [so says Ritchie in his
paper], and PL/I, in turn, had it from Fortran).

Backus was also on the Algol committee, as well as having invented Fortran
(it was to describe Algol syntax formally that he invented BNF, Backus
Normal
Form -- peculiarly also called 'Backus-Naur Form', when Naur explicitly
disclaimed having had anything to do with its invention).

If I had to give an example of a language invented by a mathematician, it
would be APL.  Kenneth Iverson had a Ph.D. in (applied) mathematics and
was a professor of mathematics for years before he joined IBM Research
and proceeded to invent APL.  He published books on mathematics and was
apparently the inventor of the mathematical terms "ceiling function"
and "floor function".

APL was utterly liberal in its use of rich typography, untrammeled by
the limitations of existing character sets (interestingly, another great
computer scientist with claims to "being a mathematician", Donald Knuth,
has, as the best-known software product he wrote, a typographical
composition system -- TeX; the best-known "language he invented", though,
is a fictitious _assembler_, MIXAL...).  Assignment was denoted by a
left-pointing arrow; = meant 'equality comparison'.  Some later languages
have tried mimicking that with, e.g., <-, but whether this looks like
a left-pointing arrow is highly dependent on the font in use:-).

More recently, some mathematicians who dabble in computers have leaned
towards functional programming (another idea to which Backus gave great
impetus...).  As variables cannot be 're-bound' in a pure FP language,
'assignment' per se doesn't really exist.  Such languages' closest
equivalents are forms such as:
    let x=23 in x+2
or, equivalently:
    x+2 where x=23
where the "binding", denoted by '=', means 'give this name to this
value in this scope' -- equality (of name and value) IS also implied.


Alex






More information about the Python-list mailing list