<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 24 August 2014 23:14, via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">In the "Opportunities for D" thread, Walter again mentioned the topics ref counting, GC, uniqueness, and borrowing, from which a lively discussion developed [1]. I took this thread as an opportunity to write down some ideas about these topics. The result is a rather extensive proposal for the implementation of borrowing, and its implementations:<br>

<br>
<a href="http://wiki.dlang.org/User:Schuetzm/scope" target="_blank">http://wiki.dlang.org/User:<u></u>Schuetzm/scope</a><br>
<br>
This is not a real DIP, but before I put more work into formalizing it, I'd like to hear some thoughts from the languages gurus here:<br>
<br>
* Is this the general direction we want to go? Is it acceptable in general?<br>
* Is the proposal internally consistent?<br>
* How big would the effort to implement it be? (I suspect it's a large amount of work, but relatively straightforward.)<br>
<br>
[1] <a href="http://forum.dlang.org/thread/lphnen$1ml7$1@digitalmars.com" target="_blank">http://forum.dlang.org/thread/<u></u>lphnen$1ml7$1@digitalmars.com</a><br>
</blockquote></div><br></div><div class="gmail_extra">This is the initiative I've been dreaming of for years!</div><div class="gmail_extra">I'll give it a critical review when I have some time. But in the mean time at first glance, I just wanted to say, very nice work! :)</div>
<div class="gmail_extra">This is largely inline with my thoughts since I first came to D, except you flesh out a few problem areas (return scope, which we discussed at length at dconf2013), and the ideas appear to be quite sound.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">This direction really opens up the language to support manual and user-defined memory management at a much deeper and more useful level.</div><div class="gmail_extra">
In my experience, manual/custom memory management depends extensively on templates, and also implies that practically every api in any library anywhere must also receive template args, such that it can receive objects templated with custom allocation strategies.</div>
<div class="gmail_extra">D is a language that is acutely susceptible to over-templatisation and extreme template bloat. This work on scope is critically important to mitigate that tendency of D in library code.<br></div></div>