Smart pointers instead of GC?

Adam Wilson flyboynw at gmail.com
Sat Feb 1 11:11:28 PST 2014


On Sat, 01 Feb 2014 09:57:41 -0800, Frustrated <c1514843 at drdrb.com> wrote:

> On Saturday, 1 February 2014 at 17:30:54 UTC, Sean Kelly wrote:
>> On Saturday, 1 February 2014 at 11:40:37 UTC, Frustrated wrote:
>>>
>>> And why does Phobos/runtime require the GC in so many cases when
>>> it could just use an internal buffer? So much effort has been put
>>> in to make the GC work that it simply has neglected all those
>>> that can't use it as it is.
>>
>> This is the crux of the problem.  It's not so much that D uses garbage  
>> collection as that Phobos is built in a way that prevents the reuse of  
>> existing buffers.  It becomes much harder to sell the language to a GC  
>> averse group if it turns out they can't use the standard library as  
>> well.  Though I guess Tango is an option here as a replacement.
>
> Right, and because of the mentality that the GC is one size that
> fits all, phobos got this way. That mentality is still pervasive.
> I call it laziness.
>
> I think that at some point phobos will need to be rewritten...
> maybe more .net like(there sense of hierarchy and presentation is
> excellent).  Maybe D needs a proper allocator sub system built in
> to get to that point?

You do realize that in .NET the BCL is not GC-optional right. It  
GC-allocates like a fiend. What they have is a monumentally better GC than  
D. .NET is actually proof that GC's can work quite well in all but the  
most extreme edge cases.

Effectively what you are saying is ".NET does it well with a GC so we need  
to rewrite Phobos to not use a GC" ... Um wait, what?

I am not saying to Phobos needs to allocate as much as it does, just that  
argument itself fails to met a basic standard of logical coherency.

-- 
Adam Wilson
GitHub/IRC: LightBender
Aurora Project Coordinator


More information about the Digitalmars-d mailing list