Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!rutgers!bellcore!faline!thumper!ulysses!andante!alice!dmr From: dmr@alice.UUCP Newsgroups: comp.misc Subject: Re: Basics of Program Design Message-ID: <8072@alice.UUCP> Date: 28 Jul 88 04:53:50 GMT Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 29 I suppose I should save this article, since the subject seems to come up every year. C was developed on the PDP-11; most of it aside from the type structure and associated syntax came from B, which was developed on the PDP-7. B already had the ++ and -- operators (and the associated idioms like *p++). The first B compiler produced interpreted (threaded) code. Doubtless the invention of ++ and -- (due to Thompson) was suggested by the auto-increment cells of the PDP-7, or perhaps the one such cell on the PDP-8, or perhaps some of the more recondite indirection modes on the GE 635/645, or the count-increment-refill mechanism of the Stretch. In any event, neither B nor the first C compiler generated -7 or -11 instructions that used autoincrement. C was less influenced by the PDP-11 than most people think. Certainly the addition of types was motivated by the desire to take advantage of byte addressing and the (future) existence of floating point (indeed, C compiled 11/45 floating point instructions before the delivery of any 11/45s; it was an annoyance when DEC changed its mind about what opcodes to use.) Discounting general things like that, the only strong PDP-11isms I can think of in C are the signed characters and about 50% of the justification for the widening rules for floats. (The other 50% is simplification of the language rules and libraries). Dennis Ritchie research!dmr dmr@research.att.com