5 ms·
I really love C, although I'm no expert by any means. C++ and Rust (and D) are different kinds of languages, they have many many more features. There isn't an a
by roryrjb 6y ago
I really love C, although I'm no expert by any means. C++ and Rust (and D) are different kinds of languages, they have many many more features. There isn't an adequate replacement yet. Aside from having GC, if anyone mentions Go, yes the syntax is simple but the runtime is a massive magic black box, I don't like magic. The closest things that I can see are Zig or the yet unknown language that Drew Devault is working on[0]. So people know about Zig of course, but the reason I mention about Drew's language that he has hinted at with snippets is that I can see by his posts that he both loves and respects C and he cares about complexity[1], I really really look forward to seeing what he's been up to.
[0]. https://drewdevault.com/2020/04/15/Status-update.html https://drewdevault.com/2020/04/15/Status-update.html
[1]. https://drewdevault.com/2020/01/04/Slow.html https://drewdevault.com/2020/01/04/Slow.html
- CameronNemo 6y agoThe biggest feature of C is its ABI stability guarantees. Swift is one of the few languages that has tried to retain that.
- sigjuice 6y agoHow does C provide ABI stability? If I send someone .o and .a files, I don’t think they can just use them in the general case.
- CameronNemo 6y agoC does not provide ABI stability itself as a language, however the language does make it easier for libraries (including specific implementations of the standard library) to provide ABI stability. Rust does not provide the facilities to write libraries with stable ABIs, and C++ libraries have to be written carefully to achieve ABI stability. More precisely, important C++ and Rust language features (templates and generics, respectively) conflict with the ability of providing ABI stability (at least it was thought so... Swift is novel in how it provides ABI stability guarantees for library writers alongside generics).
- WalterBright 6y ago> There isn't an adequate replacement yet. D as Better C works very well as a replacement. I've converted a lot of code from old C to BetterC and it goes very quickly (once you remove the use of the preprocessor, which can be tricky if you use the preprocessor as a metaprogramming tool). The syntax is nearly identical. https://dlang.org/blog/2017/08/23/d-as-a-better-c/ https://dlang.org/blog/2017/08/23/d-as-a-better-c/ Note that no D runtime library is required. Just the C Standard Library. (Yes, I am in charge of the D Language Foundation. No, I don't receive a nickel from it. I do it because I believe in it.)
- roryrjb 6y agoActually yes I did forget about BetterC and it has been on my radar for a while. I have played with D before and honestly out of all the options in this space I've found it's probably the one I would go for on a project. It seems to strike the best balance between productivity and performance for me, the runtime seems much less magical than Go. I will definitely check out BetterC!