3 ms·
> C was once supposed to be a simple language closer to a portable macro assembler than a high-level language, and one for which writing a compiler is relativel
by Quekid5 6y ago
> C was once supposed to be a simple language closer to a portable macro assembler than a high-level language, and one for which writing a compiler is relatively straightforward and takes no longer than a year.
Do you have a source for this claim? AFAIU the history of C, it was invented for entirely pragmatic reasons.
> This went out of the window with clang, and with gcc (and glibc!) being based on C++.
This is nonsensical, whichever way one interprets "being based on C++". The GCC and Clang compilers conform to the standard whichever version of C or C++ you ask them compile. (Anything else is a bug and should be reported. They may accept a few non-conforming programs, but that's allowable under either implementation-defined behavior or undefined behavior. Remember that UB can include 'doing what the programmer expects'.)
- GoblinSlayer 6y agoThat entirely pragmatic reason was to be assembler with curly braces. See memory capacity of PDP-7 and think what you can reasonably compile with those resources. Fun fact: if you don't specify variable's type, modern C compiler assumes int, this is how the first C compiler worked, you don't need types in assembler, the register type (machine word) is almost the only type you deal with. Implicit function declaration is an assembler feature too.
- tannhaeuser 6y agoThat's also how tcc (simplistic and functional modern one-pass C compiler) works I guess.
- nineteen999 6y agoFirst C compiler ran on the PDP-11, rather than the PDP-7 didn't it? Not that it makes a huge different to your point.