3 ms·
I used C as an example of what happens when you don't change, not what happens when you do. C is used decades later with little change because of momentum and
by kbenson 10y ago
I used C as an example of what happens when you don't change, not what happens when you do. C is used decades later with little change because of momentum and history, not because it's the pinnacle of computer languages.
C is not a good language. It was a good language, but that was a few decades ago. We've progressed past the point where C's shortcomings are excused by there not being alternatives that address those shortcomings while offering comparable features. At this point, we're just finally edging past of the local maxima created by C's exceptional popularity and the knock-on effects of that popularity, such as most operating systems (and all popular open source ones) being written in C.
- flukus 10y agoWhat's replacing C? I can see languages like go/rust/crystal replacing C++ for application development, but what's producing stable binaries that other languages can consume in the same way the do C ones?
- kbenson 10y agoRust can produce C compatible libraries. Go apparently can too. I suspect a little googling would show me that Nim and D can as well. I'm sure there are at least a few more.
- majewsky 10y agoGo can use C libraries, but AFAIK it cannot be compiled into a shared library to be used by a C program. Go needs control of the program flow to orchestrate its runtime (esp. the GC). Nim can definitely produce C-compatible libraries, seeing how it compiles to C itself.
- mixedCase 10y ago>but AFAIK it cannot be compiled into a shared library to be used by a C program. Go 1.5 added support for this.
- flukus 10y agoI didn't know rust could, I just checked it out. I didn't realize rust was that low level.
- petre 10y agoInterfacing D to C and C++ is failry easy as it was built with excellent C/C++ interop in mind. It's also compatible with C ABI and has limited compatibility with C++ ABI.