Truly @nogc Exceptions?

Petar Petar
Fri Sep 21 12:04:04 UTC 2018


On Friday, 21 September 2018 at 11:48:50 UTC, Nemanja Boric wrote:
> On Friday, 21 September 2018 at 10:06:06 UTC, Nemanja Boric 
> wrote:
>> On Friday, 21 September 2018 at 09:10:06 UTC, Jonathan M Davis 
>> wrote:
>>> [...]
>>
>> The @__future is fully (to a reasonable degree) implemented - 
>> and the `Throwable.message` was marked with this attribute to 
>> prevent breaking the user code when introducing this field, 
>> and it probably can just be removed from there at this point 
>> (since many releases have been released).
>>
>> [...]
>
> Interesting quote from Martin on that PR:
>
>> With regards to Throwable.message we agreed on making it one 
>> of the first users of an upcoming reference counted string. 
>> Details on the design of the reference counted string first to 
>> be discussed on dlang-study.

If in theory D had all the memory-safety features to make this 
work (think what languages like Rust have with linear/affine 
types [0] [1]) along with the necessary library implementations 
of smart pointers, RC-aware slicing, etc..., I would still prefer 
the sink-based approach in this situation, as it's much more 
elegant in my opinion.

[0]: http://wiki.c2.com/?LinearTypes
[1]: https://www.tweag.io/posts/2017-03-13-linear-types.html



More information about the Digitalmars-d mailing list