r/programming • • Aug 13 '18

C Is Not a Low-level Language

https://queue.acm.org/detail.cfm?id=3212479
87 Upvotes

222 comments sorted by

View all comments

Show parent comments

2

u/m50d Aug 14 '18

Given current PL, it does not.

I'd say it's more: given the PL of 10-20 years ago it didn't.

And do we know how to build modern superscalar SMP / SMT processors with way more cores than needed for GP processing already? Yes.

Up to a point, but the article points out e.g. spending a lot of silicon complexity on cache coherency, which is only getting worse as core counts rise.

1

u/mewloz Aug 14 '18

Well for the precise example of cache coherency, if you don't want it you already can do a cluster. Now the question becomes: do you want a cluster on chip. Maybe you do, but in this case will you just take the inconvenience that goes with it and drop some of the most useful advantages (e.g. fault tolerance) that you could have if the incoherent domains actually were different nodes?

I mean, simpler/weaker stuff have been repeatedly tried and failed with time in front of strong HW (at least by default, it is always possible to optimize using opt-in weaker stuff, for ex non temporal stores on x86; but this is once you know the hot spots -- and reversing the whole game would be impractical, bug prone, and security hole prone): ex. even most DMA are coherent nowadays, and some OS experts consider it to be a complete "bullshit" to want incoherent DMA back again (I'm thinking about Linus...)

And the only reason for why weak HW has been tried was already the exactly same reasons as what is discussed today: the SW might do it better (or maybe just good enough), the HW will be simpler, the HW will dedicate less area to that, so we can either have more efficient hard (less transistors to drive) or faster hard (using the area for other purposes). It never happened. Worse: the problem now with this theory is this would even be harder than before: Skylake has kind of maxed out the completely connected bypass network, so for ex you can't easily use a little bit of more area to throw more execution units at the problem. Moreover, AVX 512 shows that you need extraordinary power and dissipation and even then you can't even sustain the nominal speed. So at this point you should rather switch to a GPU model... And we have them. And they work. Programmed with C / C++ derivatives.

When you takes into account the economics of SW development, weak GP CPUs have never worked. Maybe it will somehow work more now that HW speedup is hitting a soft ceiling, but I do not expect a complete reversal. Especially given the field tested workarounds we have, but also considering the taste of enormous parts of the industry for backward compat.