4 ms·
Because C is a very low level language, it imposes very little architectural decisions on higher levels that could cause impedance mismatches. For example, you
by the_why_of_y 11y ago
Because C is a very low level language, it imposes very little architectural decisions on higher levels that could cause impedance mismatches.
For example, you wouldn't want to implement a garbage collector in a garbage collected language; C won't get in your way.
This is also why there are loads of C libraries out there: they can be used with bindings from essentially any other language, which is generally not true for libraries implemented in non-C languages (in particular, C++).
- boomlinde 11y ago> Because C is a very low level language, it imposes very little architectural decisions on higher levels that could cause impedance mismatches. Remember that it also enforces the idea of types, scopes, blocks, functions, the heap and the data stack quite strictly. It might be a very low level language compared to something like Java, but in terms of being unassuming of architectural intent, I can't say that I agree that it is even in the same ballpark as any of the assembly languages I've used.
- the_why_of_y 11y agoIndeed it enforces some function calling convention, which may be an issue if you want to compile a high level language via C, particularly since C does not guarantee tail call optimization. Also there's no fast way to check arithmetic overflow from portable C, which limits bignum performance. Due to these limitations better portable assembly languages like C-- have been designed; these days LLVM bitcode is an option as well (which is not actually portable IIRC...).