[4Walter&Andrei] D is 40 times slower. We need a new language feature!

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Fri May 19 20:50:31 PDT 2017


On 20/05/2017 4:24 AM, 9il wrote:
snip
> Looks like Rust macro system can do something similar.

Just to confirm, in Rust is it calling a function to assign the value?

E.g.
```D
void opIndexAssign(T v, size_t j, size_t i);
```

Because if the compiler is seeing a function call, it probably won't 
attempt this optimization, but if its seeing a direct to memory write, 
that's a different story.

Also the compiler doesn't know if ``foo[i][j]`` is equal to ``foo[i, 
j]``. So your proposed solution isn't valid.


More information about the Digitalmars-d mailing list