3 ms·
The "killer feature" of C is the simple semantics of the language (despite all the dark undefined corners), which can be implemented relatively straightforward
by bluetomcat 8y ago
The "killer feature" of C is the simple semantics of the language (despite all the dark undefined corners), which can be implemented relatively straightforward on a variety of ISAs. There isn't any need for runtime support because of the lack of fancy language features.
That makes it the most natural way to call into the operating system, without any concerns that the chunk of memory returned by mmap has to be somehow managed by the language runtime.
- ido 8y agoI wonder how bi-directional this has been since the rise of c? i.e. CPU manufacturers defining ISAs that are well suited for usage with c.
- saagarjha 8y agoI think that the fact that we essentially have instructions on most architectures well suited for the implementation of certain operations common in C answers this pretty well.
- pjc50 8y agoThe trouble is you can step from simple semantics to dark corners through such simple things as "adding two numbers together" and "accepting user input". I do agree that the lack of need for a managed runtime is a huge advantage on embedded or small systems.
- bluetomcat 8y ago> I do agree that the lack of need for a managed runtime is a huge advantage on embedded or small systems. Not only in embedded systems. It is a huge advantage when interfacing with the operating system from within a userland process. Lack of a runtime means that a call to a kernel function like, say, `sched_setscheduler(2)` would not interfere with any such thread scheduling policies of the host runtime. Or that the runtime is grabbing file descriptors out of your control, making it hard to reason about resource usage.