Re:PLOS2021: ISO-C became unusable for operating systems
by not2b on Thursday October 07, 2021 @07:22PM
(#28793432)
You doubt it because you aren't a compiler developer, so you aren't aware of the history. Try taking some of the classic Fortran scientific programming libraries, such as LAPACK, recoding them in C, and then see what happens when you need to generate code with a compiler that doesn't do any of the optimizations the article complains about and has no undefined behavior. Then you'll figure out why.
Re:PLOS2021: ISO-C became unusable for operating systems
by vyodaiken on Thursday October 07, 2021 @09:34PM
(#28794652)
You still don't have any data.
Re:PLOS2021: ISO-C became unusable for operating systems
by throwaway19937 on Saturday October 09, 2021 @03:14PM
(#28812413)
You're the one arguing for a change to the status quo, the burden of proof is on you.
Re:PLOS2021: ISO-C became unusable for operating systems
by Gibbon1 on Thursday October 07, 2021 @02:17AM
(#28782821)
My understanding is the reason FORTRAN is faster than C isn't because of stupid stuff like noalias and the like. It's because FORTRAN has arrays and C doesn't.
Re:PLOS2021: ISO-C became unusable for operating systems
by not2b on Thursday October 07, 2021 @07:26PM
(#28793467)
You're right, sort of. Because C doesn't have proper arrays, you make up for it by passing a pointer to the first element and the range. So for C to do as well as Fortran on matrix operations the compiler developers need help. One source of help is that if you have a pointer to double and a pointer to int, you can assume that writing pdouble[k] doesn't alter anything reachable as pint[m].
Re:PLOS2021: ISO-C became unusable for operating systems
by vyodaiken on Thursday October 07, 2021 @09:32PM
(#28794639)
It's because C has pointers and FORTRAN doesn't and pointers are a pain for certain types of optimization.
Re:PLOS2021: ISO-C became unusable for operating systems
by qsort on Thursday October 07, 2021 @07:11AM
(#28784744)
Why would that put C at a disadvantage performance-wise? Array decay is, with hindsight, an unfortunate feature, but optimizing access to contiguous memory is very low-hanging fruit as far as compiler optimizations go.
Re:PLOS2021: ISO-C became unusable for operating systems
by rini17 on Thursday October 07, 2021 @07:14AM
(#28784773)
Some optimizations are low-hanging fruit only if you know length of the array. Which C avoids by design at all costs.
Re:PLOS2021: ISO-C became unusable for operating systems
by Gibbon1 on Thursday October 07, 2021 @03:28PM
(#28791001)
If you want better safety, runtime and compile time performance the lowest hanging fruit would be to fire the C standards committee and hard fork C++/C into C++ and C only ecosystems.
In any case, for people who want to write OS or cryptography or embedded systems or arithmetic libraries or ... in C, this is not a relevant point.