3 ms·
“Holding up an order of magnitude more applications … clearly it has upsides”. It’s holding up lots of applications because better languages didn’t exist at th
by throwaway894345 4y ago
“Holding up an order of magnitude more applications … clearly it has upsides”.
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.
- YZF 4y agoI'm not super familiar with Rust, do you have SSE/AVX intrinsics (others?)? Can you write assembly embedded in Rust code? How does rust stack in terms of performance? https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/gpp-rust.html 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++.
- agersant 4y ago> do you have SSE/AVX intrinsics (others?)? Yes. https://docs.rs/simd/latest/simd/ 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 https://doc.rust-lang.org/reference/inline-assembly.html
- the_jesus_villa 4y agoI don't know the answers to all of your questions, but >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 https://doc.rust-lang.org/rust-by-example/unsafe/asm.html
- dento 4y agoSIMD intrinsics exist, although currently require nightly compiler on non-x86 targets: https://doc.rust-lang.org/1.29.0/core/arch/x86/index.html https://doc.rust-lang.org/1.29.0/core/arch/x86/index.html Inline assembly: https://rust-lang.github.io/rfcs/2873-inline-asm.html https://rust-lang.github.io/rfcs/2873-inline-asm.html Performance is almost identical, even the linked benchmark is quite even.
- tialaramex 4y agoRust's std::simd is the portable abstraction but it is so far only available in nightly Rust, in principle you would be able to write code that does SIMD on whatever hardware (ARM, x86-64, whatever) is targeted including AVX. 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 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.
- astrange 4y agoPortable abstractions for SIMD aren't very useful, because if you're writing SIMD you want performance, and the things it abstracts over (specific SIMD capabilities and weird performance quirks of different instructions) mean the results of using it aren't predictable.
- MaulingMonkey 4y ago> Can you write assembly embedded in Rust code? 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
- deleted 4y ago[deleted]