October 05, 2014
On Saturday, 4 October 2014 at 22:02:14 UTC, Andrei Alexandrescu wrote:
> On 10/4/14, 4:24 AM, "Marc Schütz" <schuetzm@gmx.net>" wrote:
>> On Friday, 3 October 2014 at 19:51:40 UTC, Andrei Alexandrescu wrote:
>>> On 10/3/14, 11:35 AM, Dmitry Olshansky wrote:
>>>> 01-Oct-2014 14:10, Robert burner Schadek пишет:
>>>>> lately when working on std.string I run into problems making stuff nogc
>>>>> as std.utf.decode is not nogc.
>>>>>
>>>>> https://issues.dlang.org/show_bug.cgi?id=13458
>>>>
>>>> Trivial to do. But before that somebody got to make  one of:
>>>>
>>>> a) A policy on reuse of exceptions. Literally we have easy TLS why not
>>>> put 1 copy of each possible exception there? (**ck the chaining, who
>>>> need it anyway?)
>>>> b) Make all exceptions ref-counted.
>>>>
>>>> The benefit of A is that "creating" exceptions becomes MUCH faster.
>>>
>>> This seems to be going in circles. Didn't we just agree we solve this
>>> by making exceptions reference counted? Please advise. -- Andrei
>>
>> Depends on who "we" is. There was a large discussion with several
>> alternative suggestions and no clear conclusion.
>
> I proposed in this forum that we use reference counting and there was general agreement that that would help, no killer counterargument, and no other better solution. Conclusion was pretty clear to me: we move to reference counted exceptions. -- Andrei

There was indeed agreement on reference counting (although someone suggested disallowing cycles or removing chaining altogether). But what I meant is that there was no agreement on a specific solution, and several ones were proposed, from full general compiler supported refcounting to library implementation.
October 05, 2014
On 10/5/14, 1:58 AM, "Marc Schütz" <schuetzm@gmx.net>" wrote:
> There was indeed agreement on reference counting (although someone
> suggested disallowing cycles or removing chaining altogether). But what
> I meant is that there was no agreement on a specific solution, and
> several ones were proposed, from full general compiler supported
> refcounting to library implementation.

Understood, thanks. I think there's no other way around than language support. Here's a sketch of the solution:

* Introduce interface AutoRefCounted. For practical reasons it may inherit IUnknown, though that's not material to the concept.

* AutoRefCounted and any interface or class inheriting it have the compiler insert calls to methods that increment and decrement the reference count (e.g. AddRef/Release).

* All descendants of AutoRefCounted must be descendants of it through all paths (i.e. there can be no common descendants of AutoRefCounted and either IUnknown or Object).

* After all this infra is in place, unhook Throwable from its current place and have it inherit AutoRefCounted.

* All is good and there's much rejoicing.


Andrei

1 2
Next ›   Last »