www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Is [] mandatory for array operations?

reply bearophile <bearophileHUGS lycos.com> writes:
Johan Granberg:
 I think it is an
 acceptable tradeof that the people that need optimal speed write there code
 in a more uncompressed formm using manual loops or wathewer. Then the cases
 not on the criitical path of the program can be written more compactly
 using a slightly slower but much faster to write style.

In this specific case the compiler must become smarter and able to optimize away the performance loss. Otherwise it's a failed language and a failed compiler. Bye, bearophile
May 08 2010
parent Don <nospam nospam.com> writes:
bearophile wrote:
 Johan Granberg:
 I think it is an
 acceptable tradeof that the people that need optimal speed write there code
 in a more uncompressed formm using manual loops or wathewer. Then the cases
 not on the criitical path of the program can be written more compactly
 using a slightly slower but much faster to write style.

In this specific case the compiler must become smarter and able to optimize away the performance loss. Otherwise it's a failed language and a failed compiler.

Exactly. Array operations must be optimally fast (faster than a manual loop, in general), or else refuse to compile. They are not syntax sugar.
May 08 2010