Thoughts on parallel programming?

bearophile bearophileHUGS at lycos.com
Thu Nov 11 13:32:03 PST 2010


Walter:

> Yup. I am bemused by the efforts put into analyzing loops so that they can (by 
> the compiler) be re-written into a higher level construct, and then the higher 
> level construct is compiled.
> 
> It just is backwards what the compiler should be doing. The high level construct 
> is what the programmer should be writing. It shouldn't be something the compiler 
> reconstructs from low level source code.

I agree a lot. The language has to offer means to express all the semantics and constraints, that the arrays are disjointed, that the operations done on them are pure or not pure, that the operations are not pure but determined only by a small window in the arrays, and so on and on. And then the compiler has to optimize the code according to the presence of SIMD registers, multi-cores, etc. This maybe is not enough for max performance applications, but in most situations it's plenty enough. (Incidentally, this is a lot what the Chapel language does (and D doesn't), and what I have explained in two past posts about Chapel, that were mostly ignored.)

Bye,
bearophile


More information about the Digitalmars-d mailing list