machines with oddball char * formats
Griff Smith
ggs at ulysses.UUCP
Tue Nov 18 23:42:31 AEST 1986
> Although I don't know the details, from what I have heard the DEC-20 suffers
> from a similar problem.
Suffers is a strong word, and it wasn't a problem. Remember, the machine
was around years before C was invented. I think you are saying that any
machine that punishes violation of strict pointer typing is broken.
> Wordsize is 36 bits, I think all pointers are 18-bits
> and chars can not be packed to have a pointer to them.
If this is true, you are talking about a brain-damaged C compiler. A
pointer can be 18 bits, but REAL pointers are 36 bits and they can
point to any arbitrary byte in a word.
Probably the most unfortunate feature of the pointer structure is that
it doesn't happen to fit accepted C coding idioms. The hardware works
best if a byte copy loop is written as
while (*++op = +++ip);
when we all know that the "correct" (i.e. VAX order) way to do it is
while (*op++ = +ip++);
What does all this prove about the "goodness" or "badness" of the
machine? Nothing! It was a clean, RISK-like architecture that was a
joy to program. But people don't program in assembly much any more and
the idioms for the machine don't happen to map into ones that are
favored in current high-level languages. The machine was a victim
of culture drift.
Perhaps we should be taking courses in the history of design, with proper
attention given to the cultural forces that lead to design decisions.
--
Griff Smith AT&T (Bell Laboratories), Murray Hill
Phone: (201) 582-7736
UUCP: {allegra|ihnp4}!ulysses!ggs
Internet: ggs at ulysses.uucp
More information about the Comp.lang.c
mailing list