December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Franklin | I have heard with regard to reference counting as is done in Python, that if two objects each have a reference to the other, that they will never be deleted, even if neither is used elsewhere in the program. Garbage collection is not supposed to have that issue, although I don't know how a garbage collector determines that there usage is just via each other and that they can be deleted. |
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tony | On Wednesday, 20 December 2017 at 17:05:41 UTC, Tony wrote: > I have heard with regard to reference counting as is done in Python, that if two objects each have a reference to the other, that they will never be deleted, even if neither is used elsewhere in the program. Garbage collection is not supposed to have that issue, although I don't know how a garbage collector determines that there usage is just via each other and that they can be deleted. Here's how PHP does it: http://php.net/manual/de/features.gc.collecting-cycles.php |
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shachar Shemesh | On 12/20/2017 03:49 AM, Shachar Shemesh wrote:
> I spend a lot of my time on D trying to work around the limitations that the GC is imposing on me, to the point where I feel like much we do here is to write our own infrastructure, because we can't use the built-in one. To be clear, the problem is a performance one here too, but the handling is completely different.
I hear you. A student of mine, Alexandru Jercaianu, is working on Blizzard, a very interesting approach to memory allocation and safety (inspired by Microsoft's Project Snowflake).
At the most fundamental level it's a memory-safe implementation of free(). That allows us to huddle D's entire infrastructure around safe deterministic memory allocation with little disruption to existing code, and simple patterns for new code. Stay tuned, we'll have a release soon.
Andrei
|
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tony | On 12/20/2017 09:05 AM, Tony wrote: > how a garbage collector determines that there usage is just via > each other and that they can be deleted. Similar to the PHP link Dgame posted, the GC looks for live objects by starting from roots (essentially, the objects on the stack and the static variables). Even if there are islands of objects referencing others in self or other islands, as long as they are not reachable from any root, they are gone. Ali |
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On 12/20/2017 01:14 AM, Paulo Pinto wrote: > from developers that learned it before C++98 and > can't care less what is being discussed on Reddit and HN. I don't blame them one bit because keeping up with C++ and learning C++ Core Guidelines is a tremendous task: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md I keep starting writing replies here about C++ Core Guidelines but I delete them after counting to ten. Not this time... :) I think it's a psychological phenomenon worthy of scientific interest how a craft with so many guidelines can still be accepted. I am baffled how otherwise wonderful and smart people can direct others to that document with a straight face, let alone market it as one of the greatest gifts to C++ programmers (cf. CppCon 2015 keynotes by Herb Sutter and Bjarne Stroustrup.) Ali |
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Wednesday, 20 December 2017 at 18:28:20 UTC, Ali Çehreli wrote:
> On 12/20/2017 01:14 AM, Paulo Pinto wrote:
>
> > from developers that learned it before C++98 and
> > can't care less what is being discussed on Reddit and HN.
>
> I don't blame them one bit because keeping up with C++ and learning C++ Core Guidelines is a tremendous task:
>
>
> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
>
> I keep starting writing replies here about C++ Core Guidelines but I delete them after counting to ten. Not this time... :)
>
> I think it's a psychological phenomenon worthy of scientific interest how a craft with so many guidelines can still be accepted. I am baffled how otherwise wonderful and smart people can direct others to that document with a straight face, let alone market it as one of the greatest gifts to C++ programmers (cf. CppCon 2015 keynotes by Herb Sutter and Bjarne Stroustrup.)
>
> Ali
Mostly because it is an easier path to get people to migrate to safer coding practices than doing a full reboot, no one wants to do a Python 2 to Python 3.
For example, on the Microsoft stack it took years before the Windows team would even consider C++ on the kernel (since Vista).
Now that it is there, and they are working to adopt more C++17 features, get rid of macros and so forth, it will take decades before they would even consider using .NET Native or any other alternative.
Similar story to the amount of investment Google, Apple, CERN, FB, Bloomberg, Goldman Sachs and many others have done in C++ during the last decade.
So for them it is easier to steal good ideas from D than to migrate to D.
|
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tony Attachments:
| On Wed, 2017-12-20 at 17:05 +0000, Tony via Digitalmars-d wrote: > I have heard with regard to reference counting as is done in Python, that if two objects each have a reference to the other, that they will never be deleted, even if neither is used elsewhere in the program. Garbage collection is not supposed to have that issue, although I don't know how a garbage collector determines that there usage is just via each other and that they can be deleted. Python uses reference counting, but also has an optional garbage collector. cf. https://docs.python.org/3/library/gc.html#module-gc -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk |
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Wednesday, December 20, 2017 19:04:20 Paulo Pinto via Digitalmars-d wrote:
> On Wednesday, 20 December 2017 at 18:28:20 UTC, Ali Çehreli wrote:
> > On 12/20/2017 01:14 AM, Paulo Pinto wrote:
> > > from developers that learned it before C++98 and
> > > can't care less what is being discussed on Reddit and HN.
> >
> > I don't blame them one bit because keeping up with C++ and learning C++ Core Guidelines is a tremendous task:
> >
> >
> > https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuideline s.md
> >
> > I keep starting writing replies here about C++ Core Guidelines but I delete them after counting to ten. Not this time... :)
> >
> > I think it's a psychological phenomenon worthy of scientific interest how a craft with so many guidelines can still be accepted. I am baffled how otherwise wonderful and smart people can direct others to that document with a straight face, let alone market it as one of the greatest gifts to C++ programmers (cf. CppCon 2015 keynotes by Herb Sutter and Bjarne Stroustrup.)
>
> Mostly because it is an easier path to get people to migrate to safer coding practices than doing a full reboot, no one wants to do a Python 2 to Python 3.
I think that the reality of the matter is that such a shift for C++ is pointless. If you're going to break backwards compatability, you're breaking one of C++'s greatest strengths. At that point, you might as well go to D or Rust or some other language that's tried to fill C++'s shoes - or invent another new language that attempts it. C++ can be improved, and on the whole, they have been doing exactly that, but fundamentally, they really can't fix it without going against some of the main reasons why many folks stick with C++ in the first place.
- Jonathan M Davis
|
December 20, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On 12/20/17 10:28, Ali Çehreli wrote: > On 12/20/2017 01:14 AM, Paulo Pinto wrote: > >> from developers that learned it before C++98 and >> can't care less what is being discussed on Reddit and HN. > > I don't blame them one bit because keeping up with C++ and learning C++ > Core Guidelines is a tremendous task: > > > https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md > > > I keep starting writing replies here about C++ Core Guidelines but I > delete them after counting to ten. Not this time... :) > > I think it's a psychological phenomenon worthy of scientific interest > how a craft with so many guidelines can still be accepted. I am baffled > how otherwise wonderful and smart people can direct others to that > document with a straight face, let alone market it as one of the > greatest gifts to C++ programmers (cf. CppCon 2015 keynotes by Herb > Sutter and Bjarne Stroustrup.) > > Ali > I had Chrome estimate how many pages it would be print out. In "Letter" size it's 181 double-sided pages. It's not "Guidelines" it is a book on "Best Practices" -- Adam Wilson IRC: LightBender import quiet.dlang.dev; |
December 21, 2017 Re: Maybe D is right about GC after all ! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Wilson | On Thursday, 21 December 2017 at 04:16:32 UTC, Adam Wilson wrote:
> On 12/20/17 10:28, Ali Çehreli wrote:
>> On 12/20/2017 01:14 AM, Paulo Pinto wrote:
>>
>>> from developers that learned it before C++98 and
>>> can't care less what is being discussed on Reddit and HN.
>>
>> I don't blame them one bit because keeping up with C++ and learning C++
>> Core Guidelines is a tremendous task:
>>
>>
>> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
>>
>>
>> I keep starting writing replies here about C++ Core Guidelines but I
>> delete them after counting to ten. Not this time... :)
>>
>> I think it's a psychological phenomenon worthy of scientific interest
>> how a craft with so many guidelines can still be accepted. I am baffled
>> how otherwise wonderful and smart people can direct others to that
>> document with a straight face, let alone market it as one of the
>> greatest gifts to C++ programmers (cf. CppCon 2015 keynotes by Herb
>> Sutter and Bjarne Stroustrup.)
>>
>> Ali
>>
>
> I had Chrome estimate how many pages it would be print out. In "Letter" size it's 181 double-sided pages. It's not "Guidelines" it is a book on "Best Practices"
Bjarne, Herb and others are quite aware that the only way to actually know the guidelines is via static code analyzers, like clang tidy and VC++ checkers.
And lets be a bit honest here, if someone took the effort of writing the D Core Guidelines, including warnings about half done features and differences between compilers, how many pages would it be?
Maybe not 181, but I can easily imagine it getting around 100.
--
Paulo
|
Copyright © 1999-2021 by the D Language Foundation