Remix.run Logo
Narishma 3 hours ago

I don't think there's much difference between C and C++ (and Rust, etc...) when it comes to this.

formerly_proven an hour ago | parent | next [-]

Idiomatic/natural rust tends to be a lot heavier on allocations and also physically moving objects around than the other two.

kmaitreys 21 minutes ago | parent [-]

Can you elaborate on this? Slightly concerned because I'm have written (and planning to write more) Rust HPC code

Joeboy 6 minutes ago | parent [-]

Maybe not what they meant, but Rust sometimes makes it tempting to just copy things rather than fighting the borrow checker. Whereas in C++ you're free to just pass pointers around and not worry about it until / unless your code crashes or gets exploited.

Speaking authoritatively from my position as an incompetent C++ / Rust dev.

Joel_Mckay 3 hours ago | parent | prev [-]

There is unless using a llvm compiler that does naive things with code motion.

Rust is typically slowest (often negligible <3%), C++ has better CUDA support, and C can be heavily optimized with inline assembly (very unforgiving to juniors.)

Also, heavily associated with coding style =3

https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Dev...