Opportunities for D

Brad Anderson via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 8 20:18:53 PDT 2014


On Wednesday, 9 July 2014 at 02:44:54 UTC, Walter Bright wrote:
> On 7/8/2014 6:01 PM, Mike wrote:
>> On Tuesday, 8 July 2014 at 21:22:31 UTC, Walter Bright wrote:
>>
>>> 1. Ref Counting
>>>
>>> I believe that ARC is a pipe dream for D, as we've discussed 
>>> extensively here.
>>> But a ref counted object should work, and would be very 
>>> attractive, much like
>>> C++'s shared_ptr<T>.
>>
>> How does this differ from std.typecons.RefCounted?
>
> Let me put it this way: users all complain that D doesn't have 
> ref counting. If typecons.RefCounted works, why is this 
> happening? What can be done to convince people that D does ref 
> counting? If it doesn't work, what needs to be done to fix it?

Well, for starters RefCounted doesn't work with classes. That
needs to be implemented. I'm not sure what was problematic about
implementing it for classes though (anyone reading know?).

Secondly, a lot of things need to be extracted from std.grabbag
(AKA std.typecons) and put in modules with names that are much
more obvious. Nobody thinks to check "typecons" (whatever that
means)* but it contains some of the most useful general purpose
features in Phobos. It has Tuple, Unique, RefCounted, Scoped,
Nullable, and more all buried away in an unexpected module.

I propose just stealing C++'s structure when possible (so
std.tuple and std.memory for starters).


* Yes, I know it means Type Constructors. That isn't clear the
first time someone reads the name though.


More information about the Digitalmars-d mailing list