Jump to page: 1 240  
Page
Thread overview
More radical ideas about gc and reference counting
Apr 30, 2014
Vladimir Panteleev
Apr 30, 2014
Vladimir Panteleev
Apr 30, 2014
Vladimir Panteleev
Apr 30, 2014
Timon Gehr
May 01, 2014
Jonathan M Davis
Apr 30, 2014
monarch_dodra
Apr 30, 2014
deadalnix
Apr 30, 2014
deadalnix
May 01, 2014
Walter Bright
May 01, 2014
deadalnix
May 01, 2014
Walter Bright
May 02, 2014
deadalnix
May 01, 2014
bearophile
May 01, 2014
Walter Bright
Apr 30, 2014
deadalnix
Apr 30, 2014
John Colvin
Apr 30, 2014
John Colvin
Apr 30, 2014
deadalnix
Apr 30, 2014
deadalnix
Apr 30, 2014
froglegs
Apr 30, 2014
Brad Anderson
Apr 30, 2014
bearophile
Apr 30, 2014
deadalnix
May 01, 2014
John Colvin
May 01, 2014
Michel Fortin
Apr 30, 2014
Timon Gehr
Apr 30, 2014
Timon Gehr
Apr 30, 2014
Timon Gehr
Apr 30, 2014
deadalnix
May 01, 2014
Timon Gehr
Apr 30, 2014
Timon Gehr
Apr 30, 2014
Timon Gehr
Apr 30, 2014
H. S. Teoh
Apr 30, 2014
sclytrack
Apr 30, 2014
H. S. Teoh
Apr 30, 2014
fra
Apr 30, 2014
H. S. Teoh
May 01, 2014
Walter Bright
May 02, 2014
H. S. Teoh
May 01, 2014
monarch_dodra
May 01, 2014
H. S. Teoh
May 03, 2014
Walter Bright
May 04, 2014
Nick Sabalausky
May 04, 2014
Jonathan M Davis
May 04, 2014
Jonathan M Davis
May 01, 2014
monarch_dodra
May 01, 2014
Jesse Phillips
May 01, 2014
bearophile
May 01, 2014
Jonathan M Davis
May 01, 2014
ponce
May 01, 2014
w0rp
May 01, 2014
H. S. Teoh
May 01, 2014
Marc Schütz
May 03, 2014
Benjamin Thaut
May 03, 2014
Michel Fortin
May 04, 2014
Marc Schütz
May 04, 2014
Michel Fortin
May 06, 2014
Manu
May 01, 2014
Nordlöw
May 01, 2014
H. S. Teoh
May 01, 2014
H. S. Teoh
May 02, 2014
deadalnix
May 03, 2014
w0rp
May 02, 2014
ed
May 02, 2014
Paolo Invernizzi
May 03, 2014
Paolo Invernizzi
May 01, 2014
Nordlöw
May 02, 2014
deadalnix
May 01, 2014
Nordlöw
May 02, 2014
fra
May 02, 2014
monarch_dodra
May 03, 2014
deadalnix
May 03, 2014
Benjamin Thaut
May 03, 2014
froglegs
May 03, 2014
Paulo Pinto
May 03, 2014
H. S. Teoh
May 04, 2014
Caligo
May 05, 2014
Caligo
May 05, 2014
Caligo
May 06, 2014
Manu
May 06, 2014
Manu
May 06, 2014
Wyatt
May 06, 2014
Manu
May 06, 2014
John Colvin
May 06, 2014
Dicebot
May 06, 2014
Manu
May 06, 2014
John Colvin
May 06, 2014
w0rp
May 06, 2014
Paulo Pinto
May 07, 2014
Manu
May 06, 2014
Dicebot
May 07, 2014
Jacob Carlborg
May 06, 2014
ponce
May 06, 2014
Manu
May 06, 2014
John Colvin
May 06, 2014
Wyatt
May 06, 2014
Meta
May 06, 2014
Meta
May 07, 2014
Paulo Pinto
May 07, 2014
Paulo Pinto
May 11, 2014
Marco Leise
May 06, 2014
Walter Bright
May 09, 2014
luka8088
May 06, 2014
Manu
May 06, 2014
Walter Bright
May 06, 2014
w0rp
May 06, 2014
Walter Bright
May 06, 2014
Jacob Carlborg
May 07, 2014
Manu
May 07, 2014
Jacob Carlborg
May 05, 2014
Paolo Invernizzi
May 04, 2014
H. S. Teoh
May 05, 2014
Arlen
May 05, 2014
H. S. Teoh
May 05, 2014
Dmitry Olshansky
May 05, 2014
bearophile
May 05, 2014
H. S. Teoh
May 05, 2014
Marco Leise
May 05, 2014
Dicebot
May 06, 2014
Marco Leise
May 06, 2014
HaraldZealot
May 05, 2014
Jacob Carlborg
May 06, 2014
Manu
May 06, 2014
HaraldZealot
May 06, 2014
Manu
May 06, 2014
Xavier Bigand
May 06, 2014
HaraldZealot
May 06, 2014
Jacob Carlborg
May 06, 2014
HaraldZealot
May 06, 2014
Manu
May 06, 2014
Paulo Pinto
May 06, 2014
Manu
May 06, 2014
Paulo Pinto
May 06, 2014
Michel Fortin
May 06, 2014
Manu
May 06, 2014
Xavier Bigand
May 06, 2014
Xavier Bigand
May 06, 2014
Xavier Bigand
May 07, 2014
Manu
May 07, 2014
Paulo Pinto
May 07, 2014
Xavier Bigand
May 08, 2014
Paulo Pinto
May 09, 2014
Manu
May 09, 2014
Wyatt
May 10, 2014
Xavier Bigand
May 10, 2014
Manu
May 10, 2014
Xavier Bigand
May 10, 2014
Manu
May 10, 2014
Paulo Pinto
May 10, 2014
Paolo Invernizzi
May 10, 2014
Xavier Bigand
May 10, 2014
Manu
May 10, 2014
Paulo Pinto
May 10, 2014
Manu
May 10, 2014
Xavier Bigand
Nov 28, 2018
luckoverthere
May 10, 2014
Manu
May 10, 2014
Paulo Pinto
May 10, 2014
w0rp
May 10, 2014
Nick B
May 10, 2014
Manu
May 10, 2014
Dicebot
May 10, 2014
Peter Alexander
May 10, 2014
Manu
May 10, 2014
Peter Alexander
May 10, 2014
Manu
May 10, 2014
Walter Bright
May 11, 2014
Manu
May 11, 2014
Walter Bright
May 11, 2014
Manu
May 11, 2014
Walter Bright
May 11, 2014
Michel Fortin
May 11, 2014
w0rp
May 11, 2014
Walter Bright
May 11, 2014
Walter Bright
May 11, 2014
Michel Fortin
May 11, 2014
Walter Bright
May 12, 2014
Michel Fortin
May 12, 2014
Walter Bright
May 12, 2014
Marco Leise
May 12, 2014
Walter Bright
May 12, 2014
Marco Leise
May 12, 2014
Walter Bright
May 11, 2014
Timon Gehr
May 11, 2014
Walter Bright
May 11, 2014
Timon Gehr
May 12, 2014
Walter Bright
May 12, 2014
Marco Leise
May 12, 2014
Walter Bright
May 12, 2014
bearophile
May 12, 2014
Marco Leise
May 12, 2014
Timon Gehr
May 12, 2014
Walter Bright
May 12, 2014
Timon Gehr
May 12, 2014
Walter Bright
May 12, 2014
Manu
May 12, 2014
Dicebot
May 12, 2014
Manu
May 12, 2014
Walter Bright
May 12, 2014
John Colvin
May 12, 2014
Dicebot
May 12, 2014
Walter Bright
May 12, 2014
Dicebot
May 12, 2014
Walter Bright
May 12, 2014
Paulo Pinto
May 12, 2014
Marco Leise
May 12, 2014
John Colvin
May 12, 2014
Manu
May 12, 2014
bearophile
May 12, 2014
Manu
May 12, 2014
Dicebot
May 12, 2014
Manu
May 12, 2014
Jacob Carlborg
May 13, 2014
Dicebot
May 13, 2014
Timon Gehr
May 13, 2014
Jacob Carlborg
May 13, 2014
Timon Gehr
May 14, 2014
Tommi
May 14, 2014
Dicebot
May 14, 2014
Dmitry Olshansky
May 15, 2014
Jacob Carlborg
May 15, 2014
Dicebot
May 12, 2014
Xavier Bigand
May 13, 2014
Walter Bright
May 12, 2014
Kapps
May 12, 2014
Manu
May 12, 2014
Kapps
May 12, 2014
Tommi
May 12, 2014
Tommi
May 12, 2014
Timon Gehr
May 12, 2014
bearophile
May 12, 2014
Walter Bright
May 12, 2014
bearophile
May 12, 2014
Walter Bright
May 12, 2014
bearophile
May 14, 2014
bearophile
May 12, 2014
Dmitry Olshansky
May 12, 2014
bearophile
May 12, 2014
bearophile
May 12, 2014
Manu
May 12, 2014
Walter Bright
May 12, 2014
Manu
May 11, 2014
Manu
May 10, 2014
Manu
May 11, 2014
Manu
May 11, 2014
Benjamin Thaut
May 11, 2014
Walter Bright
May 11, 2014
Benjamin Thaut
May 11, 2014
Walter Bright
May 11, 2014
Rainer Schuetze
May 11, 2014
Walter Bright
May 12, 2014
Rainer Schuetze
May 12, 2014
Walter Bright
May 12, 2014
Walter Bright
May 11, 2014
Walter Bright
May 11, 2014
ponce
May 11, 2014
sclytrack
May 11, 2014
ponce
May 12, 2014
ponce
May 12, 2014
ponce
May 11, 2014
Paulo Pinto
May 12, 2014
Tommi
May 11, 2014
Rainer Schuetze
May 11, 2014
John Colvin
May 11, 2014
Rainer Schuetze
May 11, 2014
Dmitry Olshansky
May 11, 2014
Walter Bright
May 11, 2014
Walter Bright
May 12, 2014
Marc Schütz
May 13, 2014
Rainer Schuetze
May 13, 2014
Marc Schütz
May 13, 2014
Rainer Schuetze
May 14, 2014
Marc Schütz
May 16, 2014
Rainer Schuetze
May 17, 2014
Marc Schütz
May 17, 2014
Jerry
May 13, 2014
Wyatt
May 13, 2014
Rainer Schuetze
May 14, 2014
Wyatt
May 14, 2014
Timon Gehr
May 12, 2014
Martin Nowak
May 13, 2014
Rainer Schuetze
May 13, 2014
Daniel Murphy
May 13, 2014
Marc Schütz
May 10, 2014
Mike Parker
May 07, 2014
Paulo Pinto
May 06, 2014
Xavier Bigand
May 06, 2014
Xavier Bigand
May 06, 2014
Marc Schütz
May 06, 2014
John Colvin
May 06, 2014
HaraldZealot
May 06, 2014
HaraldZealot
May 06, 2014
Jacob Carlborg
May 06, 2014
Manu
May 06, 2014
Paulo Pinto
May 06, 2014
bearophile
May 06, 2014
Paulo Pinto
May 06, 2014
Manu
May 11, 2014
Benjamin Thaut
May 11, 2014
Manu
May 11, 2014
Marc Schütz
May 11, 2014
w0rp
May 11, 2014
Paulo Pinto
May 11, 2014
John Colvin
May 05, 2014
Dicebot
April 30, 2014
Walter and I have had a long chat in which we figured our current offering of abstractions could be improved. Here are some thoughts. There's a lot of work ahead of us on that and I wanted to make sure we're getting full community buy-in and backup.

