Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 04, 2014 DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
http://wiki.dlang.org/DIP69 Despite its length, this is a fairly simple proposal. It adds the missing semantics for the 'scope' storage class in order to make it possible to pass a reference to a function without it being possible for it to escape. This, among other things, makes a ref counting type practical. It also makes it more practical to use other storage allocation schemes than garbage collection. It does not make scope into a type constructor, nor a general type-annotation system. It does not provide an ownership system, though it would complement one. |
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote:
> http://wiki.dlang.org/DIP69
>
> Despite its length, this is a fairly simple proposal. It adds the missing semantics for the 'scope' storage class in order to make it possible to pass a reference to a function without it being possible for it to escape.
Making it implicit and requiring an explicit "escape" for un-scoped variables?
|
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright Attachments: | On Thu, 04 Dec 2014 01:24:13 -0800
Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> http://wiki.dlang.org/DIP69
>
> Despite its length, this is a fairly simple proposal. It adds the missing semantics for the 'scope' storage class in order to make it possible to pass a reference to a function without it being possible for it to escape.
>
> This, among other things, makes a ref counting type practical. It also makes it more practical to use other storage allocation schemes than garbage collection.
>
> It does not make scope into a type constructor, nor a general type-annotation system.
>
> It does not provide an ownership system, though it would complement one.
cosmetic issue: some comments are referring to rules by number ("Error, rule 5"), yet the rules aren't explicitly numbered. not a big deal, but still somewhat hard to follow.
|
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On 12/4/2014 1:53 AM, ketmar via Digitalmars-d wrote:
> cosmetic issue: some comments are referring to rules by number ("Error,
> rule 5"), yet the rules aren't explicitly numbered. not a big deal, but
> still somewhat hard to follow.
Yeah, still learning wiki markup!
|
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to eles | On 12/4/2014 1:51 AM, eles wrote:
> On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote:
>> http://wiki.dlang.org/DIP69
>>
>> Despite its length, this is a fairly simple proposal. It adds the missing
>> semantics for the 'scope' storage class in order to make it possible to pass a
>> reference to a function without it being possible for it to escape.
>
> Making it implicit and requiring an explicit "escape" for un-scoped variables?
>
Was afraid that would break too much code.
|
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 4 December 2014 at 10:00:37 UTC, Walter Bright wrote: > On 12/4/2014 1:51 AM, eles wrote: >> On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote: >>> http://wiki.dlang.org/DIP69 > Was afraid that would break too much code. An annotation for functions could make all variables "scope"? Similar to: int foo(int x) @scopedvars { //all declarations are implicit "scope"; use "escape" for the others } |
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to eles Attachments: | On Thu, 04 Dec 2014 10:04:07 +0000
eles via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Thursday, 4 December 2014 at 10:00:37 UTC, Walter Bright wrote:
> > On 12/4/2014 1:51 AM, eles wrote:
> >> On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote:
> >>> http://wiki.dlang.org/DIP69
>
> > Was afraid that would break too much code.
>
> An annotation for functions could make all variables "scope"?
>
> Similar to:
>
> int foo(int x) @scopedvars {
> //all declarations are implicit "scope"; use "escape" for the
> others
>
> }
please, don't steal this nice identifier! i love variables with name "escape"! stolen "body" still hurts me.
|
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | thank you for pushing on this. Lifetime last bullet point: ", but lower than any variables in higher scopes." isn't that redundant to the first bullet point? Or am I missing something? Scope affects variables according to these rules: Could you enumerate the list instead of bullet points, I can't count. Base operation: That one I don't get. I would assume this is legal as the function is not @safe. e = &c; // Error, lifetime(e's view) is ∞ and is greater than lifetime(c) |
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On Thursday, 4 December 2014 at 10:11:25 UTC, ketmar via Digitalmars-d wrote: > On Thu, 04 Dec 2014 10:04:07 +0000 > eles via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > >> On Thursday, 4 December 2014 at 10:00:37 UTC, Walter Bright wrote: >> > On 12/4/2014 1:51 AM, eles wrote: >> >> On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote: > please, don't steal this nice identifier! i love variables with name > "escape"! stolen "body" still hurts me. It was just an idea, I do not push for it. |
December 04, 2014 Re: DIP69 - Implement scope for escape proof references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 4 December 2014 at 09:25:11 UTC, Walter Bright wrote:
> http://wiki.dlang.org/DIP69
>
> Despite its length, this is a fairly simple proposal. It adds the missing semantics for the 'scope' storage class in order to make it possible to pass a reference to a function without it being possible for it to escape.
>
> This, among other things, makes a ref counting type practical. It also makes it more practical to use other storage allocation schemes than garbage collection.
>
> It does not make scope into a type constructor, nor a general type-annotation system.
>
> It does not provide an ownership system, though it would complement one.
Haven't got the time to look at this in detail right now, but if it's as good as it looks on the surface, I'm very excited to use it. Thanks for all the hard work, all involved.
|
Copyright © 1999-2021 by the D Language Foundation