4 ms·
There are a zillion reasons that C++ is still widely used (existing software, brand new software that relies heavily on existing libraries / game engines), so i
by TillE 3y ago
There are a zillion reasons that C++ is still widely used (existing software, brand new software that relies heavily on existing libraries / game engines), so it's really nice to have lots of helpful features being added to the language and the standard library.
I'm ambivalent about Rust, but its best feature compared to C++ is a universal package manager and build system. I like vcpkg well enough, but it's not Cargo, it can't be.
- klysm 3y agoAlso like memory safety
- pjmlp 3y agoLatest VS has AI integration with the static analyser, I am yet to try it out. If we get a C++ Copilot as "borrow checker" that is already quite an improvement, even if not perfect.
- coldtea 3y agoWhat if Rust gets a Copilot to make working with borrow checker trivial? Hmm, another idea: what if a language's compiler itself use an LLM to find invariants and issues (like race conditions) in the code?
- pjmlp 3y agoThat would be even better, naturally there still exists the whole ecosystem issue. In any case, taken to the extreme, the language won't matter any longer, beyond some druids with the knowledge to implement Star Trek like computing models. We will be left to architect roles.
- perth 3y agoThe thing that really ticks me off about RUST is it has compiler optimizations that can’t be turned off. In C++, you can typically turn off all optimizations, including optimizing away unused variables, in most compilers. In RUST it’s part of the language specification that you cannot have an unused variable, which, for me kills the language for me since I like having unused variables for debug while I’m stepping through the code.
- deleted 3y ago[deleted]
- coldtea 3y ago>which, for me kills the language for me since I like having unused variables for debug while I’m stepping through the code. If they're unused, then they're not helping with debugging either... It's quite a bizarre reason
- Buttons840 3y agoNot true. Their debugger might display the value of the variables, which are unused outside the debugger. There are other options in Rust though, like logging. Create your "unused variable", and then use it in a debug log or dbg macro, etc.
- groos 3y agov = function_call(); // inspect v in debugger but it's 'unused' to the compiler. At least this is how it works in C and C++.
- vacuity 3y agoThere isn't a Rust language specification, and you can use #![allow(dead_code)] at the root of the crate I'm not sure what you mean by "optimizing away unused variables", so I'm interpreting it as variables that are literally unused after declaration.
- fruffy 3y agoRelated: https://xkcd.com/1172/ https://xkcd.com/1172/
- cesarb 3y ago> In RUST it’s part of the language specification that you cannot have an unused variable I believe you're confusing Rust with Go. In Rust, an unused variable is just a warning, unless you explicitly asked the compiler to turn that warning (or all warnings) into an error.
- dralley 3y ago