eli5: How is C still the fastest mainstream language?

724 views

I’ve heard that lots of languages come close, but how has a faster language not been created for over 50 years?

Excluding assembly.

In: 2072

19 Answers

Anonymous 0 Comments

C was written in an era of efficiency, where every byte mattered, to be close to the way the machine operates, to use direct memory manipulation (which can be a security issue if not managed, because it doesn’t have lots of tests and checks to make sure you don’t do dumb stuff), and to be merely an interface between people who had been programming in assembly up until then so that they could write in a slightly higher-level language but still retain close-to-metal performance.

It had to run on all kinds of machines, be very efficient, and not “do too much” that the programmer wasn’t aware of.

And you can write an almost-complete C99 compiler in only 76,936 lines of code. That’s tiny.

C is nothing more than a shim of a language sitting on top of assembly, with some useful functions, that’s evolved into a fuller language only relatively recently.

You are viewing 1 out of 19 answers, click here to view all answers.