Hacker News new | ask | show | jobs
by titzer 1893 days ago
No one can seriously argue that C's language design was inherently advantageous over, say, Pascal. If Lisp, ML, Simula, Algol, or Ada received the amount of optimization and porting investment that C did, history would be very different.

C succeeded because a.) Unix, and b.) there were a zillion platforms with a zillion different compilers that could process something like C. They all did weird things and you couldn't actually write portable code for decades, but you could kind of fake it.

1 comments

That portability to a zillion platforms was part of the language design, though. 'Portable assembler' and all that.
All high level languages are portable, and many already were before C came to be.

Just marketing speak.

Sure, with more or less effort. C's semantics seem very easy to port, with very little abstraction over the commonalities that all (most?) assemblies share: computer as a giant array with a CPU and registers.

There's a gaping hole in the abstraction when it comes to word size, but that's about it, and it's obvious to diagnose at least.

Compared to the list of languages above with their more advanced features, it's super easy to port a C compiler and start compiling code. Worse is better.

So easy that to actually make C portable, UNIX had to be made into a C standard library via POSIX, otherwise portable C code is basically just logic and data structures.
Sure, but the flipside of that is that UNIX itself is fairly easy to port to a new CPU, due to being mostly written in C.

So port your compiler, figure out a syscall interface on your CPU, patch it into unix/libc and compile them, and.. it's not like that's a small amount of work but it's way easier than bootstrapping any other environment from scratch on a new architecture.

There's surely some amount of historical accident here as well, but no other language/OS combo ran on like 12 different architectures in the 80s.

Because no other timesharing OS was available in free beer source code for others to port it, it had nothing to do with C.