typestar

Languages

C

Fifty years old, still the layer everything else is standing on.

First released
1972
Created by
Dennis Ritchie, at Bell Labs
Typing
Static and weak, with free conversion through pointers
File extensions
.c, .h

What it is for

C lives at the bottom of the stack. Operating system kernels, device drivers, embedded firmware, language runtimes, and the standard libraries of nearly every other language. When a language advertises that it can call into native code, the interface it means is C's.

It survives because it is small and because it maps onto hardware with almost nothing in the way. No runtime, no garbage collector, few abstractions that cost anything you did not ask for. That is exactly what you want on a microcontroller with kilobytes of RAM. It is also exactly what makes it dangerous everywhere else: manual memory and unchecked buffers have supplied a remarkable share of the last three decades of security vulnerabilities.

So the newer systems languages are all defined partly in opposition to it, and serious effort now goes into replacing it where security matters. None of that dents the installed base. There is more C running today than ever, and it will outlive everyone reading this.

Where it came from

Dennis Ritchie built C at Bell Labs between 1969 and 1973, out of Ken Thompson's B, so that Unix could be rewritten in something other than assembly. That made Unix portable, and that one decision spread both the operating system and the language further than any amount of advocacy could have.

Kernighan and Ritchie's The C Programming Language, in 1978, defined the language for a decade and became one of the most influential programming books ever written. Formal standardization came later: ANSI C in 1989, ISO in 1990, then C99, C11, C17 and C23, each adding carefully and breaking almost nothing.

The committee's conservatism is the whole point. Code written in 1990 still compiles, and a C ABI is the common tongue every language can speak. C has changed less in fifty years than most languages manage in five.

What it is like to type

C is braces, semicolons and stars. Every statement ends in a semicolon, every block is a brace pair, and pointer work drops * and & into the middle of declarations and expressions where your fingers do not expect them. Header guards and #include lines make the hash key ordinary rather than exotic.

Practice C

165 steps across 10 tours, from the basics to complete programs.

The tours

Official documentation

Other languages