Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbjade.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucbjade!oster From: oster@ucblapis.BERKELEY.EDU (David Phillip Oster) Newsgroups: net.lang Subject: Re: BCPL referenes ? Message-ID: <425@ucbjade.BERKELEY.EDU> Date: Tue, 11-Mar-86 21:43:38 EST Article-I.D.: ucbjade.425 Posted: Tue Mar 11 21:43:38 1986 Date-Received: Fri, 14-Mar-86 03:47:21 EST References: <1341@osu-eddie.UUCP> <254@vu-vlsi.UUCP> Sender: network@ucbjade.BERKELEY.EDU Reply-To: oster@ucblapis.UUCP (David Phillip Oster) Organization: University of California, Berkeley Lines: 29 Keywords: BCPL It is interesting that BCPL is rearing its ugly head again. According to histories of the C language I have seen published in Dr. Dobbs (interviews with the creator) C was invented because, among other reasons, nobody could figure out how to do a decent BCPL compiler for a byte addressable machine. You see: The BCPL model of reality is that the world is a giant array, so an integer is also an address. BCPL assumes that if you increment an integer you get the next slot in the world array, i.e. that your on a machine with word addressing (like a dec-10.) Since an value can be used as either an integer or an address, the best the BCPL compiler on the PDP-11 could do was shift the value one spot left (multiply by two) when it was actually being used as an address, and shift it back again immediately after. The designer of C hated all that shifting and unshifting. In C, you say whether a value is a pointer or an integer, and if a pointer, what it is a pointer to. Incrementing a pointer does NOT necessarily add one to the value, it adds enough to make the pointer point at the next one of whatever thet pointer points at. BCPL on the other hand forces incrementing by one. That was how things stood back when C was invented. Has BCPL changed? Is it still as inappropriate for byte addressable machines (like the Amiga with its 68000)? --- David Phillip Oster ----------------------- ``What do you look like when you aren't visualizing?'' Arpa: oster@lapis.berkeley.edu Uucp: ucbvax!ucblapis!oster