3 ms·
That is a very long article that requires lots of other things to understand. But what I am confident about is that compatibility with everything is... just abo
by eternityforest 5y ago
That is a very long article that requires lots of other things to understand. But what I am confident about is that compatibility with everything is... just about the only good thing about C.
Why mess with it at all? It's portable assembly. Why are we trying to use it as more than that? Even the kernel doesn't need it or only needs tiny bits of it. See Redox OS and all the other similar projects.
Why do we still talk about ABIs? We can statically link a whole binary, and still use far less disk and ram than we do now with containers.
We have high level languages that "link" at the level of names and modules, not bits and bytes.
C works well enough for what it's used for. Rust and the others are up and coming.
Instead of saving C, why not improve Rust and JavaScript and the others?
- gmfawcett 5y ago> Why mess with it at all? It's portable assembly. At your level and mine, it looks like portable assembly. At the level of the OP and the compiler implementations, it is absolutely not. > Instead of saving C, why not improve Rust and JavaScript and the others? "Platform effects" is a pretty complete answer. C isn't going anywhere soon. You and everyone here depends upon a mountain of C code every day.
- eternityforest 5y agoA mountain of old C that's still maintained because it's universal and ubiquitous. There's a few possible transition paths though. Like a backwards compatible strict superset or conversion tool. The sooner other languages mature, the sooner we can stop writing new projects that use large amounts of C.
- pjmlp 5y agoLike UNIX clones....so easier said than done.
- whatshisface 5y agoThe Zig compiler can compile C and seamlessly interoperates with it.
- gmfawcett 5y agoZig is an impressive power-tool. A mighty earth mover! Now, relocate Everest. :)
- eternityforest 5y agoThe trouble with Zig is that it seems to be far too much like C, especially at the moment. Like, look at all the stuff it can't catch, that Rust can. If we incrementally evolve like that, it might take 50 years to get to the kind of environment that Rust seems to be aiming for, where everything is safe and high level abstraction are cheap and available anywhere, and we have official package management.
- mhh__ 5y agoI wish I had your confidence in the world.
- fsckboy 5y agoyou want to be confident about something you're wrong about? that's the worst kind of confident!
- int_19h 5y agoHow are you going to statically link your library written in C into your JavaScript app, exactly? ABI is a necessity for FFI.
- eternityforest 5y agoWith the same antique fossilized ABI everyone's been using this whole time. It's clearly good enough for extremely simple low level stuff. For now, until more and more of those libraries move to some future language.
- int_19h 5y agoThat would be the C ABI, hence why we still talk about it. And new types (like int128_t) keep appearing from time to time, that need to be reflected in that ABI.