Sujet : Re: technology discussion → does the world need a "new" C ?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 06. Jul 2024, 03:29:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6aa76$3l5bc$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 06.07.2024 03:38, Lawrence D'Oliveiro wrote:
On Fri, 5 Jul 2024 14:31:44 +0100, bart wrote:
C also is the only language that is supposed to work on any kind of
processor ...
Where did you get that idea from?
I mean, compiler construction differentiates between various stages,
and the code generation part can be defined for any processor. Why
should any language exclude processors because of a language type?
The reasons why compilers were restricted or targeted to specific
computers were quite mundane; e.g. because it were the available
machines at the company or institute, or because they were funded by
system manufacturers, and other practical, commercial, or political
reasons.
But there's another important spin; using "C" as a universal sort
of assembler. So that nowadays you don't need to generate machine
code any more but can create "C" code instead, using an additional
compile step to get machine code.
I don’t think there is anything innate in the design of C to ensure that.
It was simply its popularity that meant it was usually the first language
implemented on a new processor.
For example, C assumes byte addressability. So that causes awkwardness on
architectures like the PDP-10, for example. It just so happened such
architectures became extinct at about the time the rise of 8-bit
microprocessors (and their more advanced successors) made byte-
addressability essentially universal.
I'm not sure I correctly understand you here.
"Byte addressability" is a bit vague a term given that there was no
clear definition of a "byte". (That's a reason why they introduced
the term "octet" later.)
And the "C" data types on a, say, Honeywell 6000 was based on 9 bit
entities (char: 9 bit, int: 36 bit, etc.). Okay, that is a legacy
topic. (You can read about that even in the K&R "C" book.)
Janis