First off, we're considering eliminating destructor calls from within the GC entirely. It makes for a faster and better GC, but the real reason here is that destructors are philosophically bankrupt in a GC environment. I think there's no need to argue that in this community. The GC never guarantees calling destructors even today, so this decision would be just a point in the definition space (albeit an extreme one).

That means classes that need cleanup (either directly or by having fields that are structs with destructors) would need to garner that by other means, such as reference counting or manual. We're considering deprecating ~this() for classes in the future.

Also, we're considering a revamp of built-in slices, as follows. Slices of types without destructors stay as they are.

Slices T[] of structs with destructors shall be silently lowered into RCSlice!T, defined inside object.d. That type would occupy THREE words, one of which being a pointer to a reference count. That type would redefine all slice primitives to update the reference count accordingly.

RCSlice!T will not convert implicitly to void[]. Explicit cast(void[]) will be allowed, and will ignore the reference count (so if a void[] extracted from a T[] via a cast outlives all slices, dangling pointers will ensue).

I foresee any number of theoretical and practical issues with this approach. Let's discuss some of them here.


Thanks,

Andrei
April 30, 2014
On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu wrote:
> Walter and I have had a long chat in which we figured our current offering of abstractions could be improved. Here are some thoughts. There's a lot of work ahead of us on that and I wanted to make sure we're getting full community buy-in and backup.
>
> First off, we're considering eliminating destructor calls from within the GC entirely. It makes for a faster and better GC, but the real reason here is that destructors are philosophically bankrupt in a GC environment. I think there's no need to argue that in this community. The GC never guarantees calling destructors even today, so this decision would be just a point in the definition space (albeit an extreme one).

