52 ms·
There are those of us who have been writing C++ for decades and are sick of the footguns and build systems but have never had a viable alternative before. I do
by vvanders 9y ago
There are those of us who have been writing C++ for decades and are sick of the footguns and build systems but have never had a viable alternative before.
I don't think anyone is arguing that we should throw everything out, however for all my greenfield stuff Rust has been a welcome breath of fresh air. Yeah, there are some people who are a little too over the top but a large part of the support behind Rust is from those of us who've used it in production and found it to be a fantastic language and ecosystem.
- Avshalom 9y ago(well I mean there has been Ada* for ages) *or fortran or pascal
- rufius 9y agoThe tool chain there is still quite irritating and “old school”. At least for me, part of the attraction of Rust is the development tools around the language itself (e.g. cargo).
- vvanders 9y agoYeah, in no particular order here's what I love about cargo: Seamless cross-compile. I've done a ton of cross-compile projects, cargo/rustup is the best by far. One-line dependency import. Saves *hours* setting up build chains. First-class win32 support. Hard to stress how rare and awesome this is coming from a gamedev background. Integrated testing. So nice just to have. Integrated benchmarking, ditto above.
- deleted 9y ago[deleted]
- oscargrouch 9y ago> I don't think anyone is arguing that we should throw everything out, however for all my greenfield stuff Rust has been a welcome breath of fresh air. If you can write things from scratch in a clear room fashion, perhaps. C++ is very good, when you need to integrate a lot of 'low-level' libraries (that are alredy in C or C++) together in a meaninful way, like for instance, browsers do. Like the capacity to 'talk' with FFMPEG, levelDB, linux, etc.. in a complete native fashion basically. I think in that regard Rust is sort of late to the party, and will find a wall hard to beat down, once the adoption rate get some maturity. If you are already a experienced C++ dev, compared to modern C++, Rust has very little to offer. Of course is more modern, (maybe) more ergonomic? But little things like package manager or explicit lifetime management by itself wont cut it.. at least not for people with large codebases already in C++. When you are younger, programming languages look like that secret ingredient that will turn whatever you do into a magical tool.. But experience tells you that nothing beats hard work or that you should understand the strenght and weakness of each language, and know when and how to use it. So for the problem domains where C++ are being used, it will get hard to beat, because a lot of great software are already there, and can be integrated in a native fashion, with whatever you do on top of it. And by the way, modern C++ is already secure enough, making some selling points for Rust, a little bit of cosmetic right now. If you throw a language like Swift into the equation.. particularly i think they(C++ and Swift) form a lovely and unbeatable couple.
- vvanders 9y agoI mean this in the most non-confrontational way: have you actually used/looked at Rust? The reason I ask is just about every item you laid out I've had the opposite experience. Talking with C/C++ is trivial with bindgen and clang. Embedding in C++ is likewise straightforward. I mean Firefox is one of the larger C++ codebases out there. The package manager is great and makes dropping in things much less painful. On the security front I don't think you can compare the two, I can easily think of things like iterator invalidation that C++ just doesn't handle well. The last big project I did in Rust ran on 6 different targets(x68 win32/linux/osx, android armv7/x86, wasm) targeting 3 different rendering stacks(OpenGL, HTML Canvas, Android Views) integrated deeply with a Lua interpreter. Having done cross-platform stuff like this in the past it was a build/toolchain nightmare. With Rust everything was straightforward and pretty darn painless.
- stochastic_monk 9y agoThe real problem is when it's not just binding: it's actually using metaprogramming, which is a huge part of why I use C++. There's no equivalent to blaze or eigen for linear algebra in Rust, and much of that heavy lifting is handled by templates. (There are some libraries with rudimental expression template-like behavior, but nothing as sophisticated.)
- kelnos 9y agoThis is the sort of thing that bothers me about these kinds of arguments. Sure, you're always going to be able to find certain domains where existing libraries or language features make a certain ecosystem very well suited. And that's fine. No one's saying to discard the best tool for the job for another one that might have some general advantages but won't actually get you where you need to go. But there are a ton of domains where C++ doesn't have anything special to offer and you could just as reasonably write the code in rust.
- stochastic_monk 9y agoPerfect. I absolutely agree. The thing is, I use C++ because it does a lot of things specialized for what I need. I don't work on every problem, and I look forward to the chance to use Rust. That being said, for now, the problems I'm working on are domains that very much benefit from C++ and I will continue to use it. I totally agree that Rust is a great language and has wide applications. It doesn't fit my current needs, but I don't doubt it meets many people's needs. More power to them -- and it's cool to have a "The new C++ killer language" which can actually live up to its hype, unlike Java and C# and Go and D.