11 ms·
What are current possible C++ replacements? Rust, as mentioned; it was created as a direct replacement to use at Mozilla, among other things. Zig, which is si
by nine_k 5y ago
What are current possible C++ replacements?
Rust, as mentioned; it was created as a direct replacement to use at Mozilla, among other things.
Zig, which is significantly simpler than C++; good but I'm not sure if it has comparable expressive power (maybe it does, IDK).
D, which is around for some time, but hasn't made inroads comparable to Rust.
Ada, which is around for even longer, and has enough mindshare in certain industries, but sadly not enough generally.
GC-based languages, from Go to Haskell, apparently can't be considered true replacements, even though they are fine for large areas previously dominated by C++.
- girvo 5y agoNim, if ARC/ORC reference counting is acceptable (which considering I'm using it in embedded firmware right now, it honestly should be, but I can understand why for certain cases it can't be). But it has the same small user-base/lack of inroads as some of the others on your list
- DeathArrow 5y agoNim does not require you to use reference counting. You can use garbage collection, do manual memory management or not manage memory at all. I like this flexibility and you can chose the strategy that better fits your needs.
- girvo 5y agoOh for sure. Though manual memory management does mean giving up a _lot_ of the standard library, and ARC is a brilliant in between. Though you're 100% correct, its flexibility is what makes it so great in my experience. Honestly one of the nicest things about it for the embedded work I'm doing is knowing that just about everything I'm writing is boringly stack allocated (minus seqs, strings, etc), exactly like we would've done in C ourselves anyway. But when we need to reach for dynamic memory, then ARC has been brilliant. And having RAII-like destructors I've written around C peripheral libraries has been really nice for reducing errors and making it quick to develop in.
- Atalocke 5y agoHare ;)
- littlestymaar 5y agoD: has been here for a while but never caught up, don't even looks “new” enough. Nim: quite old also, but gained a bit of momentum in recent years and even reached version 1.0 in 2019, after 11 years of development. Doesn't looks like it gained much more since then. Zig: unstable, experimental and used to be developed by a single person, recently gained a small community of contributors. May be usable in 5 years but not earlier. Ada: has important marketshare in some industries, but even in the said industries its future is uncertain because not many people want to work with it. For instance, in one of the biggest train manufacturer in the world, Ada has been replaced by C in some sectors because hiring Ada people was too hard.
- Tozen 5y agoObject Pascal is a very good C++ alternative that has been hiding in plain sight for quite a while.