News for hackers. Stuff that matters.
Re:Std::visit is everything wrong with modern C++ (2017) by jeltz on Saturday December 05, 2020 @10:21AM (#25315167)
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.
Re:Std::visit is everything wrong with modern C++ (2017) by cycloptic on Saturday December 05, 2020 @11:02AM (#25315482)
C++ has several package managers, of varying levels of maturity. Here's a few:

https://github.com/conan-io/conan

https://github.com/microsoft/vcpkg

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.

Re:Std::visit is everything wrong with modern C++ (2017) by xigoi on Saturday December 05, 2020 @12:37PM (#25316418)
>Another option if you're on Linux/BSD is to use your native package manager.

There goes the portability.

Re:Std::visit is everything wrong with modern C++ (2017) by cycloptic on Saturday December 05, 2020 @01:09PM (#25316756)
No, portability is easily achieved with those by using containers.
Re:Std::visit is everything wrong with modern C++ (2017) by andi999 on Saturday December 05, 2020 @11:45AM (#25315858)
I never learned rust, but from what I read loving the borrow checker also requires Stockholm syndrom.
Re:Std::visit is everything wrong with modern C++ (2017) by cxvxx on Saturday December 05, 2020 @12:23PM (#25316291)
It'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.

Re:Std::visit is everything wrong with modern C++ (2017) by User23 on Saturday December 05, 2020 @10:49AM (#25315386)
> 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.

Re:Std::visit is everything wrong with modern C++ (2017) by stu2b50 on Saturday December 05, 2020 @10:54AM (#25315421)
The 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.

Re:Std::visit is everything wrong with modern C++ (2017) by FartyMcFarter on Saturday December 05, 2020 @10:58AM (#25315449)
> 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?

Re:Std::visit is everything wrong with modern C++ (2017) by steveklabnik on Saturday December 05, 2020 @12:32PM (#25316359)
They 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.

Re:Std::visit is everything wrong with modern C++ (2017) by bsagdiyev on Saturday December 05, 2020 @11:23AM (#25315677)
Internally 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.
Re:Std::visit is everything wrong with modern C++ (2017) by stu2b50 on Saturday December 05, 2020 @11:22AM (#25315659)
Yep, like in C++ it's trivially easy to use the platforms C apis. And indeed the debugger does work on all platform.
Re:Std::visit is everything wrong with modern C++ (2017) by Torkel on Saturday December 05, 2020 @11:04AM (#25315500)
Modern C++ isn’t all that portable either.
Re:Std::visit is everything wrong with modern C++ (2017) by FartyMcFarter on Saturday December 05, 2020 @11:10AM (#25315554)
IMHO 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.

Re:Std::visit is everything wrong with modern C++ (2017) by ncmncm on Saturday December 05, 2020 @12:54PM (#25316599)
I 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.
Re:Std::visit is everything wrong with modern C++ (2017) by FartyMcFarter on Saturday December 05, 2020 @01:13PM (#25316785)
C++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 :)
Re:Std::visit is everything wrong with modern C++ (2017) by jcelerier on Saturday December 05, 2020 @11:46AM (#25315879)
c'mon, you can run C++17 code on Commodore 64 (https://www.youtube.com/watch?v=zBkNBP00wJE) and MS-DOS (https://www.youtube.com/watch?v=yHrC_rZUaiA), what more do you want ?
Re:Std::visit is everything wrong with modern C++ (2017) by rndgermandude on Saturday December 05, 2020 @11:48AM (#25315909)
I'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?