Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 10, 2016 DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org The first DIP has just landed into the new queue. It is a proposal from language authors and thus it bypasses usual nitpicking process and proceeds straight to requesting community (your!) feedback. Essentially, it is an attempt to solve reference lifetime problem by extending implementation of `scope` keyword. Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md Few notes: - Please submit pull requests to adjust the markdown document if you want to propose any improvements (mentioning @WalterBright and @andralex for confirmation). - The proposal refers to a number of other documents and it is recommended to become familiar at least briefly with all of them. - At this point the question I'd personally suggest to be evaluated is "does this proposal enable enough useful designs?". A good check would be to try taking some of your projects and see if having DIP1000 approved and implemented could improve them. |
August 10, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote:
> http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org
>
> - Please submit pull requests to adjust the markdown document if you want to propose any improvements (mentioning @WalterBright and @andralex for confirmation).
Personally I wouldn't recommend directly submitting pull requests for improvement suggestions. Keep those in the forum/git discussions (maybe open an RFC issue on GitHub?) with the pull requests only after enough people have commented on the suggestions.
(I just don't want to have to follow several PR threads for every single improvement suggestion to every DIP in its final comment period.)
|
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote: > http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org > > The first DIP has just landed into the new queue. It is a proposal from language authors and thus it bypasses usual nitpicking process and proceeds straight to requesting community (your!) feedback. > > Essentially, it is an attempt to solve reference lifetime problem by extending implementation of `scope` keyword. > > Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md > > Few notes: > > - Please submit pull requests to adjust the markdown document if you want to propose any improvements (mentioning @WalterBright and @andralex for confirmation). > - The proposal refers to a number of other documents and it is recommended to become familiar at least briefly with all of them. > - At this point the question I'd personally suggest to be evaluated is "does this proposal enable enough useful designs?". A good check would be to try taking some of your projects and see if having DIP1000 approved and implemented could improve them. @Walter What's current support in the master DMD branch for this DIP and what remains to be done? I know that some support was added in between the various @safe-ty fixes during July and August: https://github.com/dlang/dmd/pulls?q=is%3Apr+author%3AWalterBright+created%3A"2016-06-07+..+2016-07-25"+sort%3Acreated-asc but I can't tell what's the overall progress. BTW, great work fixing all those @safe-ty holes! The amount bugs you've managed to fix during this period is amazing! |
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to ZombineDev | On Thursday, 11 August 2016 at 07:13:34 UTC, ZombineDev wrote: > On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote: >> http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org >> >> The first DIP has just landed into the new queue. It is a proposal from language authors and thus it bypasses usual nitpicking process and proceeds straight to requesting community (your!) feedback. >> >> Essentially, it is an attempt to solve reference lifetime problem by extending implementation of `scope` keyword. >> >> Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md >> >> Few notes: >> >> - Please submit pull requests to adjust the markdown document if you want to propose any improvements (mentioning @WalterBright and @andralex for confirmation). >> - The proposal refers to a number of other documents and it is recommended to become familiar at least briefly with all of them. >> - At this point the question I'd personally suggest to be evaluated is "does this proposal enable enough useful designs?". A good check would be to try taking some of your projects and see if having DIP1000 approved and implemented could improve them. > > @Walter > > What's current support in the master DMD branch for this DIP and what remains to be done? I know that some support was added in between the various @safe-ty fixes during July and August: > https://github.com/dlang/dmd/pulls?q=is%3Apr+author%3AWalterBright+created%3A"2016-06-07+..+2016-07-25"+sort%3Acreated-asc but I can't tell what's the overall progress. > > BTW, great work fixing all those @safe-ty holes! The amount bugs you've managed to fix during this period is amazing! For some strange reason, the link doesn't work in the web interface. Here is it again: https://git.io/v64sj |
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to ZombineDev | On 8/11/2016 12:13 AM, ZombineDev wrote: > What's current support in the master DMD branch for this DIP and what remains to > be done? The current support has been stalled for 17 days now. https://github.com/dlang/dmd/pull/5972 > I know that some support was added in between the various @safe-ty > fixes during July and August: > https://github.com/dlang/dmd/pulls?q=is%3Apr+author%3AWalterBright+created%3A"2016-06-07+..+2016-07-25"+sort%3Acreated-asc > but I can't tell what's the overall progress. Those are more reasonably considered bug fixes rather than 'return scope' which is the key feature of the DIP. > BTW, great work fixing all those @safe-ty holes! The amount bugs you've managed > to fix during this period is amazing! Actually, it's been quite fun and satisfying. I want to finish it! |
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 10/08/16 22:36, Dicebot wrote: > http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org > > The first DIP has just landed into the new queue. It is a proposal from > language authors and thus it bypasses usual nitpicking process and > proceeds straight to requesting community (your!) feedback. > > Essentially, it is an attempt to solve reference lifetime problem by > extending implementation of `scope` keyword. > > Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md DIP 1_000? Is this the one DIP to rule them all, making all the 900 DIPs or so you skipped over not necessary :) -- /Jacob Carlborg |
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote:
> Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md
Can someone talk me through the lifetime algebra for the following?
void foo()
{
int a;
int** c;
void bar()
{
int* b = &a;
c = &b;
}
bar();
*c; //undefined behaviour
}
I think it's this:
lifetime(a) = all of foo
lifetime(c) = infinite (because null) //initially
lifetime(b) = lifetime(&a) = lifetime(a) = all of foo // ????
lifetime(c) = lifetime(&b) = lifetime(b) = all of foo //on assignment in bar
That would suggest that dereferencing c was OK, because the lifetime is all of foo. What am I missing?
|
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Thursday, 11 August 2016 at 08:07:08 UTC, Jacob Carlborg wrote: > On 10/08/16 22:36, Dicebot wrote: >> http://forum.dlang.org/post/pqsiqmkxenrwxoruzaml@forum.dlang.org >> >> The first DIP has just landed into the new queue. It is a proposal from >> language authors and thus it bypasses usual nitpicking process and >> proceeds straight to requesting community (your!) feedback. >> >> Essentially, it is an attempt to solve reference lifetime problem by >> extending implementation of `scope` keyword. >> >> Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md > > DIP 1_000? Is this the one DIP to rule them all, making all the 900 DIPs or so you skipped over not necessary :) Probably :D, though it was the first available (See https://github.com/dlang/DIPs/blame/master/README.md#L27 for more info). Maybe one of the other two DIPs should have taken 1000, but I think it's nice coincidence, considering the implications of DIP1000 ;) |
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Colvin | On 8/11/2016 1:29 AM, John Colvin wrote:
> Can someone talk me through the lifetime algebra for the following?
>
> void foo()
> {
> int a;
> int** c;
> void bar()
> {
> int* b = &a; <= ok, b has a smaller lifetime than a
> c = &b; <= error, c has a larger lifetime than b
> }
> bar();
> *c; //undefined behaviour
> }
|
August 11, 2016 Re: DIP1000: Scoped Pointers (Discussion) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 11 August 2016 at 08:45:38 UTC, Walter Bright wrote:
> On 8/11/2016 1:29 AM, John Colvin wrote:
>> Can someone talk me through the lifetime algebra for the following?
>>
>> void foo()
>> {
>> int a;
>> int** c;
>> void bar()
>> {
>> int* b = &a; <= ok, b has a smaller lifetime than a
>> c = &b; <= error, c has a larger lifetime than b
>> }
>> bar();
>> *c; //undefined behaviour
>> }
but according to this rule:
"For an unrestricted pointer, visibility is dictated by the usual lexical scope rules. Lifetime, however is dictated by the lifetime of the data to which the pointer points to."
b should have the same lifetime as a, no?
|
Copyright © 1999-2021 by the D Language Foundation