RFC: reference counted Throwable

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 19 21:48:32 PDT 2014


On 9/19/14, 8:13 PM, Daniel N wrote:
> On Saturday, 20 September 2014 at 02:26:49 UTC, Walter Bright wrote:
>> Good question. It's a challenge. But it has to be done, or D will
>> divide in half and both halves will fail.
>>
>>
>> We've had this discussion numerous times before - "throw the magic
>> compiler switch" and D becomes an ARC system and everything is
>> wonderful. It cannot work. ARC and GC are not equivalent.
>
> I basically agree with Walter on this one, no switch please, it's
> maintenance nightmare for library devs.

Why is it a maintenance nightmare?

> My proposal would be to permanently use ARC for Throwable, no flags.

How about other objects? Throwable is but the first step, and a good one 
to inform larger designs. We can't force RC on all objects on all 
applications.

> What does the GC bring to exceptions that makes it sufficiently
> invaluable to warrant two parallel implementations? It can't be about
> performance, since _thrown_ exceptions are already in the slow path...
> Backwards compatibility?

Conversion from Throwable to Object.


Andrei


More information about the Digitalmars-d mailing list