4 ms·
What does C have to do with Unix? You can write a Unix-like OS in Rust and a Non-Unix like OS in C (or C++[1], like Windows). It happens to be a trope that C w
by greenhouse_gas 9y ago
What does C have to do with Unix? You can write a Unix-like OS in Rust and a Non-Unix like OS in C (or C++[1], like Windows).
It happens to be a trope that C would have died if not for Unix[2], but to the best of my memory of reading programming books of the eighties, C's un-safety was a _feature_, not a bug (I remember Java books were _so_ apologetic that Java didn't have points arithmetic).
In the days before optimizing compilers and slow computers, the ability to write unsafely manipulate arrays was actually useful when one needed speed (and if one wanted to be a "real hacker", one needed to optimize every byte and instruction.) Now it's true that not every program needed that speed, and quite a few would be willing to trade speed for safety, but no "self respecting real programmer" would allow himself to write in _anything_ that wouldn't let him be that "uber-hacker" (sounds familiar? I guess Resume oriented programming is an old problem).
[1]. Before I get the pedants that C++ isn't C, I'd like to remind them that the Windows NT codebase started in the late eighties and early nineties, when C++ _was_ almost like C with classes.
[2]. In reality, quite a few languages took off which were not the same language as their OS (for example, Java, Python, C#). If anything, I'd say it's more important that the compiler vendor be the same company as the OS vendor (see Borland's history), but even that seems like a more modern problem (again, see Borland's history)
- pjmlp 9y agoUsing C++ with Turbo Vision, OWL, VCL, MFC was hardly C with Classes. I never did manually resource management with them. RAII was already a thing in MS-DOS. Java and C# were pushed by OS vendors.