OT: WWDC 2021, ARC in Swift: Basics and beyond
IGotD-
nise at nise.com
Sat Jun 12 16:56:54 UTC 2021
On Saturday, 12 June 2021 at 11:56:45 UTC, Ola Fosheim Grøstad
wrote:
>
> D is a system level language where the default pointer cast is
> equivalent to C++ reinterpret_cast. D is not a higher level
> language like Swift.
>
> I think most D programmers have no problem using good old
> reference counting. Understanding how to use weak references is
> a pretty insignificant issue compared to all the other things
> that can go wrong when using a system level language like D.
Nim doesn't use weak references but has cyclic reference
detection instead.
https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
One of the strengths of Nim is that you can just plug and play a
different GC and this also means badging the code with weak
references doesn't play well with that versatility.
Also, weak references means that we now have manual memory
management again and if not used properly then the program will
leak memory. Automatic memory management is no longer automatic
with weak pointers.
If D is going to implement ARC, then I suggest as automatic as
possible with cycle detection.
More information about the Digitalmars-d
mailing list