kc5tja wrote:
This post is loaded with so many factual errors about C that I feel compelled to respond.
...
C, in and of itself, was originally written as a high-level PDP assembler (C's post- and pre-increment operators, for example, come directly from the PDP's equivalent addressing modes
...
...
C, in and of itself, was originally written as a high-level PDP assembler (C's post- and pre-increment operators, for example, come directly from the PDP's equivalent addressing modes
...
http://cm.bell-labs.com/cm/cs/who/dmr/chist.html
"Thompson went a step further by inventing the ++ and -- operators, which increment or decrement; their prefix or postfix position determines whether the alteration occurs before or after noting the value of the operand. They were not in the earliest versions of B, but appeared along the way. 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."
kc5tja wrote:
...
Not even close. K&R designed C explicitly because Pascal suffered so badly from its inability to touch hardware (and it still suffers today; if you want to do systems programming with a Wirth language, use Modula-2 or Oberon instead).
Not even close. K&R designed C explicitly because Pascal suffered so badly from its inability to touch hardware (and it still suffers today; if you want to do systems programming with a Wirth language, use Modula-2 or Oberon instead).
"Finally, the B and BCPL model implied overhead in dealing with pointers: the language rules, by defining a pointer as an index in an array of words, forced pointers to be represented as word indices. Each pointer reference generated a run-time scale conversion from the pointer to the byte address expected by the hardware.
For all these reasons, it seemed that a typing scheme was necessary to cope with characters and byte addressing, and to prepare for the coming floating-point hardware. Other issues, particularly type safety and interface checking, did not seem as important then as they became later.
Aside from the problems with the language itself, the B compiler's threaded-code technique yielded programs so much slower than their assembly-language counterparts that we discounted the possibility of recoding the operating system or its central utilities in B.
In 1971 I began to extend the B language by adding a character type and also rewrote its compiler to generate PDP-11 machine instructions instead of threaded code. Thus the transition from B to C was contemporaneous with the creation of a compiler capable of producing programs fast and small enough to compete with assembly language. I called the slightly-extended language NB, for `new B.' "
It doesn't sound like C was designed because of deficiencies with Pascal - it seems like it was designed as an extension to the B language to address deficiencies with it.
Toshi