Thread overview
what is the aftermath of dip74
May 10, 2023
Ferhat Kurtulmuş
May 10, 2023
Ferhat Kurtulmuş
May 10, 2023

Do we have any implementation of ref-counted class instances? İf not why?

May 11, 2023
We do not, no.

Reference counting is not currently in the language, although you can fake it with structs.

Its a huge shame, but it should be added at some point because the compiler would tell the backend that it is possible to elide pair calls.

However it'll have to wait for the DIP queue to reopen (slight process adjustment to make things easier is incoming).
May 10, 2023
On Wednesday, 10 May 2023 at 18:15:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
> We do not, no.
>
> Reference counting is not currently in the language, although you can fake it with structs.
>
> Its a huge shame, but it should be added at some point because the compiler would tell the backend that it is possible to elide pair calls.
>
> However it'll have to wait for the DIP queue to reopen (slight process adjustment to make things easier is incoming).

Thank you Rikki for the clarification. I think d need this without ugly workarounds.
May 11, 2023
On 11/05/2023 6:23 AM, Ferhat Kurtulmuş wrote:
> Thank you Rikki for the clarification. I think d need this without ugly workarounds.

Yeah we do.

Reference counting is expensive, and modern backends have the capability to elide pairs of calls. So this would be a massive improvement just from the perspective of performance alone.