www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Blog post on fearless (library for safe sharing)

reply Atila Neves <atila.neves gmail.com> writes:
https://www.reddit.com/r/programming/comments/9uoak1/implementing_rusts_stdsyncmutex_in_d/

Somewhere on hacker news too, but you know how that goes.
Nov 06
parent reply Dukc <ajieskola gmail.com> writes:
On Tuesday, 6 November 2018 at 16:20:00 UTC, Atila Neves wrote:
 https://www.reddit.com/r/programming/comments/9uoak1/implementing_rusts_stdsyncmutex_in_d/
Good post. Since you have battle-tested DIP1000, I'm interested what you think about it. You mentioned that it's currently hard to understand, but what you think about the concept as whole? How useful it seems, and is it worth it?
Nov 07
parent reply Atila Neves <atila.neves gmail.com> writes:
On Wednesday, 7 November 2018 at 10:16:43 UTC, Dukc wrote:
 On Tuesday, 6 November 2018 at 16:20:00 UTC, Atila Neves wrote:
 https://www.reddit.com/r/programming/comments/9uoak1/implementing_rusts_stdsyncmutex_in_d/
Good post. Since you have battle-tested DIP1000, I'm interested what you think about it. You mentioned that it's currently hard to understand, but what you think about the concept as whole? How useful it seems, and is it worth it?
Definitely worth it. I think editing the DIP1000 document to make it reflect reality would be a good start. I kept using `scope` where I should have used `return` and that's really what confused me. I'm still unclear on the non-transitivity of scope and exactly what the consequences of this rule: 3. A scope variable cannot be initialized with the address of a scope variable. (If it did it would lose the scope attribute of the latter's contents.)
Nov 07
parent Dukc <ajieskola gmail.com> writes:
On Wednesday, 7 November 2018 at 10:58:35 UTC, Atila Neves wrote:
 Definitely worth it.
Nice to hear. And nice that you put it to use!
 I'm still unclear on the non-transitivity of scope and exactly 
 what the consequences of this rule:

 3. A scope variable cannot be initialized with the address of a 
 scope variable. (If it did it would lose the scope attribute of 
 the latter's contents.)
I can neither undertand that. If you initialize a scope variable, it should be guaranteed to have a shorter lifetime than any pre-existing variable, so it should not be a problem to use pre-existing addresses (as I understand it).
Nov 07