An extreme one indeed, it would break a lot of my code. Every D project I wrote that does networking manages memory using a class that resides on the managed heap, but holds the actual wrapped data in the unmanaged heap. It has a number of advantages over other approaches, and I've posted it to the announce group, but the idea didn't seem to catch on.

https://github.com/CyberShadow/ae/blob/master/sys/data.d

I could migrate the concept to use reference counting (it was implemented in D1, before reference counting was possible), but that's my situation regarding breaking existing code.
April 30, 2014
On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu wrote:
> We're considering deprecating ~this() for classes in the future.
>
> [...]
>
> Slices T[] of structs with destructors shall be silently lowered into RCSlice!T, defined inside object.d

I'm sure instead of outright deprecating destructor for class, we could just store them in a RCClass!C (which would be 2 words big).

If you can get the scheme working with slices of structs with destructors, I don't see why the same scheme couldn't work with Class'es too.
April 30, 2014
On 4/30/14, 1:31 PM, Vladimir Panteleev wrote:
> On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu wrote:
>> Walter and I have had a long chat in which we figured our current
>> offering of abstractions could be improved. Here are some thoughts.
>> There's a lot of work ahead of us on that and I wanted to make sure
>> we're getting full community buy-in and backup.
>>
>> First off, we're considering eliminating destructor calls from within
>> the GC entirely. It makes for a faster and better GC, but the real
>> reason here is that destructors are philosophically bankrupt in a GC
>> environment. I think there's no need to argue that in this community.
>> The GC never guarantees calling destructors even today, so this
>> decision would be just a point in the definition space (albeit an
>> extreme one).
>
> An extreme one indeed, it would break a lot of my code. Every D project
> I wrote that does networking manages memory using a class that resides
> on the managed heap, but holds the actual wrapped data in the unmanaged
> heap.

