digitalmars.D.learn - what is the aftermath of dip74
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (2/2) May 10 2023 Do we have any implementation of ref-counted class instances? İf
- Richard (Rikki) Andrew Cattermole (7/7) May 10 2023 We do not, no.
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (4/12) May 10 2023 Thank you Rikki for the clarification. I think d need this
- Richard (Rikki) Andrew Cattermole (5/7) May 10 2023 Yeah we do.
Do we have any implementation of ref-counted class instances? İf not why?
May 10 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 10 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.
May 10 2023