https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
looks quite decent, but overall Rust is still behind? So if I am in an area where performance (or cost/energy) is king then I'd still pick C++.
Yes, Rust has inline assembly in roughly the same way you'd be used to with C or C++
https://doc.rust-lang.org/reference/inline-assembly.html
The Benchmarks Game has a bunch of benchmarks, and while it's probably significant that the Python programs are routinely orders of magnitude slower than say C, we likely shouldn't read too much into whether somebody scraped a few more milliseconds off the best time for one of the benchmarks listed.
Inline assembly: https://rust-lang.github.io/rfcs/2873-inline-asm.html
Performance is almost identical, even the linked benchmark is quite even.
Yes... unlike in x64 MSVC, one of several C++ compilers I frequently must support, where inline assembly is verbotten. Does that put Rust ahead? :P
>Can you write assembly embedded in Rust code?
Yes, I've done this several times. It looks like this: https://doc.rust-lang.org/rust-by-example/unsafe/asm.html
Yes. https://docs.rs/simd/latest/simd/
> Can you write assembly embedded in Rust code?
Also yes. https://doc.rust-lang.org/reference/inline-assembly.html
It’s holding up lots of applications because better languages didn’t exist at the time those projects were started, and it’s rarely feasible to switch languages. Specifically, a lot of people look to Rust to unseat C++ for new applications, but it will take a while for Rust to mature with respect to libraries (e.g., game engines) and mindshare in those industries. But even then, old languages have tons of staying power by virtue of age.