4 ms·
In the words of the author, C++ is ("arguably") less complex and easier to use than Rust[1]. The guy should have been here yesterday when Conan and C++ modules
by klibertp 3y ago
In the words of the author, C++ is ("arguably") less complex and easier to use than Rust[1]. The guy should have been here yesterday when Conan and C++ modules were discussed... But then he'd need to know at least a bit of C++, which he doesn't. He doesn't know Rust, either. His programming language familiarity begins and ends with BASIC in high school (the bio under the article says).
Why is it that you need to know something to read about that, but you only need to be able to form senteces to write about it?
EDIT: [1] This is of course contrasted by the elegance of Rust's "Hello world".
- cmrdporcupine 3y ago... If you can make money writing code, would you do tech journalism instead?
- gnulinux 3y ago... Yes? I make money writing code but I'd love to do tech journalism (no one would pay me money to read my stuff right now).
- JohnFen 3y agoSure, if I were interested in journalism. They're different sorts of things, and a ton of people don't decide what they want to do based solely on how much money they can earn doing it.
- ForkMeOnTinder 3y agoYeah, what even is this article. > The reasons are many, including significantly greater language support both historically and now, a better fit for computations inside WebAssembly modules, exceptionally lightweight and speedy for LLM (large language model), and other superlatives. Why is Rust (a general purpose programming language) exceptionally suited for LLMs (which typically run on a GPU)? What major LLM projects even use Rust? Definitely not llama.cpp or ollama. They just had to slide in that buzzword.
- cmrdporcupine 3y agoIndeed while I'm sure Rust could eventually be useful in this space, last time I looked at the story for GPU-dev on Rust, it was still very very nascent. (Which is unfortunate because I'd like to play with that.)
- pilotneko 3y agoI think both Candle and Hugging Face Text Generation Inference leverage Rust.
- lolinder 3y agoThere's a whole genre of low-effort SEO articles that claim to answer the question "what programming language should I learn [in {year}|for {use case}]". This is just a thinly veiled entry into that genre. It's not a genre that calls for nuance or even a little bit of understanding, you just need to make sure you use the right keywords to rank well for the query you're targeting.
- JohnFen 3y agoI've been learning Rust, and so far anyway, I absolutely find it more complex and harder to use than C++ (which is saying something!) I'm hoping that Rust will become more sensible to me as I gain proficiency, but so far it's been thoroughly unpleasant.
- danShumway 3y agoI've also been learning Rust and have also struggled with it a bit more than I expected. It's not bad, but I do think there is a learning curve. I've struggled more with Rust than I typically do when learning new languages. C++ benefits a little in that you can almost just use C++ as C, and I think part of the reason I struggled less with C++ when I used to play with it was that I didn't do the weird stuff. That's not to say that C++ complexity doesn't matter, but it might make the language more accessible to some people because they don't need to learn the weird stuff until they start looking at other people's code or using tutorials? I'm not sure I ever completely fully learned C++ as much as I learned C and the handful of C++ features that fixed some of the things that bothered me in C. And with Rust there are concepts that (to me) feel harder to avoid. Rust (from what I've used) seems to be overall a much more elegant language than C++, but it feels like more of its complexity is front-loaded and that you run into difficult patterns that test your knowledge more quickly. That might just be my impression though, I'm tackling the two languages at different times of my life and I'm doing different things with them. I've also been approaching it in a fairly unstructured way, and I know that some people recommend just sitting down and reading through the Rust book cover to cover. Which to be fair, is probably a faster way to learn it than just trying to build stuff with it and then learning new concepts as they're needed and when I run into errors and problems. My (again, very early) impression of Rust is that it feels more purposefully designed than a lot of other languages I've used, but I have a harder time intuiting what the purpose of everything is and a lot of the systems interlock with each other that seems to make them a bit harder to tackle one at a time -- so I suspect it benefits more from guided learning.
- spease 3y ago> but it feels like more of its complexity is front-loaded and that you run into difficult patterns that test your knowledge more quickly. That might just be my impression though, I'm tackling the two languages at different times of my life and I'm doing different things with them. That’s exactly it. C++ will let you do things that are 100% wrong, or worse, occasionally wrong, and you have to “just know” how to do them right. Rust will absolutely refuse to compile until you’ve used the correct concept to solve the problem. It doesn’t eliminate pure logic bugs, but it can vastly reduce the set of possible inputs and code paths to include a subset of possible failure modes you’d find in C++ code. Which would only be enforced by discipline or code reviews, and forces everyone to be consciously anal-retentive to avoid introducing subtle errors in the codebase. In addition, a lot of C++’s additions have been more type-safe constructs to partially accomplish some of the safety in Rust, but it doesn’t have a way to drop additions. As a result, the “bad practice” solutions are the ones that got there first and are easiest to reach for, and the best practice solutions have more complex syntax. For whatever reason, new C++ additions also seem to often be half-baked because support isn’t added to other parts of the STL that they interact with, even if it’s painfully obvious you would absolutely want to reach for those tools. For instance, the limited types supported by std::to_string, or hash tables not supporting tuples for multiple editions (haven’t checked C++23). So yeah, if you stick to or start out with C++03, single-threaded programming, small codebase, it seems simpler. But once you start scaling the complexity of the code or the size of the codebase, or digging deeper into the language (I haven’t even mentioned template metaprogramming), you keep on encountering more and more complexity. Whereas with Rust, if you’re writing it idiomatically anyway, the difficulty tends to plateau as (1) the language is in the background minimizing side effects and enforcing cross-module constraints so the volume of code you have to “just know” to safely work on something doesn’t scale with the codebase (2) your initial learning only consists of the modern best practices constructs, and after that additional learning tends to be more bite-sized. When you factor in C++’s still-chaotic DIY buildscript, packaging, linting, formatting situation, the level of cognitive overhead for the parts of a practical C++ project that you actively have to manage tends to be far, far greater than Rust. And some teams just throw up their hands and decide they aren’t even going to try to keep pace, and just negotiate some arbitrary point in the past they’re going to keep the codebase. So the editorial comparisons between the safety of bleeding-edge modern C++ and Rust aren’t even really practically relevant, because a lot of teams fall off from how user-unfriendly C++ tooling and later editions wind up being.