So should I take it those classes all have destructors? -- Andrei
April 30, 2014
On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu wrote:
> Walter and I have had a long chat in which we figured our current offering of abstractions could be improved. Here are some thoughts. There's a lot of work ahead of us on that and I wanted to make sure we're getting full community buy-in and backup.
>

Still no consideration for isolated.

> First off, we're considering eliminating destructor calls from within the GC entirely. It makes for a faster and better GC, but the real reason here is that destructors are philosophically bankrupt in a GC environment. I think there's no need to argue that in this community. The GC never guarantees calling destructors even today, so this decision would be just a point in the definition space (albeit an extreme one).
>
> That means classes that need cleanup (either directly or by having fields that are structs with destructors) would need to garner that by other means, such as reference counting or manual. We're considering deprecating ~this() for classes in the future.
>

Not sure how I feel about that. This has been proposed as a solution to some GC issue at last DConf and has been dismissed. Your post is unclear on why this decision has changed. There must be some new information or data that inform this decision.

Or is it random ?

Also, what about cycle in RC things ? Also, RC is good on top of GC, so you can collect loop, especially if we are going to RC automagically. That is a major issue.

Finally, immutable is sharable accross thread. That mean, even if we bypass the type system, that RC must be atomic for immutable. As they convert automatically for co,st, that mean that all const code will be full of atomic increment/decrement. They are bad for the CPU, and cannot be optimized away.

That mean we are back to having a const and a mutable version of functions for performance reasons.

> Also, we're considering a revamp of built-in slices, as follows. Slices of types without destructors stay as they are.
>
> Slices T[] of structs with destructors shall be silently lowered into RCSlice!T, defined inside object.d. That type would occupy THREE words, one of which being a pointer to a reference count. That type would redefine all slice primitives to update the reference count accordingly.
>
> RCSlice!T will not convert implicitly to void[]. Explicit cast(void[]) will be allowed, and will ignore the reference count (so if a void[] extracted from a T[] via a cast outlives all slices, dangling pointers will ensue).
>

