Quote:
Originally Posted by FRC4ME
One question I've always had is this: why does this argument end at C? Isn't the entire concept of a kernel a layer of abstraction in itself? Wouldn't it technically be faster to write the machine code directly rather than call POSIX API functions?
Everyone talks about C like it is the end-all-be-all of speed and efficiency, which confuses me because C is not the lowest level and seems like a rather arbitrary choice. Forgive me if I'm totally wrong; I'm no expert at the low-level stuff.
|
You're right, C is a (mostly) arbitrary choice, but its also a language that is available on almost any reasonably popular platform. So, for some definition of 'portable', C is generally the lowest level you will get to on a computer where you're not writing entirely machine-dependent code (with some caveats, of course).
If done correctly, the general stuff you write for one platform in C will work with little to no modification on some completely different platform. With machine code, you can't do that. The other thing is that C was designed to write things that used to be written in assembly language, so to some degree that influences its design and usage.