Memory safe and coroutines are the focus of D.

jmh530 john.michael.hall at gmail.com
Mon Oct 17 14:51:09 UTC 2022


On Sunday, 16 October 2022 at 23:28:15 UTC, rassoc wrote:
> On 10/17/22 00:07, Per Nordlöw via Digitalmars-d wrote:
>> Can you give elaborate or give references on the topic of 
>> using managed pointers that do ARC?
>
> Aside from Swift, you might also want to check out Nim. They 
> have tracing (ref) and untracing (ptr) pointers and recently 
> made the jump to ARC/ORC by utilizing destructors and move 
> semantic optimization which allows them to avoid certain RC 
> downsides. But I'm clueless about what impact that had in the 
> Nim world, I did not follow it closely.
>
> [1] 
> https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
> [2] https://nim-lang.org/docs/destructors.html
> [3] https://zevv.nl/nim-memory/

Walter's argument against this has been that it forces the user 
to write multiple copies of the function to support both pointer 
types. Even if you have a templated version to handle it, you 
would still have two copies.

You would need some kind of type erasure, similar to inout (not 
that inout pulls its weight), and I'm sure there would be a lot 
of complications associated with it.


More information about the Digitalmars-d mailing list