Really? What if you have, for example, special matrices, not general ones? What's going to be faster, generating a matrix and then running the fastest general matrix multiplication code money can buy on it, or, even a somewhat slower code, but one that can instead use some extra invariants?
> Addidionally, the main issue in gpu kernels is not the ugliness of c itself, but the need to optimize algorithms to the hardware of the gpu, thus making the code much more verbose and ugly than the naive c code.
But that sounds like a compiler issue to be solved. And then you don't have to do it by hand, you let the machine find it out. (And I can't help but think that C is terrible for array based programming anyway. Granted, pure Lua might not be great either for the same reasons.)