2 ms·
Sure, early C compilers would generate inefficient code. So what?
by MaxBarraclough 8y ago
Sure, early C compilers would generate inefficient code. So what?
- pjmlp 8y agoIt contradicts your statement why people were using C in first place. We were using it because we were porting code from and to UNIX systems, nothing else.
- MaxBarraclough 8y agoYou're right I was too dismissive of the non-technical reasons that a language like C can do well: existence of legacy code, and the fact that all serious programmers already know C. At the time though, all compiler-generated code would have been at least as bad, no? With the possible exception of FORTRAN. Performance is relative. Assembly is rarely used today even for high-performance code, as modern optimising compilers are so good. Today, we know it's not impossible for a new language to gain traction, but all new languages that are used in anger are much more high-level than C. With the single exception of the Zig language, no other language emphasises raw performance and low-level access the way C does. Rust isn't too far off I suppose (from what little I know about it). Incidentally, Zig has UB too, but it's designed to be nowhere near as troublesome as it is in C.
- pjmlp 8y agoAssembly was certainly a requirement on 8 and 16 bit micro computers, where high level languages had the role of modern managed languages. Abrash and Norton MS-DOS books expose this reality quite well. On 70's mainframes outside AT&T walls not so much. NEWP uses CPU instrisics. Burroughs architecture doesn't expose Assembly. Xerox PARC moved away from BCPL into Mesa for their Star and Pilot workstations. With the last generation using Mesa/Cedar. Speaking of which, BCPL was originally only meant for bootstrapping CPL, before getting a life of its own.