RFC: scope and borrowing

Manu via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 26 04:47:30 PDT 2014


On 24 August 2014 23:14, via Digitalmars-d <digitalmars-d at puremagic.com>
wrote:

> 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:
>
> http://wiki.dlang.org/User:Schuetzm/scope
>
> 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:
>
> * Is this the general direction we want to go? Is it acceptable in general?
> * Is the proposal internally consistent?
> * How big would the effort to implement it be? (I suspect it's a large
> amount of work, but relatively straightforward.)
>
> [1] http://forum.dlang.org/thread/lphnen$1ml7$1@digitalmars.com
>

This is the initiative I've been dreaming of for years!
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! :)
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.

This direction really opens up the language to support manual and
user-defined memory management at a much deeper and more useful level.
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140826/6f8bf639/attachment-0001.html>


More information about the Digitalmars-d mailing list