Earlier quoted context omitted.
Finanally, c++ is the only language I would ever want to do linear algebra in, or for that matter, many graph algorithms. Rust is adding features to make it useful for linalg, but it’s not their yet. Linear algebra is important!
> Finanally, c++ is the only language I would ever want to do linear algebra in Isn't something like MATLAB better for linear algebra than C++?
Is C++ Doomed?
131–140 of 168 posts
Re: Is C++ Doomed?
#132© Elon Musk, February 23, 2022[0]
Re: Is C++ Doomed?
#133You'll have to prize C and C++ from the cold dead hands of the embedded programmers. Most of them are still doing OO using plain C.
Re: Is C++ Doomed?
#134The basic problem with C++ is that it has has hiding without safety. C has neither, and most newer languages have both. Attempts to add safety to C++ via templates always seem to leak raw pointers, since many APIs never converted to C++. It's significant that there isn't a C++ Linux kernel API, where you use C++ strings for everything and get rid of the null-terminated stuff. You see this in the original poster's exa…
rust is not good for game dev compilation time is even worse than c++ there are hidden allocations EVERYWHERE that you can't even control stop trying to push that narrative, it makes rust look bad rust is nice if you target things like drivers, anything else it's bad the other day i read people who thought rust could replace javascript just take a nap and move on, you are delusional
That's highly dependent. C++ is pretty bad and I've seen quite a few codebases where the C++ is way worse than the equivalent of Rust.
> there are hidden allocations EVERYWHERE that you can't even control
That's simply not true. It's also a highly ironic statement given the tendency of C++ to have all manner of allocations all over the place (example--look at how many people implement their own String instead of using the STL one).
You can control the allocations in Rust, but you do have to do so explicitly. Agreed, this is more like C than C++.
> stop trying to push that narrative, it makes rust look bad
Yeah, I kind of agree with this in the game space.
There are a LOT of things that Rust does poorly within the gaming space.
Being able to efficiently transmute between equivalent types of memory (array of 4 bytes, an RGBA packed struct, and a uint32_t, for example) without losing performance is something Rust is really bad at.
Packed structs are poor. There really isn't a good set of idioms for GUIs. ECS seems like a bit of a hack to get around the inability to transmute types efficiently. etc.
Oddly, one space that Rust is gaining traction in the gaming space is the network communication layer. People are simply tired of debugging buffer overruns and have decided that they'd much rather have something different. And, since Rust can compile down to a library, it can be linked into the rest of your game and not interfere with your pipeline.
> just take a nap and move on, you are delusional
Hey! You don't need to be delusional to take a nap. You can like naps just fine without being delusional.
Re: Is C++ Doomed?
#135Earlier quoted context omitted.
In this aerospace company, we use C, no C++ allowed, to avoid all the extra footguns that get in the way of safety and certification. Rust will probably be the next choice on the scene, but I expect it'll take as long to come as Ada took to go.
In this aerospace company, we use C, and sometimes a subset of C++ that is basically C+epsilon. That's all new, however, so each new project that goes that direction is walking a dark forest. We've got some Rust on the ISS, but honestly, the interest from the serious FSW folks isn't there.
But it's going to take a lot of time and work.
Re: Is C++ Doomed?
#136Earlier quoted context omitted.
Off topic, but curious why Ada went?
Would also be curious to know this. I had heard (anecdotally) that Ada is commonplace in aerospace tech.
Re: Is C++ Doomed?
#137I should note that writing data structures in rust is also a fraught business! In practice, that’s just a property of languages that don’t have garbage collection. Exception safety is a serious complication in c++! Exceptions were a mistake in the language, particularly given the existence now of std::optional.
Finanally, c++ is the only language I would ever want to do linear algebra in, or for that matter, many graph algorithms. Rust is adding features to make it useful for linalg, but it’s not their yet. Linear algebra is important!
Re: Is C++ Doomed?
#138Earlier quoted context omitted.
In this aerospace company, we use C, no C++ allowed, to avoid all the extra footguns that get in the way of safety and certification. Rust will probably be the next choice on the scene, but I expect it'll take as long to come as Ada took to go.
> Rust will probably be the next choice on the scene I'm not sure about it. I think Rust might be hard to certify for aerospace usage. Not because it's bad, but because it's still complex. Just a lot of negative side effects of complexity are contained due to the compiler checks and design. But that makes it harder to certify as I can tell.
Re: Is C++ Doomed?
#139No, just as Betteridge's Law would lead you to suppose. This really boils down to "creating your own custom data object that plays nice in all scenarios is too hard". (Or, more cynically, too hard for the author - some of us don't find it particularly hard.) Does that mean C++ is doomed? No, it just means that not all C++ developers are going to create objects with full RAII initialization semantics and full rule-of-…
Rust is the only thing that even looks close to a competitor, but it still has a long road before it’s viably a replacement, and its lack of OOP and strict ownership rules may prove to be too foreign for the vast majority of programmers who are used to slinging pointers around and OOP design patterns, not to mention the cozy C syntax.
Even if C++’s technical merits are lacking, it won a cultural victory by catering to both the hegemony of OOP and C.
Re: Is C++ Doomed?
#140The basic problem with C++ is that it has has hiding without safety. C has neither, and most newer languages have both. Attempts to add safety to C++ via templates always seem to leak raw pointers, since many APIs never converted to C++. It's significant that there isn't a C++ Linux kernel API, where you use C++ strings for everything and get rid of the null-terminated stuff. You see this in the original poster's exa…
also, there is nothing wrong with C++. it’s C with additional language constructs and the STL. use as much or as little as you want of it.
also, there is no such thing as leaking a pointer. you can leak a piece of memory.
at the end of the day you need to understand operating systems and how memory management, CPUs and instruction sets work and lots of other low level stuff to build software using C or C++. Rust might temprarily help with some challenges or shield off certain otherwise advanced challenges but in the end there is no way around learning how the machine you write software for works. if you don’t want to deal with that, go build websites.