8 ms·
When C was conceived, CPU architectures and platforms were more varied than what we see today. In order to remain portable and yet performant, some details were
by larschdk 2y ago
When C was conceived, CPU architectures and platforms were more varied than what we see today. In order to remain portable and yet performant, some details were left as either implementation defined, or completely undefined (i.e. the responsibility of the programmer). Seems archaic today, but it was necessary when C compilers had to be two-pass and run in mere kilobytes of RAM. Even warnings for risky and undefined behavior is a relatively modern concept (last 10-20 years) compared to the age of C.
- actionfromafar 2y agoWhen C was conceived, it was made for a specific DEC CPU, for making an operating system. The idea of a C standard was in the future. If you wanted to know what (for instance) memcpy actually did, you looked at the source code, or even more likely, the assembler or machine code output. That was "the standard".
- anticensor 2y agoNo, K&R's book was the standard.
- actionfromafar 2y agoFirst came the language, then a few years later they described it in a book.
- da_chicken 2y agoI think it's reasonable to assume that GP clearly meant the C standard being conceived, as, obviously, K&R's C implementation of the language was ad hoc rather than exhibiting any prescribed specification.
- scoutt 2y ago> Seems archaic today ... run in mere kilobytes of RAM There is an entire industry that does pretty much that... today. They might run in flash instead of RAM, but still, a few kilobytes. Probably there are more embedded devices out there than PCs. PIC, AVR, MSP, ARM, custom archs. There might be one of those right now under your hand, in that thing you use to move the cursor.
- krisoft 2y ago> There is an entire industry that does pretty much that... today. Which industry runs C compilers on embeded devices? Because that is what the part you elipsised out was talking about.
- scoutt 2y agoOh... yes. You are right. My bad.
- sitzkrieg 2y agomany do tho. i have targetted c89 and maybe c99 on several embedded devices
- 0xffff2 2y agoBut you're running the compiler on the device rather than cross-compile?
- vlovich123 2y agoThey cross compile. No one is compiling code on these machines.
- Narishma 2y agoI doubt you're running C compilers on those devices.