Related articles |
---|
pointer elimination in C miller@crx.ece.cmu.edu (Karen Miller) (1993-10-05) |
Re:pointer elimination in C ghiya@flo.cs.mcgill.ca (1993-10-06) |
Re: pointer elimination in C donawa@bluebeard.cs.mcgill.ca (Chris DONAWA) (1993-10-10) |
Re: pointer elimination in C doug@netcom.com (1993-10-19) |
Re: pointer elimination in C pop@dcs.gla.ac.uk (Robin Popplestone) (1993-10-22) |
Re: pointer elimination in C macrakis@osf.org (1993-10-22) |
Re: pointer elimination in C henry@zoo.toronto.edu (1993-10-22) |
Re: pointer elimination in C mcdonald@kestrel.edu (1993-10-28) |
Re: pointer elimination in C ted@crl.nmsu.edu (1993-10-29) |
Re: pointer elimination in C rbe@yrloc.ipsa.reuter.COM (1993-11-01) |
Re: pointer elimination in C mcdonald@kestrel.edu (1993-11-03) |
Re: pointer elimination in C macrakis@osf.org (1993-11-03) |
Newsgroups: | comp.compilers |
From: | macrakis@osf.org (Stavros Macrakis) |
Keywords: | C, Lisp |
Organization: | OSF Research Institute |
References: | 93-10-032 93-10-096 |
Date: | Fri, 22 Oct 1993 20:52:16 GMT |
Robin Popplestone <pop@dcs.gla.ac.uk> writes:
...LISP for example, provides almost nothing but pointers...
It depends what you call a "pointer". The original K&R C notion of
pointer essentially an address, with the operations of dereference and
arithmetic. ANSI C has a somewhat more abstract notion, where pointer
arithmetic is only defined within an "object". Other languages have a
more strongly typed notion, and studiously avoid the word "pointer", e.g.
Algol 68 "references" and Ada "access types".
In the Lisp case, you don't really see pointers at all, since you can't
dereference them or do any sort of pointer arithmetic. Pure S-expressions
(no destructive operators) need not even be implemented using pointers.
And there have been implementations of Lisp where many "pointers" were not
pointers at all (cdr codes, etc.) -- although they had to be convertible
to pointers if a destructive operation was applied later.
typically only short integers and possibly short floats will not be
pointers.
But all this is an implementation question, anyway. Some old Lisps did
NOT have non-pointer numbers at all.
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,
It's not so much good compilers that had to be implemented on the PDP-11,
but rather that simple compilers had to be able to generate good code.
(There was even a paper from the C group at one point arguing that
optimization was a bad thing, and that writing at a low level forced you
to be efficient.)
and there was a simple one-to-one mapping between something like
*x++ and one machine instruction.
I believe that even the first C compiler expanded this expression
before code generation. Anyway, the PDP-11 did NOT have address modes
for *++x and *x--.
-s
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.