6 ms·
> Rust feels like a Python developer’s idea of a high-performance computing language. I might be wrong, but I think it sounds more like Rust doesn't move as fa
by creata 2y ago
> Rust feels like a Python developer’s idea of a high-performance computing language.
I might be wrong, but I think it sounds more like Rust doesn't move as far away from the C or C++ way of doing things as you want it to. At the very least, Rust is no worse than C or C++ at any of the things you mentioned.
- ashvardanian 2y agoIn my (biased) experience, Rust is much harder to use for advanced projects, than C and C++. On the bright side, it’s also harder to misuse :)
- saagarjha 2y agoI don’t think Rust is worse at SIMD code, though.
- vlovich123 2y agoI've found it much easier to use from writing a web service to writing a high performance DB that outperforms RocksDB and clearly people are using it for things like writing operating systems as well as game engines. I'm not sure what in your mind falls under "advanced projects" but I suspect it's something like number crunching (although you link StringZilla so not sure). I'm still not seeing any description of specific challenges you feel are harder in Rust than in C/C++. In my mind Rust is completely equivalent in being able to accomplish the same tasks.
- porridgeraisin 2y agoThey wrote 2 whole paragraphs about SIMD.
- vlovich123 2y agoAnd to me SIMD does not seem significantly harder in Rust than in C++ but I've only done a little Rust SIMD so I'm willing to be wrong on that (although others have said it's not much harder than in C++ so not sure).
- jpc0 2y ago> easier to use from writing a web service to writing a high performance DB Have you looked at what the actual implementation code of tokio / axum etc looks like? I can't comment on DB because that is quite far out of my wheelhouse but regarding game engines, I've almost universally seen people revert to storing objects in arrays and passing around "handles" which is literally pointers with extra steps... But I guess at least you are protected from some issues there. Rust forces absurd levels of abstraction onto code very early and if you are wrong you need to make sweeping refractors. I really want to love the language, but building bottom up is extremely difficult with it, it may be Stockholm syndrome and familiarity but I can generally get much further into a project much quicker in C++. In Rust it feels like I'm fighting the language and it's not the borrow checker. There are so many great ideas in Rust and I keep trying it because of them, don't get me wrong I do think a safer language is the future but Rust isn't there yet. Every time I try it it's better though.
- vlovich123 2y agoI have actually looked at the interior of Tokio. While there's a lot of complexity there, most of that complexity is in making a highly performing multi-threaded work-stealing runtime rather than anything Rust-specific. Indeed, I find it easier to reason about than in C++ because the ownership rules are enforced and where they're violated is clearly annotated with unsafe & lots of documentation explaining why it's safe. I suspect you'll see similar things in axum but I can't speak to that codebase specifically. I don't think you'd be able to do something meaningfully easier in C+. I think it is Stockholm syndrome. It took me about 2 months to get familiar that it wasn't uncomfortable anymore and 8 months to reach the "I can generate code faster than I ever could in C++". For context consider that I'd spent the prior ~11 years coding on and off in C++ professionally and the prior 10 years before that as a kid learning C++ so C++ was definitely a language I felt at home in. I spend almost no time compared to C++ trying to make the build system work and I can quickly pull in high quality components others have written vs in C++ where I either have to implement it myself, spend time on build integration, or figure out a way to do without.
- jpc0 2y ago
- mungaihaha 2y ago> I'm still not seeing any description of specific challenges you feel are harder in Rust than in C/C++ It's harder to model domains in Rust. C has the same problem and it is a big reason why the industry standard for game dev is C++
- tuna74 2y agoCould you expand on this? What exactly doe "model domains" mean?
- vlovich123 2y agoCare to give an example? I think GUIs remain the softest domain modeling area, but that’s about how do you do next gen GUI toolkits that are super high performance, safe, and lower overhead vs what Rust has today. But that’s an underserved niche anyway vs c++ toolkits or electron. The other weak parts might be ecosystem immaturity (eg Unreal vs Bevy) but that’s not a language modelling issue.
- mungaihaha 2y agoRust makes it hard to represent mutable graphs. If I have a value that can be updated by multiple GUI nodes, I have to architect my way around the borrow checker in Rust. Is it safe? yes. Is is performant? for a skilled Rust dev, yes. But it takes me >25% more time to do compared to C++. 25% of a year long project is 3 months
- knorker 2y agoIn my experience Rust is much easier for advanced projects. Once you get into high performance code, C++ takes much more time, for two reasons. 1. With C++ you have to think a lot. Like, a lot. To convince yourself that what you are doing is safe, and that the lifetimes and races of various objects are safe. Rust takes a huge load off, by failing to compile your mistakes. You know that for the code that doesn't use "unsafe", if it compiled, then you don't even have to think about races or lifetimes. 2. C++ has so many places where copies sneak in. Tracking down needless copies in C++, for object types where it's not as simple as "just disable copy construct & copy assign", can be tricky and is extremely brittle to future changes of code. And not just for the CPU cost of copies, but RAM costs too. And I say that as someone who's been coding C++ on a daily basis since the 1990s.