Heater wrote: ↑Mon Mar 16, 2020 10:25 pm
jahboater wrote: ↑Mon Mar 16, 2020 9:47 pm
timrowledge wrote: ↑Mon Mar 16, 2020 6:46 pm
C is basically a jumped up PDP-8 assembler with delusions of grandeur.
When did you last use C for real projects?
Please take an unbiased look at C18 or C2x.
I really don't like C being described as any kind of assembler either. It's just wrong.
The thing is that there are hundreds of machine architectures, and consequently 100's of assembly languages. Assembly language programs written for one machine architecture will not run on another. There is no portability.
A high level language like C abstracts away all those architectural differences as much as possible and allows code to be easily moved from machine architecture to machine architecture. Portability is a main objective here. Especially in the case of C, it was created to make Unix portable.
That abstraction and portability is a fundamental and very significant language distinction. Ergo, it's just wrong to describe C as an assembler.
Now, one might view C as a very low level language compared to many. Which is true. Even compared to languages that came before it. One might use "assembler" as a derogatory term in that respect. But I feel that is misplaced derision. C is gloriously simple, it has just the features it needed to get the job it was designed for done. It performed it's duty admirably and continues to do so.
I've looked at C18. I was happy to find it is minimally changed from the C we know and love. The big mistake along the way was variable length arrays, a feature now deprecated after they realized their mistake.
It's not clear to me that variable length arrays were a mistake nor that the people guiding the C18 standard are wiser than before, just different. As indicated by complex numbers and variable-length arrays, previous committees included people using C for scientific computing. Removing such things now appears to reflect a dominance by people in industry using C for IoT and device drivers. In my opinion, adding, removing and changing features in a language standard results in no standard at all.
Although C is notable for its use in the original Unix R7 kernel, it was designed as a general programming language by its creators. That is why the Kernighan and Ritchie C compiler had full support for the PDP-11 hardware floating-point unit. That is why Unix user space, including the C compiler itself, was also written in C.
Times have changed. However, in the race to the bottom, it is worth remembering the design goals as stated in the preface of The C Programming Language:
Kernighan and Ritchie wrote:C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.
Perhaps as a result of the mandate to use the right language for the right task often proclaimed from the highest ivory towers, we now enjoy a multitude of domain-specific programming languages. At the same time, I believe there is an ever increasing need for the general-purpose programming language that C was intended to be.