Caching results manually is very tedious work, and makes a mess of your code.. If you've had to do that yourself you'd understand how annoying it can be.<div>Placing restrict on sensible pointers is much cleaner and saves a lot of time, and also results in optimisation everywhere it is used, rather than just the 1-2 places that you happened to notice it was a problem...<br>
<br><div class="gmail_quote">On 20 October 2011 05:25, Robert Jacques <span dir="ltr"><<a href="mailto:sandford@jhu.edu">sandford@jhu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, 19 Oct 2011 17:10:55 -0400, Peter Alexander <<a href="mailto:peter.alexander.au@gmail.com" target="_blank">peter.alexander.au@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 19/10/11 3:08 PM, Robert Jacques wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 19 Oct 2011 07:58:15 -0400, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I agree, that is certainly more important :)<br>
<br>
I'm mainly just curious to know about how the main contributors feel<br>
about<br>
these things, and whether these things will be implemented/planned, or if<br>
they violate some fundamental language principles...<br>
Basically, I really want to start some major work in D, but before<br>
investing<br>
into the language, I want to know that important features are<br>
recognised and<br>
have a long term plan...<br>
</blockquote>
<br>
Well, __restrict was mainly added to C (IIRC), to allow loop<br>
vectorization. In D, we have explicit array operations, which carry a<br>
lot of the same caveats as __restrict, except are checkable.<br>
</blockquote>
<br>
It's for far more than vectorization. Any place that has redundant loads<br>
can benefit from __restrict.<br>
<br>
I recommend this presentation on the subject:<br>
<a href="http://www.slideshare.net/guest3eed30/memory-optimization" target="_blank">http://www.slideshare.net/<u></u>guest3eed30/memory-<u></u>optimization</a><br>
<br>
It's about memory optimizations. Aliasing issues start at slide 35.<br>
<br>
</blockquote>
<br></div></div>
Thanks. I've seen most of that before. And even in those slide, the major (though not only) use-case for __restrict is with array and matrix processing. Most other use-cases can be cached manually or are really, really unsafe.<br>

</blockquote></div><br></div>