r/ProgrammingLanguages • • Jul 01 '26

The Expensive Fictions of Low-Level Programming Languages

https://stng.substack.com/p/the-expensive-fictions-of-low-level
19 Upvotes

90 comments sorted by

View all comments

Show parent comment

5

u/Soupeeee Jul 01 '26

A really easy example of where C falls short is auto vectorization. You can't guarantee that the compiler will do it, and despite how good some systems are at figuring it out, the only way to know for sure is to look at the decompiled output.

Adding language constructs to help ensure that vector instructions are used while still having portable code is a very basic solution to what's being proposed here, although it doesn't go nearly far enough.

1

u/Norphesius Jul 01 '26

Not all hardware has vector operations, and they don't all do it the same way. You could end up with a similar situation where you're expecting code to vectorize because you declared so, and it just doesn't happen, or it does but not in the way you expected. Explicitly declaring something and having it not happen sometimes seems worse to me than the opposite, IMO.

Not to say the effort shouldn't be made to create features like that, it's just not a "basic solution".