Re: C ++ and --

hammondr@sungod.crd.ge.com (Richard A Hammond)
Fri, 22 Oct 1993 20:51:48 GMT

          From comp.compilers

Related articles
pointer elimination in C miller@crx.ece.cmu.edu (Karen Miller) (1993-10-05)
Re: pointer elimination in C pop@dcs.gla.ac.uk (Robin Popplestone) (1993-10-22)
Re: C ++ and -- hammondr@sungod.crd.ge.com (1993-10-22)
| List of all articles for this month |
Newsgroups: comp.compilers
From: hammondr@sungod.crd.ge.com (Richard A Hammond)
Keywords: C, history, design
Organization: Compilers Central
References: 93-10-032 93-10-096
Date: Fri, 22 Oct 1993 20:51:48 GMT

In an article in comp.compilers Robin Popplestone <pop@dcs.gla.ac.uk> writes:
  ...
>C was, as they would say in Congress, -very unique- in providing pointer
>arithmetic. This simply reflected the fact that good compilers had to be
>shoehorned into a tiny computer, the DEC-11, and there was a simple
>one-to-one mapping between something like *x++ and one machine
>instruction.


Not exactly, to quote from Dennis Ritchie in the 2nd History of Programming
languages Conference, ACM SIGPLAN Notices, Vol 28, No. 3, March 1993, pg 203
    Thompson went a step further by inventing the ++ and -- operators, ...
    People often guess that they were created to use the auto-increment and
    auto-decrement address modes provided by the DEC PDP-11 on which C and Unix
    first became popular. This is historically impossible, since there was no
    PDP-11 when B was developed. ... a stronger motivation for the innovation
    was probably his observation that the translation of ++x was smaller than
    that for x = x + 1.


So it was shoehorning into a small computer, the PDP-7. It wasn't for
PDP-11 instructions.


Rich Hammond
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.