Hacker News new | ask | show | jobs
by nejenendn 3173 days ago
Fortran is easier to optimize compared to c/++ if you don’t use restrict for the c end. If you do use restrict (iirc) the compilers are competitive.
3 comments

What I don't get is why someone doesn't make a superb template library with C++ that hides the restricts; it would make writing performant codes in C++ easier and you'd get the host of what C++ has to offer
Eigen isn’t good enough? You can offload some stuff to MKL with it also.
Kind of, compilers don't enforce correct use of restrict which opens the doors to strange errors, as it is UB if they actually do overlap.

Which is the main reason why ANSI C++ members are not keen in having restrict in C++.

Agreed. However, C++ pragmatically does have restrict in both clang and g++, which is still useful in cases where you can deductively prove the lack of aliasing.
There are more compilers out there, although I do agree in the context of HPC, those are probably the most used ones.
It say something like that here:

https://en.wikipedia.org/wiki/Restrict