digitalmars.D - DIP-74 Reference Cycles
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (6/6) Jul 08 2015 I just read http://wiki.dlang.org/DIP74
- Martin Nowak (5/11) Jul 08 2015 We're currently overhauling smart ptrs, like Unique and
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (3/7) Jul 09 2015 But not everything in DIP74 can be implemented as library
- deadalnix (6/13) Jul 09 2015 The escape analysis needs to be in the compiler. Proposed DIPs do
- Brad Anderson (5/7) Jul 09 2015 I think the nice thing about the compiler aware approach is that
- deadalnix (16/23) Jul 09 2015 There are one case where it is actually useful: when refcounting
- Martin Nowak (5/10) Jul 10 2015 Right, there are a number of proposals to make a library
I just read http://wiki.dlang.org/DIP74 and I'm very excited about it :) What are the plans on making it handle RC-cycles using weak and strong references? See also: https://en.wikipedia.org/wiki/Reference_counting#Dealing_with_reference_cycles
Jul 08 2015
On Wednesday, 8 July 2015 at 11:39:27 UTC, Per Nordlöw wrote:I just read http://wiki.dlang.org/DIP74 and I'm very excited about it :) What are the plans on making it handle RC-cycles using weak and strong references? See also: https://en.wikipedia.org/wiki/Reference_counting#Dealing_with_reference_cyclesWe're currently overhauling smart ptrs, like Unique and RefCounted. Among others we'll add class support, rendering most of DIP74 superfluous.
Jul 08 2015
On Wednesday, 8 July 2015 at 21:55:49 UTC, Martin Nowak wrote:We're currently overhauling smart ptrs, like Unique and RefCounted. Among others we'll add class support, rendering most of DIP74 superfluous.But not everything in DIP74 can be implemented as library extension right?
Jul 09 2015
On Thursday, 9 July 2015 at 08:31:39 UTC, Nordlöw wrote:On Wednesday, 8 July 2015 at 21:55:49 UTC, Martin Nowak wrote:The escape analysis needs to be in the compiler. Proposed DIPs do a poor job at it as they require a bag of tricks instead of a principled approach IMO. The part where refcount is done can be done via library (and should IMO).We're currently overhauling smart ptrs, like Unique and RefCounted. Among others we'll add class support, rendering most of DIP74 superfluous.But not everything in DIP74 can be implemented as library extension right?
Jul 09 2015
On Thursday, 9 July 2015 at 08:58:22 UTC, deadalnix wrote:The part where refcount is done can be done via library (and should IMO).I think the nice thing about the compiler aware approach is that the compiler could forgo incs/decs when it knows the reference doesn't escape. I'm not sure how much this would actually aid performance in practice though.
Jul 09 2015
On Thursday, 9 July 2015 at 16:49:53 UTC, Brad Anderson wrote:On Thursday, 9 July 2015 at 08:58:22 UTC, deadalnix wrote:There are one case where it is actually useful: when refcounting shared object. For thread local object, the compiler already have the increment/decrement pair and can optimize accordingly. It can't when the refcount is shared (it always is in many languages like C++ or ObjC) because another thread could have done arbitrary thing to the refcount in the meantime. In that case it is useful, but generally, refcounting shared object have loosy perfs because of contention on the cache line containing the refcount. The other case where refcounting is bad is when it interract with exceptions. In which case, the language improvement we are talking about here do not help much, and this is why exception are not recoverable in ObjC and absent in swift. A option to make them fast again would be to not decrement the refcount on unwinding, and leak, delegating the cleanup to the GC.The part where refcount is done can be done via library (and should IMO).I think the nice thing about the compiler aware approach is that the compiler could forgo incs/decs when it knows the reference doesn't escape. I'm not sure how much this would actually aid performance in practice though.
Jul 09 2015
On Thursday, 9 July 2015 at 08:58:22 UTC, deadalnix wrote:The escape analysis needs to be in the compiler. Proposed DIPs do a poor job at it as they require a bag of tricks instead of a principled approach IMO. The part where refcount is done can be done via library (and should IMO).Right, there are a number of proposals to make a library implementation powerful enough. http://wiki.dlang.org/DIP69#Scope_Function_Returns http://wiki.dlang.org/DIP77
Jul 10 2015