This won't work. array have a lot of magic that cannot be created as library. ie:

RCSlice!(const T) has nothing to do with const(RCSlice!T) as far as the compiler is concerned.

This is why we still don't have any library that provides collection properly. One of the best is probably dcollection, and it has no solution for that problem.

I'd like to see some core issue like that one before changing everything on top of it. When the whole thing is built on goo, readjusting the top to make it point upward is doomed to create the Pisa tower. Fine for tourists, but not very practical nor useful.
April 30, 2014
On 4/30/14, 1:33 PM, monarch_dodra wrote:
> On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu wrote:
>> We're considering deprecating ~this() for classes in the future.
>>
>> [...]
>>
>> Slices T[] of structs with destructors shall be silently lowered into
>> RCSlice!T, defined inside object.d
>
> I'm sure instead of outright deprecating destructor for class, we could
> just store them in a RCClass!C (which would be 2 words big).

That's an interesting idea, but the whole notion of converting to Object etc. makes the concept difficult (unless we define another root etc).

Andrei

April 30, 2014
On 4/30/14, 1:46 PM, deadalnix wrote:
> Still no consideration for isolated.

https://github.com/D-Programming-Language/dmd/pull/3452 may be of interest to you. -- Andrei
April 30, 2014
On 04/30/2014 10:21 PM, Andrei Alexandrescu wrote:
> Walter and I have had a long chat in which we figured our current
> offering of abstractions could be improved. Here are some thoughts.
> There's a lot of work ahead of us on that and I wanted to make sure
> we're getting full community buy-in and backup.
>
> First off, we're considering eliminating destructor calls from within
> the GC entirely. It makes for a faster and better GC, but the real
> reason here is that destructors are philosophically bankrupt in a GC
> environment. I think there's no need to argue that in this community.
> The GC never guarantees calling destructors even today, so this decision
> would be just a point in the definition space (albeit an extreme one).
>
> That means classes that need cleanup (either directly or by having
> fields that are structs with destructors) would need to garner that by
> other means, such as reference counting or manual. We're considering
> deprecating ~this() for classes in the future.
> ...

struct S{
    ~this(){ /* ... */ }
    /* ... */
}

class C{
    S s;
}

?

> Also, we're considering a revamp of built-in slices, as follows. Slices
> of types without destructors stay as they are.
>
> Slices T[] of structs with destructors shall be silently lowered into
> RCSlice!T, defined inside object.d. That type would occupy THREE words,
> one of which being a pointer to a reference count. That type would
> redefine all slice primitives to update the reference count accordingly.
>
> RCSlice!T will not convert implicitly to void[]. Explicit cast(void[])
> will be allowed, and will ignore the reference count (so if a void[]
> extracted from a T[] via a cast outlives all slices, dangling pointers
> will ensue).
>
> I foresee any number of theoretical and practical issues with this
> approach. Let's discuss some of them here.
> ...

struct S{
    ~this(){ /* ... */ }
}

class C{
    S[] s;
    this(S[] s){ /* ... */ }
}

void main(){
    new C(buildSs());
    // memory leak
}

Also, cycles.
April 30, 2014
On Wednesday, 30 April 2014 at 20:49:30 UTC, Andrei Alexandrescu wrote:
> On 4/30/14, 1:46 PM, deadalnix wrote:
>> Still no consideration for isolated.
>
> https://github.com/D-Programming-Language/dmd/pull/3452 may be of interest to you. -- Andrei

I already commented on past similar proposal. These are piling up more and more hacks to achieve roughly the same thing, badly. This makes it impossible to provide a 3rd party implementation that is compliant, is guaranteed to ends up in a nightmarish explosion of special cases, or to be vastly underpowered.
April 30, 2014
On Wednesday, 30 April 2014 at 20:45:57 UTC, Andrei Alexandrescu wrote:
>> An extreme one indeed, it would break a lot of my code. Every D project
>> I wrote that does networking manages memory using a class that resides
>> on the managed heap, but holds the actual wrapped data in the unmanaged
>> heap.
>
> So should I take it those classes all have destructors? --

One class, many instances (one for every chunk of data sent or received).
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11