News for hackers. Stuff that matters.
Re:Bugs that the Rust compiler catches for you by nine_k on Thursday May 05, 2022 @11:45PM (#31281080)
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++.

Re:Bugs that the Rust compiler catches for you by girvo on Friday May 06, 2022 @12:37AM (#31281376)
Nim, 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
Re:Bugs that the Rust compiler catches for you by DeathArrow on Friday May 06, 2022 @01:11AM (#31281540)
Nim 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.

Re:Bugs that the Rust compiler catches for you by girvo on Friday May 06, 2022 @01:22AM (#31281595)
Oh 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.

Re:Bugs that the Rust compiler catches for you by littlestymaar on Friday May 06, 2022 @06:32AM (#31283546)
D: 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.

Re:Bugs that the Rust compiler catches for you by Atalocke on Friday May 06, 2022 @12:51AM (#31281432)
Hare ;)
Re:Bugs that the Rust compiler catches for you by Tozen on Saturday May 07, 2022 @09:44AM (#31294377)
Object Pascal is a very good C++ alternative that has been hiding in plain sight for quite a while.