5 ms·
Rust has all of those other than portability. Rust's ecosystem while it is missing some things it also has things which are lacking in C++ like a good mature pa
by jeltz 6y ago
Rust has all of those other than portability. Rust's ecosystem while it is missing some things it also has things which are lacking in C++ like a good mature package manager.
- User23 6y ago> Rust has all of those other than portability. That's crippling. Arguably the best use case for C++ is coding video games, and portability is huge there.
- stu2b50 6y agoThe modern video game platforms are: PC, Xbox Series, PS5, Xbox One, PS4, Switch, Android, iOS, Web Of which Rust has backends for all them, even the web via wasm. While Rust is not as portable, it's not like it's strictly limited to well functioning x86 boxes, it'll produce binaries for anything that LLVM supports, which is quite a lot by now.
- FartyMcFarter 6y ago> Of which Rust has backends for all them, even the web via wasm. Are those backends officially supported on consoles? Do all those consoles have libraries and tools (profilers, debuggers, etc) that support Rust?
- stu2b50 6y agoYep, like in C++ it's trivially easy to use the platforms C apis. And indeed the debugger does work on all platform.
- bsagdiyev 6y agoInternally I know Sony had a Rust compiler for the PS4, I don’t know much more than that (like if it was used for anything). Just saw the repo was updated quite often so it was definitely still WIP at least, and it had some code samples for console apps. Never tried it on my dev console to see if it worked.
- steveklabnik 6y agoThey are not directly supported by the vendors. That said, tools that work on C and C++ will at least somewhat work on Rust, so you also get sorta kinda half support even if it's not officially supported. We'll see if this changes in the future, especially with some of the names doing Rust dev in these places.
- Torkel 6y agoModern C++ isn’t all that portable either.
- FartyMcFarter 6y agoIMHO the last big upgrade to C++ was C++11, which is supported by lots of toolchains. It added move semantics, decent smart pointers, and a crapload of other improvements. C++14 and C++17 were minor upgrades by comparison, so I'd say C++11 can rightly be called modern C++, though others may disagree.
- ncmncm 6y agoI see that you are wholly unaware of C++20, which (combined with '14 and '17) is as large a step from C++11 as C++11 was from C++98.
- FartyMcFarter 6y agoC++20 is barely out yet, and not supported by any toolchain. If that's the only version that counts as modern C++, then I agree that modern C++ isn't portable :)
- jcelerier 6y agoc'mon, you can run C++17 code on Commodore 64 (https://www.youtube.com/watch?v=zBkNBP00wJE https://www.youtube.com/watch?v=zBkNBP00wJE) and MS-DOS (https://www.youtube.com/watch?v=yHrC_rZUaiA https://www.youtube.com/watch?v=yHrC_rZUaiA), what more do you want ?
- rndgermandude 6y agoI'd argue that Rust is as portable as C++, if not more so, in the sense that there are no real barriers in the language itself that limit portability. It's harder to write un-portable code in Rust than in C++, because a lot less in idiomatic rust is undefined or food-gunable. Of course when it comes to practical portability today then you're right as there are plenty more C++ compilers for different platforms than Rust compilers (then again, there are more C compilers than C++ in that regard). This may eventually change over time, tho, but it sure is something to consider today. PS and edit: I don't mind you disagreeing with me, but would anybody care to illuminate me as to what your disagreement is about?
- cycloptic 6y agoC++ has several package managers, of varying levels of maturity. Here's a few: https://github.com/conan-io/conan https://github.com/conan-io/conan https://github.com/microsoft/vcpkg https://github.com/microsoft/vcpkg https://github.com/cpp-pm/hunter https://github.com/cpp-pm/hunter Another option if you're on Linux/BSD is to use your native package manager. C++ packages are usually included in those repositories. You also may be able to install Brew, Nix, or Guix on any given distribution.
- andi999 6y agoI never learned rust, but from what I read loving the borrow checker also requires Stockholm syndrom.
- cxvxx 6y agoIt's more like snowboarding or any activity with a high initial learning curve before a big payoff: It's hard, even painful, at the beginning, and you might come home covered in bruises, but eventually it "clicks" and it's a lot of fun. Stockholm Syndrome is more about convincing yourself that a bad situation is good because you're stuck in it. I don't think there are too many people "stuck" with Rust yet. On the contrary, I think the borrow checker is a draw.