News for hackers. Stuff that matters.
Re:Ask HN: Best way to learn modern C++? by pjmlp on Wednesday March 07, 2018 @08:48AM (#16536258)
Rust still needs to catch up with C++ in a few domains.

SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...

Re:Ask HN: Best way to learn modern C++? by steveklabnik on Wednesday March 07, 2018 @09:32AM (#16536580)
Incidentally, SIMD is just waiting on stabilization now; it’s RFC was accepted and the implementation landed. Soon!
Re:Ask HN: Best way to learn modern C++? by AnimalMuppet on Wednesday March 07, 2018 @12:25PM (#16537962)
Will Rust have idioms for really doing SIMD in Rust? If I understand correctly, C++ has to drop into assembly to do SIMD (at least so far).
Re:Ask HN: Best way to learn modern C++? by steveklabnik on Wednesday March 07, 2018 @12:47PM (#16538178)
I don’t believe that’s correct for C++.

Regardless, yes, that’s the whole point. What’s been accepted is https://doc.rust-lang.org/nightly/core/arch/index.html , that is, intrinsics that map 1-1 to the vendor APIs. (I belive this is the same in C++ but not my area of specialty so I may be wrong)

https://doc.rust-lang.org/nightly/core/simd/index.html is the first level up the abstraction chain; this hasn’t gone through an RFC process yet, but will eventually happen.

On top of that, you have stuff like https://crates.io/crates/faster , which is very high level. Looks like they need to fix up the README... but you get the idea.

Also, autovectorization has existed this entire time. This stuff is for when that falls down.

Re:Ask HN: Best way to learn modern C++? by pjmlp on Wednesday March 07, 2018 @12:37PM (#16538078)
C++ doesn't need Assembly for SIMD.

Most compilers do a reasonable job with auto-vectorization, and if more is needed, there are instrisics.

No need to write straight Assembly.

Re:Ask HN: Best way to learn modern C++? by AnimalMuppet on Wednesday March 07, 2018 @12:46PM (#16538164)
OK. (The one time I encountered SIMD in C++ was a decade ago; we had to use assembly then. And even then, we weren't playing with an up-to-the-minute compiler. (In my experience, your comments elsewhere on this article about embedded toolchains were accurate.)

Are the intrinsics standard? If so, what version of the standard were they in? How good is compiler support for them?

Re:Ask HN: Best way to learn modern C++? by AstralStorm on Wednesday March 07, 2018 @01:21PM (#16538501)
Not standard, unless you count "supported with the same semantics in multiple compilers" as good enough.

They are not portable between CPU architectures either way

For reference, C got real alignment support in C11 and C++ in C++17. Without this, even starting on SIMD is risky.

That said, you can go really far with a good C++ math library like Eigen which has singe vectorization in the operations themselves.

Re:Ask HN: Best way to learn modern C++? by xfer on Wednesday March 07, 2018 @09:05AM (#16536376)
what do you mean by "certified" compiler here?
Re:Ask HN: Best way to learn modern C++? by pjmlp on Wednesday March 07, 2018 @09:10AM (#16536404)
In certain industries, specially where human lives are at stake you can only use certified compilers, where the kind of code they generate is validated against specific safety standards.

For example,

https://www.iar.com/iar-embedded-workbench/certified-tools-f...

Re:Ask HN: Best way to learn modern C++? by hsivonen on Wednesday March 07, 2018 @09:53AM (#16536744)
As a programmer using the compiler, how does the IAR compiler quality feel in practice compared to GCC or clang?
Re:Ask HN: Best way to learn modern C++? by pjmlp on Wednesday March 07, 2018 @10:12AM (#16536881)
I never used IAR, given my focus on writing safe software I try to be up to date to these areas, and ways to somehow write secure software in C and C++. like MISRA and Frama-C.

Maybe someone else can jump in.

However, I can tell you that in general proprietary compilers for embedded devices make Visual C++ feel state of the art, let alone when compared with gcc or clang.

Many of them are stuck in partial support for C99 or C++98 (e.g. TI), with no clear roadmap of future improvements.