Jump to page: 1 212  
Page
Thread overview
DIP74: Reference Counted Class Objects
Feb 26, 2015
weaselcat
Feb 27, 2015
Kagamin
Feb 26, 2015
Brian Schott
Feb 27, 2015
Kagamin
Feb 27, 2015
Marc Schütz
Feb 27, 2015
David Gileadi
Feb 27, 2015
Jacob Carlborg
Feb 27, 2015
weaselcat
Feb 28, 2015
ketmar
Feb 28, 2015
deadalnix
Feb 28, 2015
Paolo Invernizzi
Feb 28, 2015
Daniel Murphy
Feb 28, 2015
Paolo Invernizzi
Feb 28, 2015
Daniel Murphy
Feb 28, 2015
Paolo Invernizzi
Feb 28, 2015
Jacob Carlborg
Feb 28, 2015
Jacob Carlborg
Feb 27, 2015
Matthias Bentrup
Feb 28, 2015
Jacob Carlborg
Feb 27, 2015
Nick Treleaven
Feb 26, 2015
Brian Schott
Feb 26, 2015
Brian Schott
Feb 26, 2015
Johannes Pfau
Feb 26, 2015
Johannes Pfau
Feb 26, 2015
Brian Schott
Feb 26, 2015
bearophile
Feb 27, 2015
deadalnix
Feb 27, 2015
deadalnix
Feb 27, 2015
ketmar
Feb 27, 2015
ketmar
Feb 27, 2015
weaselcat
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
anonymous
Feb 27, 2015
Marc Schütz
Feb 27, 2015
deadalnix
Mar 01, 2015
Walter Bright
Feb 27, 2015
ketmar
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
deadalnix
Feb 27, 2015
ketmar
Feb 27, 2015
Walter Bright
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
deadalnix
Feb 27, 2015
H. S. Teoh
Feb 27, 2015
Rikki Cattermole
Feb 27, 2015
weaselcat
Feb 27, 2015
weaselcat
Feb 27, 2015
Jacob Carlborg
Mar 01, 2015
bearophile
Mar 03, 2015
Taylor Hillegeist
Feb 27, 2015
Jacob Carlborg
Feb 27, 2015
ted
Feb 27, 2015
ted
Feb 27, 2015
deadalnix
Feb 27, 2015
Orvid King
Feb 27, 2015
Zach the Mystic
Feb 27, 2015
Michel Fortin
Feb 27, 2015
Manu
Feb 27, 2015
Manu
Mar 01, 2015
Manu
Mar 01, 2015
Manu
Mar 01, 2015
Manu
Mar 01, 2015
Manu
Mar 01, 2015
Manu
Mar 01, 2015
John Colvin
Feb 27, 2015
ponce
Mar 02, 2015
Volodymyr
Mar 03, 2015
Volodymyr
Mar 04, 2015
Volodymyr
Mar 04, 2015
Volodymyr
Mar 04, 2015
bitwise
Mar 04, 2015
bitwise
February 26, 2015
http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss.

Thanks,

Andrei
February 26, 2015
On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote:
> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss.
>
> Thanks,
>
> Andrei


So is the end game of dip25 and dip74 to not have to wrap types you intend to manage with RC like C++ but just design the classes/structs themselves around being RCed from the start?
February 26, 2015
On 2/26/15 2:01 PM, weaselcat wrote:
> On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote:
>> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and
>> discuss.
>>
>> Thanks,
>>
>> Andrei
>
>
> So is the end game of dip25 and dip74 to not have to wrap types you
> intend to manage with RC like C++ but just design the classes/structs
> themselves around being RCed from the start?

That is correct. Well as shown there are ways to design classes that work both with RC and GC. -- Andrei

February 26, 2015
On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote:
> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss.
>
> Thanks,
>
> Andrei

One of the first things that stood out to me is that "add ref" is two words and "release" is one. For the sake of symmetry, how about these:
*  opIncRef, opDecRef
*  opAcquire, opRelease

The DIP states that "Any attributes are allowed on these methods.", but later states "The complexity of this code underlies the importance of making opAddRef and especially opRelease nothrow". Should the DIP require that these two functions be marked nothrow?
February 26, 2015
On 2/26/15 2:03 PM, Brian Schott wrote:
>
> One of the first things that stood out to me is that "add ref" is two
> words and "release" is one. For the sake of symmetry, how about these:
> *  opIncRef, opDecRef
> *  opAcquire, opRelease

All - please PLEASE do not derail this into yet another debate about which names are best. -- Andrei
February 26, 2015
On 2/26/15 2:03 PM, Brian Schott wrote:
> The DIP states that "Any attributes are allowed on these methods.", but
> later states "The complexity of this code underlies the importance of
> making opAddRef and especially opRelease nothrow". Should the DIP
> require that these two functions be marked nothrow?

It's a liberty still left to user code. -- Andrei
February 26, 2015
On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote:
> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss.
>
> Thanks,
>
> Andrei

"This lowering assumes left-to-right evaluation of function parameters." -DIP 74

"The following binary expressions are evaluated in an implementation-defined order: AssignExpression, function arguments" - http://dlang.org/expression.html
February 26, 2015
On 2/26/15 2:17 PM, Brian Schott wrote:
> On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei Alexandrescu wrote:
>> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and
>> discuss.
>>
>> Thanks,
>>
>> Andrei
>
> "This lowering assumes left-to-right evaluation of function parameters."
> -DIP 74
>
> "The following binary expressions are evaluated in an
> implementation-defined order: AssignExpression, function arguments" -
> http://dlang.org/expression.html

Yah, Walter mentioned these. We need to fix them. -- Andrei
February 26, 2015
On Thursday, 26 February 2015 at 22:22:53 UTC, Andrei Alexandrescu wrote:
> Yah, Walter mentioned these. We need to fix them. -- Andrei

https://issues.dlang.org/show_bug.cgi?id=14228
February 26, 2015
Am Thu, 26 Feb 2015 13:50:55 -0800
schrieb Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org>:

> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and discuss.
> 
> Thanks,
> 
> Andrei

Looks very nice, some things to refine:

"Any attributes are allowed on these methods."
* Should @safe and @trusted by disallowed as
  "@safe code may not issue explicit calls to
   opAddRef/opRelease"?
* Probably also add a note here that the functions must be inverse and
  a note that they should be nothrow and/or final for performance.


"This DIP proposes @safe reference counted class objects (including
exceptions)"
* Unfortunately the DIP doesn't talk about exceptions ;-) Will we
  simply make Throwable a RCO?


"considers that opRelease is the inverse of opAddRef, and therefore is
at liberty to elide pairs of calls"
* Nice, but does that mean that reference-counted classes are now
  superior to reference counted structs? It would be nice if the
  compiler could also detect opRelease/opAddRef in structs. We could
  still require user code to call these manually in postblits etc but
  recognizing them would allow eliding pairs.



Also a more general question: What are the most important memory
management strategies and which are handled by DIP25+DIP74?
* GC
  Of course supported
* RC
  Supported with DIP74. I think this could also be considered as ARC.
  If not, what is missing from DIP74 compared to ARC?
* Scoped (useful for stack objects)
  Can 'return' be used to implement something which allocates a class
  on the stack and prevents escaping references? I guess a Scope
  struct allocating in place + a function returning a reference to the
  class with 'return' (+ alias this) would work?
* Owned
  Supported by the member variables lifetime = parent lifetime rule?
* Unique
  ?
* ?
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11