4 ms·
A trivial example: C uses strings that are zero terminated, but which we do not know the length, so it is necessary to count the string length when we need it.
by tomjen3 5y ago
A trivial example: C uses strings that are zero terminated, but which we do not know the length, so it is necessary to count the string length when we need it.
If you implement, say, a Pascal compiler in C, it can be faster than C because Pascal keeps the length of the string with the string.
A language that does not permit pointer arithmetic can optimize the memory layout on the fly, based on real world program performance and that may be faster than a language it is written in.