Search code examples
clow-level

Why everything low-level is written in C?


Why everything low-level is written in C?

I mean kernel code, drivers, Run-time libraries, compilers, embedded systems s/w are mainly written in C/C++.

Why not use Fortran, COBOL, Pascal or even Java/C# or some other third-generation programming language that produces machine-independent code but also gives you the freedom to do low-level ,tweaks and optimizations.

My question is why developers and companies ended up using mostly C for these purposes.

Edit: Most of you here talk about performance. So, is the reason that there is no other general-purpose low-level language faster than C?


Solution

  • A few points:

    • Pascal is not low level language but there are kernels and even whole OS written in it.
    • You would not want to have a OS written in Java\C# because it will be darn slow.
    • C is probably not the best language. It has many cavities, and improvements like D or C++ have been tried. The only "problem" is inertia, C is still popular because C is the most widely used programming language (weather you like it or not). There is a plethora of kernels\OS\libraries\books\course with this language. It would take decades to replace it. And it seems that despite its cavities, there is very little will to completely replace it.