←back to thread

218 points signa11 | 2 comments | | HN request time: 0s | source
Show context
pjmlp ◴[] No.43681194[source]
> The reason I believe C is and always will be important is that it stands in a class of its own as a mostly portable assembler language, offering similar levels of freedom.

When your computer is a PDP-11, otherwise it is a high level systems language like any other.

replies(7): >>43682173 #>>43682246 #>>43682554 #>>43682928 #>>43683332 #>>43683914 #>>43701871 #
uecker ◴[] No.43683332[source]
While C was adapted to the PDP-11, this was adding byte-level memory access. Otherwise I do no think there is anything in C specific to the PDP-11, or what would this be?

What makes C low-level is that it can work directly with the representation of objects in memory. This has nothing to do with CPU features, but with direct interoperability with other components of a system. And this is what C can do better than any other language: solve problems by being a part of a more complex system.

replies(1): >>43683386 #
1. WalterBright ◴[] No.43683386[source]
The post-increment and post-decrement operators mapped directly onto PDP-11 CPU addressing modes.

The integral promotion rules come directly from the PDP-11 CPU instruction set.

If I recall correctly so does the float->double promotions.

CPUs started adapting to C semantics around the mid-80's. CPU designers would profile C generated code and change to be able to more efficiently run it.

replies(1): >>43684059 #
2. uecker ◴[] No.43684059[source]
Thanks. I guess the integral promotion is related to byte-addressing. If you have bytes but can not directly do arithmetic on them, promoting them to word size seems natural.