3 ms·
I hate that way of looking at it because I think it's totally wrong. C (this view is usually presented as only about c) isn't fundamental or bedrock in any way
by rat87 10y ago
I hate that way of looking at it because I think it's totally wrong.
C (this view is usually presented as only about c) isn't fundamental or bedrock in any way. Most of our current stacks just happen to be written in it.
The original Mac OS for instance was written in Pascal and C. The most popular open source compilers are written in c++. Most browsers are written in c++ not in c.
And there's no reason these days you couldn't rewrite llvm (a set of compiler libraries and compilers mostly written in c++, not that rust compiler uses llvm for code generation but the frontend is in rust) in haskell or java or javascript(they'd be slower but they would work). Haskell has useful features for writing compilers and a lot of language analysis libraries already. If you re-wrote in in rust it'd be just as fast.
Hell this guy (https://github.com/jameysharp/corrode https://github.com/jameysharp/corrode) wrote a rust-c source-to-source compiler in literate haskell. Also in a few years servo will be a full browser in rust and Firefox is already adding components written in rust.
Other then os interface & c binary api linking there is nothing special about c or c++.
- collinmanderson 10y ago> Most of our current stacks just happen to be written in it. Sure, there's nothing special about the languages themselves, but _currently_ C and C++ are the foundation for (almost) all other languages. In theory you could rewrite llvm (or use a different complier), but I don't see that happening any time soon. That's why I call it bedrock, because it would be very hard to change. (Though, I do wonder when llvm will stop depending on Python 2 :)