3 ms·
If my target is some weird 56-bit thing, I'm still likely to be able to get a C compiler. It probably won't be a fully-standard C, because it probably won't su
by AnimalMuppet 6y ago
If my target is some weird 56-bit thing, I'm still likely to be able to get a C compiler. It probably won't be a fully-standard C, because it probably won't support int64 types, and maybe not even int8. But that's all right, because in that situation, I probably don't want an int64. I want whatever natural word-size I get with int. The not-quite-standard-ness of the implementation doesn't make it not useful.
And, it may be all I can get. I probably can't get a Pascal for that situation. I am somewhat unlikely to be able to get a Rust or an Ada. But I can probably get a C.
Especially in embedded systems, you can quite often get a C on the quirky chips, but you can't get anything else.
And no, all those machines are not "roughly a VAX of the same generation".
Now, that may not be quite the same as your claim, because I'm not going to take my embedded application from an 8085 and drop it unchanged onto my 56-bit oddball. (On the other hand, my 8085 code probably isn't using int64 anyway.)
In fact, embedded applications are more non-portable than that, because they always depend on the hardware context, not just on the compiler. Still, you can grab significant functionality from a different machine, modify it sensibly for the new environment, and use it.
- chaganated 6y agoThose are all good pragmatic reasons to use C. Doesn't make C any less of a mistake. A slightly higher semantic level would have spared us so many headaches. To make the choices C made, after LISP, Algol, APL, Pascal... was a very costly punt.
- AnimalMuppet 6y agoAgain, I'm mostly coming from embedded systems. I can guarantee you that at least LISP and APL would be totally unsuitable there. They are very much not the languages to model on. Pascal was usable in embedded systems. It was used, even. But compared to C, it was like picking your nose with boxing gloves on. No, in my world at least, you don't want a "slightly higher semantic level". C got it far closer to right than any of the others, even Pascal.
- chaganated 6y agoDid I say embedded LISP or APL? No, I didn't. I did suggest that C could have learned a thing or two from them. A higher semantic level does not imply reduced performance. In many cases, a richer language can give the compiler more opportunities to optimize. Walter Bright's D is a good example of a slightly-higher semantic level that still generates speedy binaries. And a slow Pascal of yesteryear doesn't exactly put the nail in the coffin. C has also had its share of lame compilers.
- AnimalMuppet 6y agoIt's not because Pascal was slow that I said it was lousy. It's because it was clumsy to use.