Thread overview
Nim - Introducing --gc:arc
Dec 26, 2019
JN
Dec 27, 2019
Walter Bright
Dec 27, 2019
user7892
Dec 27, 2019
NaN
December 26, 2019
Some folks may find it interesting, Nim is introducing a new memory management scheme:

"So ... this feature has been in development for quite some time now, Nim is getting the "one GC to rule them all". However calling it a GC doesn't do it justice, it's plain old reference counting with optimizations thanks to move semantics."

https://forum.nim-lang.org/t/5734
December 26, 2019
On Thursday, 26 December 2019 at 01:27:01 UTC, JN wrote:
> Some folks may find it interesting, Nim is introducing a new memory management scheme:

Nim suddenly got a lot more attractive. Interesting move. Still in beta?

I wonder how they deal with sharing slices of arrays across threads?
I guess one could use some kind of wrapper.
December 26, 2019
On 12/25/2019 5:27 PM, JN wrote:
> Some folks may find it interesting, Nim is introducing a new memory management scheme:
> 
> "So ... this feature has been in development for quite some time now, Nim is getting the "one GC to rule them all". However calling it a GC doesn't do it justice, it's plain old reference counting with optimizations thanks to move semantics."
> 
> https://forum.nim-lang.org/t/5734

D gave up on ARC for the time being because it was too easy to free an ARC object while retaining a live pointer to its innards (as pointed out by Timon Gehr). The solution to this is ownership/borrowing, which I am working on.
December 27, 2019
On Friday, 27 December 2019 at 02:30:32 UTC, Walter Bright wrote:
> On 12/25/2019 5:27 PM, JN wrote:
>> Some folks may find it interesting, Nim is introducing a new memory management scheme:
>> 
>> "So ... this feature has been in development for quite some time now, Nim is getting the "one GC to rule them all". However calling it a GC doesn't do it justice, it's plain old reference counting with optimizations thanks to move semantics."
>> 
>> https://forum.nim-lang.org/t/5734
>
> D gave up on ARC for the time being because it was too easy to free an ARC object while retaining a live pointer to its innards (as pointed out by Timon Gehr). The solution to this is ownership/borrowing, which I am working on.

I have the feeling that their ARC is more like if in D you'd pass the arg to the compiler and then at compile another family of template hooks from druntime would be used.

Is that the plan to in D or people will have to mix the two worlds ?
December 27, 2019
On Friday, 27 December 2019 at 02:30:32 UTC, Walter Bright wrote:
> On 12/25/2019 5:27 PM, JN wrote:
>> Some folks may find it interesting, Nim is introducing a new memory management scheme:
>> 
>> "So ... this feature has been in development for quite some time now, Nim is getting the "one GC to rule them all". However calling it a GC doesn't do it justice, it's plain old reference counting with optimizations thanks to move semantics."
>> 
>> https://forum.nim-lang.org/t/5734
>
> D gave up on ARC for the time being because it was too easy to free an ARC object while retaining a live pointer to its innards (as pointed out by Timon Gehr). The solution to this is ownership/borrowing, which I am working on.

Could you elaborate a bit more? IIRC its been said that ownership/borrowing is only for safe code? So will ARC only work in safe code too?
December 27, 2019
On Friday, 27 December 2019 at 06:27:42 UTC, user7892 wrote:
> I have the feeling that their ARC is more like if in D you'd pass the arg to the compiler and then at compile another family of template hooks from druntime would be used.

Araq said in the thread that they hope for production quality in a few months and to make ARC the default.